Compare commits

...

8 Commits

36 changed files with 110 additions and 95 deletions

View File

@ -318,7 +318,7 @@ public class BindingAdapters {
@BindingAdapter("game")
public static void setGame(View view, GameEntity gameEntity) {
if (gameEntity != null && view instanceof GameIconView) {
((GameIconView) view).setGameEntity(gameEntity);
((GameIconView) view).displayGameIcon(gameEntity);
}
}

View File

@ -141,7 +141,7 @@ public class DataUtils {
@Override
public void onFailure(String s) {
Utils.log(s);
MtaHelper.onEventWithBasicDeviceInfo("开发辅助", "GID 获取异常", s);
}
});
}

View File

@ -9,6 +9,7 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
@ -272,13 +273,23 @@ public class DisplayUtils {
}
public static int getToastOffset() {
int i = Resources.getSystem().getIdentifier("toast_y_offset", "dimen", "android");
return HaloApp.getInstance().getApplication().getResources().getDimensionPixelSize(i);
try {
int i = Resources.getSystem().getIdentifier("toast_y_offset", "dimen", "android");
return HaloApp.getInstance().getApplication().getResources().getDimensionPixelSize(i);
} catch (Resources.NotFoundException e) {
e.printStackTrace();
return dip2px(24);
}
}
public static int getToastDefaultGravity() {
int i = Resources.getSystem().getIdentifier("config_toastDefaultGravity", "integer", "android");
return HaloApp.getInstance().getApplication().getResources().getInteger(i);
try {
int i = Resources.getSystem().getIdentifier("config_toastDefaultGravity", "integer", "android");
return HaloApp.getInstance().getApplication().getResources().getInteger(i);
} catch (Resources.NotFoundException e) {
e.printStackTrace();
return Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
}
}
public static boolean hasSoftKeys(Context context) {

View File

@ -9,6 +9,7 @@ import com.facebook.drawee.generic.RoundingParams
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.util.DisplayUtils
import com.gh.common.util.ImageUtils
import com.gh.common.util.goneIf
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.GameEntity
import kotlinx.android.synthetic.main.layout_game_icon.view.*
@ -21,6 +22,7 @@ class GameIconView : ConstraintLayout {
constructor(context: Context, attrs: AttributeSet) : super(context, attrs, 0) {
initView(attrs)
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
initView(attrs)
}
@ -37,15 +39,20 @@ class GameIconView : ConstraintLayout {
gameIconDecoratorIv.hierarchy.roundingParams = roundingParams
}
fun setGameEntity(game: GameEntity) {
fun displayGameIcon(game: GameEntity) {
if (!TextUtils.isEmpty(game.rawIcon)) {
ImageUtils.display(gameIconIv, game.rawIcon)
ImageUtils.display(gameIconDecoratorIv, game.iconSubscript)
displayGameIcon(game.rawIcon ?: "", game.iconSubscript)
} else {
ImageUtils.display(gameIconIv, game.icon)
displayGameIcon(game.icon ?: "", null)
}
}
fun displayGameIcon(icon: String?, iconSubscript: String?) {
ImageUtils.display(gameIconIv, icon)
ImageUtils.display(gameIconDecoratorIv, iconSubscript)
gameIconDecoratorIv.goneIf(TextUtils.isEmpty(iconSubscript))
}
fun getIconIv(): SimpleDraweeView = gameIconIv
fun getIconDecoratorIv(): SimpleDraweeView = gameIconDecoratorIv

View File

@ -15,7 +15,6 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.common.util.StringUtils;
@ -179,10 +178,9 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
});
if (mLibaoEntity.getGame() != null) {
ImageUtils.display(holder.libaoGameIcon.getIconIv(), mLibaoEntity.getGame().getIcon());
ImageUtils.display(holder.libaoGameIcon.getIconDecoratorIv(), mLibaoEntity.getGame().getIconSubscript());
holder.libaoGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript());
} else {
ImageUtils.display(holder.libaoGameIcon.getIconIv(), mLibaoEntity.getIcon());
holder.libaoGameIcon.displayGameIcon(mLibaoEntity.getIcon(), null);
}
holder.libaoName.setText(mLibaoEntity.getName());
if (TextUtils.isEmpty(mLibaoEntity.getPlatform())) {

View File

@ -13,7 +13,6 @@ import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.common.constant.Config;
import com.gh.common.databind.BindingAdapters;
import com.gh.common.util.CheckLoginUtils;
import com.gh.common.util.CommentUtils;
import com.gh.common.util.ConcernContentUtils;
@ -279,10 +278,9 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
}
if (mConcernEntity.getGame() != null) {
ImageUtils.display(viewHolder.thumb.getIconIv(), mConcernEntity.getGame().getIcon());
ImageUtils.display(viewHolder.thumb.getIconDecoratorIv(), mConcernEntity.getGame().getIconSubscript());
viewHolder.thumb.displayGameIcon(mConcernEntity.getGame().getIcon(), mConcernEntity.getGame().getIconSubscript());
} else {
ImageUtils.display(viewHolder.thumb.getIconIv(), mConcernEntity.getGameIcon());
viewHolder.thumb.displayGameIcon(mConcernEntity.getGameIcon(), null);
}
viewHolder.title.setText(mConcernEntity.getGameName());
NewsUtils.setNewsPublishOn(viewHolder.time, mConcernEntity.getTime());

