Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev

This commit is contained in:
张玉久
2020-01-15 14:46:30 +08:00
9 changed files with 42 additions and 37 deletions

View File

@ -12,6 +12,11 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.collection.ArrayMap;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.common.util.BitmapUtils;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DialogUtils;
@ -45,11 +50,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.collection.ArrayMap;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
/**
* Created by LGT on 2016/8/15.
@ -551,7 +551,7 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
} else {
downloadingList.remove(location.intValue());
initLocationMap();
notifyItemRemoved(location + getBase() + 1);
notifyDataSetChanged();
EventBus.getDefault().post(new EBDownloadChanged("download", View.VISIBLE,
downloadingList.size()));
}

View File

@ -27,14 +27,11 @@ import com.gh.common.util.DisplayUtils;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.MtaHelper;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.DownloadManagerActivity;
import com.gh.gamecenter.MessageActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.SearchActivity;
import com.gh.gamecenter.WebActivity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.eventbus.EBDownloadStatus;
import com.gh.gamecenter.eventbus.EBReuse;
import com.gh.gamecenter.message.MessageUnreadViewModel;
@ -257,16 +254,10 @@ public class SearchToolbarFragment extends BaseFragment implements View.OnClickL
MtaHelper.onEvent("首页_点击", "顶栏", "消息中心");
DataCollectionUtils.uploadClick(getActivity(), "消息图标", "主页");
if (BuildConfig.DEBUG) {
SettingsEntity.Advertisement videoAdvertisement = Config.getSettings().getVideoAdvertisement();
Intent webIntentByShare = WebActivity.getWebIntentByShare(getContext(), videoAdvertisement.getLink(), true);
startActivity(webIntentByShare);
} else {
CheckLoginUtils.checkLogin(requireContext(), "(工具栏)", () -> {
Intent i = MessageActivity.getIntent(requireContext(), "(工具栏)");
startActivityForResult(i, REQUEST_MESSAGE);
});
}
CheckLoginUtils.checkLogin(requireContext(), "(工具栏)", () -> {
Intent i = MessageActivity.getIntent(requireContext(), "(工具栏)");
startActivityForResult(i, REQUEST_MESSAGE);
});
break;
}
}

View File

@ -20,7 +20,7 @@ class HomeGameItemViewHolder(val binding: HomeGameItemBinding) : BaseRecyclerVie
fun bindGame(game: GameEntity) {
binding.data = game
val firstTag = if (game.tagStyle.isNotEmpty()) " " + game.tagStyle[0].name + " " else ""
val firstTag = if (game.tagStyle.isNotEmpty()) " " + game.tagStyle[0].name + " " else ""
val gameBrief = SpannableStringBuilder(firstTag + " " + game.brief)
if (firstTag.isNotEmpty()) {
val tagSpan = RoundStrokeBackgroundColorSpan(

View File

@ -26,6 +26,7 @@ import com.gh.download.DownloadManager
import com.gh.download.cache.CacheManager
import com.gh.download.cache.CacheObserver
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.entity.LinkEntity
import com.gh.gamecenter.entity.VideoEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
@ -391,7 +392,15 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
marquee_ad.setOnClickListener {
DirectUtils.directToLinkPage(requireContext(), LinkEntity(link = link, type = linkType, community = linkCommunity), "", "视频详情")
}
icon_ad.setOnClickListener { marquee_ad.performClick() }
icon_ad.setOnClickListener {
if (linkType == "web") {
// 当前入口打开Web页面要显示分享按钮
val webIntentByShare = WebActivity.getWebIntentByShare(context, link, true)
startActivity(webIntentByShare)
} else {
marquee_ad.performClick()
}
}
if (duration > 0) {
mAdCountDownTimer = startTimer(duration.toLong())
}