View File

@ -191,8 +191,7 @@ class AmwayAdapter(context: Context,
MtaHelper.onEvent("安利墙", "点击", "评论${blockPosition}_${amway.game.name}_游戏")
}
ImageUtils.display(binding.gameIconView.getIconIv(), amway.game.rawIcon ?: amway.game.icon)
ImageUtils.display(binding.gameIconView.getIconDecoratorIv(), amway.game.iconSubscript)
binding.gameIconView.displayGameIcon(amway.game.rawIcon ?: amway.game.icon, amway.game.iconSubscript)
amway.game.tag?.let {
val tags = it.take(3)

View File

@ -118,11 +118,11 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
if (!TextUtils.isEmpty(icon)) {
if (!TextUtils.isEmpty(rawIcon)) {
icon = rawIcon;
ImageUtils.display(viewHolder.dmIcon.getIconDecoratorIv(), ExtensionsKt.getMetaExtra(downloadEntity, Constants.GAME_ICON_SUBSCRIPT));
}
ImageUtils.display(viewHolder.dmIcon.getIconIv(), icon);
viewHolder.dmIcon.displayGameIcon(icon, ExtensionsKt.getMetaExtra(downloadEntity, Constants.GAME_ICON_SUBSCRIPT));
} else {
ImageUtils.display(viewHolder.dmIcon.getIconIv(), R.mipmap.logo);
viewHolder.dmIcon.getIconDecoratorIv().setVisibility(View.GONE);
}
String downloadTitle;

View File

@ -316,6 +316,7 @@ class GameUpdateFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> implemen
if (updateEntity.getName().contains("光环助手")) {
ImageUtils.display(viewHolder.guIcon.getIconIv(), R.mipmap.logo);
viewHolder.guIcon.getIconDecoratorIv().setVisibility(View.GONE);
} else {
BindingAdapters.setGame(viewHolder.guIcon, updateEntity.transformGameEntity());
}

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.download;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
@ -9,7 +10,6 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.common.AppExecutor;
import com.gh.common.constant.ItemViewType;
import com.gh.common.databind.BindingAdapters;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureSource;
import com.gh.common.exposure.ExposureType;
@ -18,7 +18,9 @@ import com.gh.common.filter.RegionSettingHelper;
import com.gh.common.util.ApkActiveUtils;
import com.gh.common.util.DataCollectionUtils;
import com.gh.common.util.DownloadItemUtils;
import com.gh.common.util.ExtensionsKt;
import com.gh.common.util.GameUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.common.util.ThirdPartyPackageHelper;
@ -283,11 +285,14 @@ public class InstalledGameFragmentAdapter extends BaseRecyclerAdapter<ViewHolder
if (gameEntity.getApk().size() > 0) {
name = String.format("%s - %s", gameEntity.getName(),
PlatformUtils.getInstance(mContext).getPlatformName(gameEntity.getApk().get(0).getPlatform()));
binding.gameIcon.getIconIv().setImageDrawable(PackageUtils.getIconByPackage(mContext, gameEntity.getApk().get(0).getPackageName()));
binding.gameIconIv.setImageDrawable(PackageUtils.getIconByPackage(mContext, gameEntity.getApk().get(0).getPackageName()));
binding.gameIconDecoratorIv.setVisibility(View.GONE);
binding.gameDes.setText(String.format("V%s", PackageUtils.getVersionByPackage(gameEntity.getApk().get(0).getPackageName())));
} else {
name = gameEntity.getName();
BindingAdapters.setGame(binding.gameIcon, gameEntity);
ImageUtils.display(binding.gameIconIv, gameEntity.getRawIconInAdvanced());
ImageUtils.display(binding.gameIconDecoratorIv, gameEntity.getIconSubscript());
ExtensionsKt.goneIf(binding.gameIconDecoratorIv, TextUtils.isEmpty(gameEntity.getIconSubscript()));
binding.gameDes.setText(gameEntity.getBrief());
}

View File

@ -405,6 +405,10 @@ data class GameEntity(
return entryMap!!
}
fun getRawIconInAdvanced() : String {
return rawIcon ?: icon ?: ""
}
fun setEntryMap(entryMap: androidx.collection.ArrayMap<String, DownloadEntity>?) {
if (entryMap != null) {
this.entryMap = entryMap

View File

@ -76,7 +76,7 @@ data class LibaoEntity(
val libaoEntity = LibaoEntity()
libaoEntity.id = concernEntity.id
libaoEntity.content = concernEntity.content
libaoEntity.game = SimpleGame(id = concernEntity.gameId!!, name = concernEntity.gameName!!)
libaoEntity.game = concernEntity.game
libaoEntity.icon = concernEntity.gameIcon
libaoEntity.name = concernEntity.name
libaoEntity.platform = concernEntity.platform

View File

@ -110,7 +110,7 @@ class GameFragmentAdapter(context: Context,
}
ItemViewType.GAME_NORMAL -> {
val binding = GameItemBinding.bind(mLayoutInflater.inflate(R.layout.game_item, parent, false))
if (mContext is MainActivity) binding.gameIcon.setTag(R.id.tag_show_gif, false)
if (mContext is MainActivity) binding.gameIconIv.setTag(R.id.tag_show_gif, false)
GameItemViewHolder(binding)
}
ItemViewType.GAME_IMAGE -> {

View File

@ -32,7 +32,7 @@ class GameVerticalAdapter(context: Context,
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GameItemViewHolder {
val binding = GameItemBinding.bind(mLayoutInflater.inflate(R.layout.game_item, parent, false))
if (!mShowGameIconGif) binding.gameIcon.setTag(R.id.tag_show_gif, false)
if (!mShowGameIconGif) binding.gameIconIv.setTag(R.id.tag_show_gif, false)
return GameItemViewHolder(binding)
}

View File

@ -44,8 +44,7 @@ class GameRelatedVersionAdapter(val context: Context, val gameName: String, val
is GameDetailRelatedViewHolder -> {
holder.binding.relatedVersion = relatedVersion
GameViewUtils.setLabelList(context, holder.binding.gameLabelLl, "type", relatedVersion.gameTags)
ImageUtils.display(holder.binding.gameIconView.getIconIv(), relatedVersion.game?.getIcon())
ImageUtils.display(holder.binding.gameIconView.getIconDecoratorIv(), relatedVersion.game?.iconSubscript)
holder.binding.gameIconView.displayGameIcon(relatedVersion.game?.getIcon(), relatedVersion.game?.iconSubscript)
holder.itemView.setOnClickListener {
MtaHelper.onEvent("游戏详情_新", "相关游戏版本", "${gameName}+${relatedVersion.gameName}")
GameDetailActivity.startGameDetailActivity(context, relatedVersion.gameId,

View File

@ -51,8 +51,7 @@ class MyRatingAdapter(context: Context,
holder.itemView.tv_comment.setExpandMaxLines(maxDesLines)
holder.itemView.tv_comment.setIsExpanded(Int.MAX_VALUE == maxDesLines)
ImageUtils.display(holder.binding.gameIcon.getIconIv(), rating.game.getRawIconIfExisted())
ImageUtils.display(holder.binding.gameIcon.getIconDecoratorIv(), rating.game.iconSubscript)
holder.binding.gameIcon.displayGameIcon(rating.game.getRawIconIfExisted(), rating.game.iconSubscript)
val m = Pattern.compile(RatingEditActivity.LABEL_REGEX).matcher(rating.content)
if (m.find()) {

View File

@ -12,10 +12,8 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.base.OnListClickListener;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.constant.ItemViewType;
import com.gh.common.databind.BindingAdapters;
import com.gh.common.util.ConcernContentUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.common.util.NewsUtils;
import com.gh.common.util.NumberUtils;
@ -354,10 +352,9 @@ class ConcernAdapter extends BaseRecyclerAdapter<ViewHolder> {
viewHolder.setClickData(concernEntity);
if (concernEntity.getGame() != null) {
ImageUtils.display(viewHolder.thumb.getIconIv(), concernEntity.getGame().getIcon());
ImageUtils.display(viewHolder.thumb.getIconDecoratorIv(), concernEntity.getGame().getIconSubscript());
viewHolder.thumb.displayGameIcon(concernEntity.getGame().getIcon(), concernEntity.getGame().getIconSubscript());
} else {
ImageUtils.display(viewHolder.thumb.getIconIv(), concernEntity.getGameIcon());
viewHolder.thumb.displayGameIcon(concernEntity.getGameIcon(), null);
}
viewHolder.title.setText(concernEntity.getGameName());
NewsUtils.setNewsPublishOn(viewHolder.time, concernEntity.getTime());

View File

@ -11,7 +11,6 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.base.OnListClickListener;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.constant.ItemViewType;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.gamecenter.R;
@ -210,8 +209,7 @@ class Libao2FragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
LibaoEntity libaoEntity = mLibaoList.get(position - 1);
holder.setClickData(libaoEntity);
holder.libaoName.setText(libaoEntity.getName());
ImageUtils.display(holder.libaoGameIcon.getIconIv(), libaoEntity.getIcon());
ImageUtils.display(holder.libaoGameIcon.getIconDecoratorIv(), libaoEntity.getIconSubscript());
holder.libaoGameIcon.displayGameIcon(libaoEntity.getIcon(), libaoEntity.getIconSubscript());
if (TextUtils.isEmpty(libaoEntity.getPlatform())) {
holder.libaoGameName.setText(libaoEntity.getGame().getName());
} else {

View File

@ -11,7 +11,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.gamecenter.LibaoDetailActivity;
@ -191,9 +190,7 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder>
LibaoNormalViewHolder holder = (LibaoNormalViewHolder) viewHolder;
final LibaoEntity libaoEntity = mLibaoList.get(position);
holder.libaoName.setText(libaoEntity.getName());
ImageUtils.display(holder.libaoGameIcon.getIconIv(), libaoEntity.getIcon());
ImageUtils.display(holder.libaoGameIcon.getIconDecoratorIv(), libaoEntity.getIconSubscript());
holder.libaoGameIcon.displayGameIcon(libaoEntity.getIcon(), libaoEntity.getIconSubscript());
if (TextUtils.isEmpty(libaoEntity.getPlatform())) {
holder.libaoGameName.setText(libaoEntity.getGame().getName());

View File

@ -13,7 +13,6 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.constant.ItemViewType;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.common.util.UrlFilterUtils;
import com.gh.gamecenter.R;
@ -158,8 +157,7 @@ public class LibaoHistoryAdapter extends BaseRecyclerAdapter<ViewHolder> {
viewHolder.libaoName.setText(libaoEntity.getName());
viewHolder.libaoDes.setText(libaoEntity.getContent());
viewHolder.libaoGameName.setText(libaoEntity.getGame().getName());
ImageUtils.display(viewHolder.libaoGameIcon.getIconIv(), libaoEntity.getIcon());
ImageUtils.display(viewHolder.libaoGameIcon.getIconDecoratorIv(), libaoEntity.getIconSubscript());
viewHolder.libaoGameIcon.displayGameIcon(libaoEntity.getIcon(), libaoEntity.getIconSubscript());
//领取状态
LibaoUtils.setLiBaoBtnStatusRound(viewHolder.libaoBtnStatus

View File

@ -191,8 +191,7 @@ class LibaoNewAdapter(context: Context, callBackListener: OnRequestCallBackListe
holder.libaoGameName.text = StringUtils.buildString(libaoEntity.game?.name, " - ", PlatformUtils.getInstance(mContext)
.getPlatformName(libaoEntity.platform))
}
ImageUtils.display(holder.libaoGameIcon.getIconIv(), libaoEntity.getIcon())
ImageUtils.display(holder.libaoGameIcon.getIconDecoratorIv(), libaoEntity.getIconSubscript())
holder.libaoGameIcon.displayGameIcon(libaoEntity.getIcon(), libaoEntity.getIconSubscript())
val content: String
if (libaoEntity.content!!.contains("<br/>")) {

View File

@ -204,8 +204,7 @@ class LibaoSearchAdapter(fragment: LibaoSearchFragment,
holder.libaoGameName.text = StringUtils.buildString(libaoEntity.game?.name, " - ", PlatformUtils.getInstance(mContext)
.getPlatformName(libaoEntity.platform))
}
ImageUtils.display(holder.libaoGameIcon.getIconIv(), libaoEntity.getIcon())
ImageUtils.display(holder.libaoGameIcon.getIconDecoratorIv(), libaoEntity.getIconSubscript())
holder.libaoGameIcon.displayGameIcon(libaoEntity.getIcon(), libaoEntity.getIconSubscript())
val content: String
if (libaoEntity.content!!.contains("<br/>")) {

View File

@ -22,8 +22,7 @@ class InstalledGameAdapter(mContext: Context, val games: ArrayList<GameInstall>)
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val gameInstall = games[position]
holder.itemView.apply {
ImageUtils.display(game_icon.getIconIv(), gameInstall.icon)
ImageUtils.display(game_icon.getIconDecoratorIv(), gameInstall.iconSubScript)
game_icon.displayGameIcon(gameInstall.icon, gameInstall.iconSubScript)
game_name.text = gameInstall.name
}
}

View File

@ -131,8 +131,7 @@ class CommunityFragment : BaseLazyTabFragment() {
|| (!status.isActive && !channel.contains("TEST"))) {
showCommunitySelectFragment()
} else {
ImageUtils.display(mAskSelectCommunity.getIconIv(), UserManager.getInstance().community.icon)
ImageUtils.display(mAskSelectCommunity.getIconDecoratorIv(), UserManager.getInstance().community.iconSubscript)
mAskSelectCommunity.displayGameIcon(UserManager.getInstance().community.icon, UserManager.getInstance().community.iconSubscript)
showAvailableInfo()
mViewPager.currentItem = INDEX_RECOMMEND

View File

@ -5,7 +5,6 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ProgressBar
import com.gh.common.util.CommunityHelper
import com.gh.common.util.ImageUtils
import com.gh.common.util.UrlFilterUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.qa.entity.CommunitySelectEntity
@ -54,8 +53,7 @@ class ArticleSelectGameAdapter(context: Context, loading: ProgressBar,
override fun onBindViewHolder(holder: SelectGameViewHolder, position: Int) {
val entity = mList[position]
ImageUtils.display(holder.gameIcon.getIconIv(), entity.game.getRawIconIfExisted())
ImageUtils.display(holder.gameIcon.getIconDecoratorIv(), entity.game.iconSubscript)
holder.gameIcon.displayGameIcon(entity.game.getRawIconIfExisted(), entity.game.iconSubscript)
holder.gameName.text = entity.name
holder.itemView.setOnClickListener { callback.invoke(entity) }
}

View File

@ -132,11 +132,8 @@ class OpenedAdapter(context: Context, val mListViewModel: OpenedViewModel) : Lis
holder.bind.isSelectLeft = isSelectLeft
holder.bind.isSelectRight = isSelectRight
ImageUtils.display(holder.bind.gameIconLeft.getIconIv(), entity.leftData?.game?.getRawIconIfExisted())
ImageUtils.display(holder.bind.gameIconLeft.getIconDecoratorIv(), entity.leftData?.game?.iconSubscript)
ImageUtils.display(holder.bind.gameIconRight.getIconIv(), entity.rightData?.game?.getRawIconIfExisted())
ImageUtils.display(holder.bind.gameIconRight.getIconDecoratorIv(), entity.rightData?.game?.iconSubscript)
holder.bind.gameIconLeft.displayGameIcon(entity.leftData?.game?.getRawIconIfExisted(), entity.leftData?.game?.iconSubscript)
holder.bind.gameIconRight.displayGameIcon(entity.rightData?.game?.getRawIconIfExisted(), entity.rightData?.game?.iconSubscript)
if (isSelectLeft) {
holder.bind.communityNameLeft.setTextColor(R.color.theme_font.toColor())

View File

@ -14,7 +14,6 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.gh.common.util.BitmapUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.UrlFilterUtils;
import com.gh.gamecenter.R;
import com.gh.gamecenter.entity.GameInstall;
@ -171,12 +170,12 @@ public class SelectGameDialogAdapter extends BaseRecyclerAdapter<VotingSelectGam
if (isGameData) {
GameInstall installInfo = gameList.get(position);
ImageUtils.display(holder.gameIcon.getIconIv(), installInfo.getIcon());
ImageUtils.display(holder.gameIcon.getIconDecoratorIv(), installInfo.getIconSubScript());
holder.gameIcon.displayGameIcon(installInfo.getIcon(), installInfo.getIconSubScript());
holder.gameName.setText(installInfo.getName());
} else {
InstallGameEntity appEntity = appList.get(position - gameList.size());
holder.gameIcon.getIconIv().setImageBitmap(appEntity.getGameBm());
holder.gameIcon.getIconDecoratorIv().setVisibility(View.GONE);
holder.gameName.setText(appEntity.getGameName());
}

View File

@ -8,7 +8,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.gh.base.OnListClickListener;
import com.gh.common.constant.ItemViewType;
import com.gh.common.util.ImageUtils;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.viewholder.FooterViewHolder;
import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder;
@ -87,8 +86,7 @@ public class VotingAdapter extends ListAdapter<CommunitySelectEntity> {
AskSelectGameItemViewHolder bodyHolder = (AskSelectGameItemViewHolder) holder;
entity = mEntityList.get(position - TOP_ITEM_COUNT);
CommunitiesGameEntity game = entity.getGame();
ImageUtils.display(bodyHolder.mIcon.getIconIv(), game.getRawIconIfExisted());
ImageUtils.display(bodyHolder.mIcon.getIconDecoratorIv(), game.getIconSubscript());
bodyHolder.mIcon.displayGameIcon(game.getRawIconIfExisted(), game.getIconSubscript());
bodyHolder.setClickData(entity);
bodyHolder.mName.setText(game.getName());
bodyHolder.mVotecount.setText(entity.getVote() + "");

View File

@ -29,8 +29,7 @@ class SearchDefaultHotAdapter(context: Context,
holder.binding.run {
entity = hotSearch
ImageUtils.display(icon.getIconIv(), hotSearch.rawIcon ?: hotSearch.icon)
ImageUtils.display(icon.getIconDecoratorIv(), hotSearch.iconSubscript)
icon.displayGameIcon(hotSearch.rawIcon ?: hotSearch.icon, hotSearch.iconSubscript)
index.text = (position + 1).toString()
when (position) {

View File

@ -108,6 +108,7 @@ public class SuggestSelectGameAdapter extends BaseRecyclerAdapter<SelectGameView
public void onBindViewHolder(SelectGameViewHolder holder, int position) {
final InstallGameEntity installGameEntity = apkList.get(position);
holder.gameIcon.getIconIv().setImageBitmap(installGameEntity.getGameBm());
holder.gameIcon.getIconDecoratorIv().setVisibility(View.GONE);
holder.gameName.setText(installGameEntity.getGameName());
holder.itemView.setOnClickListener(v -> listener.loadDone(installGameEntity));

View File

@ -189,8 +189,7 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
likeCountTv.text = videoEntity.vote.toString()
commentCountTv.text = videoEntity.commentCount.toString()
ImageUtils.display(gameIconView.getIconIv(), videoEntity.game?.rawIcon ?: videoEntity.gameIcon)
ImageUtils.display(gameIconView.getIconDecoratorIv(), videoEntity.game?.iconSubscript)
gameIconView.displayGameIcon(videoEntity.game?.rawIcon ?: videoEntity.gameIcon, videoEntity.game?.iconSubscript)
ImageUtils.display(userIconIv, videoEntity.user.icon)
usernameTv.setOnClickListener {

View File

@ -66,8 +66,7 @@ class GameVideoActivity : ToolBarActivity() {
mViewModel = ViewModelProviders.of(this, factory).get(GameVideoViewModel::class.java)
mViewModel.gameViewInfo.observeNonNull(this, callback = {
if (it.status == Status.SUCCESS) {
ImageUtils.display(mBinding.gameIcon.getIconIv(), it.data?.game?.getIcon() ?: it.data?.gameIcon)
ImageUtils.display(mBinding.gameIcon.getIconDecoratorIv(), it.data?.game?.iconSubscript)
mBinding.gameIcon.displayGameIcon(it.data?.game?.getIcon() ?: it.data?.gameIcon, it.data?.game?.iconSubscript)
mBinding.gameName.text = it.data?.gameName
mBinding.likeCount.text = NumberUtils.transSimpleCount(it.data?.likeCount ?: 0)
mBinding.videoCount.text = NumberUtils.transSimpleCount(it.data?.videoCount ?: 0)

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto">
<data>
@ -28,7 +29,7 @@
type="com.gh.gamecenter.entity.GameEntity" />
</data>
<LinearLayout xmlns:fresco="http://schemas.android.com/apk/res-auto"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
@ -52,11 +53,28 @@
android:textSize="12sp"
android:visibility="gone" />
<com.gh.common.view.GameIconView
android:id="@+id/game_icon"
game="@{game}"
<RelativeLayout
android:layout_width="64dp"
android:layout_height="64dp" />
android:layout_height="64dp">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/gameIconIv"
style="@style/frescoStyle"
imageUrl="@{game.getRawIconInAdvanced()}"
android:layout_width="64dp"
android:layout_height="64dp"
fresco:roundedCornerRadius="10dp"
fresco:viewAspectRatio="1" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/gameIconDecoratorIv"
goneIf="@{TextUtils.isEmpty(game.iconSubscript)}"
imageUrl="@{game.iconSubscript}"
android:layout_width="64dp"
android:layout_height="64dp"
fresco:viewAspectRatio="1" />
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
@ -11,11 +11,11 @@
style="@style/frescoStyle"
android:layout_width="0dp"
android:layout_height="0dp"
fresco:layout_constraintBottom_toBottomOf="parent"
fresco:layout_constraintLeft_toLeftOf="parent"
fresco:layout_constraintRight_toRightOf="parent"
fresco:layout_constraintTop_toTopOf="parent"
fresco:viewAspectRatio="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:viewAspectRatio="1"
tools:layout_height="64dp"
tools:layout_width="64dp" />
@ -23,10 +23,10 @@
android:id="@+id/gameIconDecoratorIv"
android:layout_width="0dp"
android:layout_height="0dp"
fresco:layout_constraintBottom_toBottomOf="@id/gameIconIv"
fresco:layout_constraintLeft_toLeftOf="@id/gameIconIv"
fresco:layout_constraintRight_toRightOf="@id/gameIconIv"
fresco:layout_constraintTop_toTopOf="@id/gameIconIv"
fresco:viewAspectRatio="1" />
app:layout_constraintBottom_toBottomOf="@id/gameIconIv"
app:layout_constraintLeft_toLeftOf="@id/gameIconIv"
app:layout_constraintRight_toRightOf="@id/gameIconIv"
app:layout_constraintTop_toTopOf="@id/gameIconIv"
app:viewAspectRatio="1" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -7,7 +7,7 @@ ext {
targetSdkVersion = 26
// application info
versionCode = 190
versionCode = 191
versionName = "4.1.0"
applicationId = "com.gh.gamecenter"

View File

@ -51,8 +51,8 @@ SENSITIVE_API_HOST=https\://and-core-api.ghzs.com/v4d1d0/
# 请不要手动改动下面的值除非你明确需要以某个apk作为基准包需要打包请以scripts/tinker*.sh为准
TINKER_ENABLE=
TINKER_ID=5340a41
TINKER_BASE_APK_DIR=app-0807-19-17-59_5340a41
TINKER_ID=80a2cbb
TINKER_BASE_APK_DIR=app-0811-18-25-49_80a2cbb
android.useAndroidX=true
android.enableJetifier=true