Merge branch 'dev' of gitlab.ghzhushou.com:halo/assistant-android into dev
This commit is contained in:
@ -12,6 +12,7 @@ import android.view.ViewGroup;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.util.DataLogUtils;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.util.StringUtils;
|
||||
@ -37,13 +38,16 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
|
||||
private int mSize;
|
||||
private boolean mIsInfiniteLoop;
|
||||
|
||||
private String mSource;
|
||||
|
||||
// private ImageIndicator indicator;
|
||||
|
||||
public ImagePagerAdapter(Context context, List<SlideEntity> slideEntityList, boolean isInfiniteLoop) {
|
||||
public ImagePagerAdapter(Context context, List<SlideEntity> slideEntityList, boolean isInfiniteLoop, String source) {
|
||||
mContext = context;
|
||||
mSlideEntityList = slideEntityList;
|
||||
mSize = getSize(slideEntityList);
|
||||
mIsInfiniteLoop = isInfiniteLoop;
|
||||
mSource= source;
|
||||
}
|
||||
|
||||
public int getSize(List<SlideEntity> sourceList) {
|
||||
@ -83,6 +87,8 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
|
||||
, "=", String.valueOf(getPosition(position) + 1)
|
||||
, "])");
|
||||
|
||||
DataUtils.onMtaEvent(mContext, "轮播图", mSource, String.valueOf(position));
|
||||
|
||||
switch (slideEntity.getType()) {
|
||||
case "game":
|
||||
GameDetailActivity.startGameDetailActivity(mContext, slideEntity.getLink(), entrance);
|
||||
|
||||
@ -137,7 +137,7 @@ public class MainWrapperFragment extends BaseFragment_ViewPager_Checkable {
|
||||
EventBus.getDefault().post(new EBUISwitch(EB_MAINACTIVITY_TAG, INDEX_GAME));
|
||||
checkIndex(INDEX_GAME);
|
||||
EventBus.getDefault().post(new EBSkip(EB_MAINACTIVITY_TAG, skip.getCurrentItem()));
|
||||
mViewPager.setCurrentItem(skip.getCurrentItem());
|
||||
mViewPager.setCurrentItem(skip.getCurrentItem(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -134,8 +134,10 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
|
||||
holder.binding.headMore.setOnClickListener({
|
||||
if ("all" == column?.home) {
|
||||
DataUtils.onMtaEvent(mContext, "游戏专题", "全部", column.name)
|
||||
SubjectActivity.startSubjectActivity(mContext, column.id, column.name, column.isOrder, "(游戏-专题:" + column.name + "-全部)")
|
||||
} else {
|
||||
DataUtils.onMtaEvent(mContext, "游戏专题", "换一批", column?.name)
|
||||
holder.binding.headPb.visibility = View.VISIBLE
|
||||
mViewModel.changeSubjectGame(column?.id!!)
|
||||
}
|
||||
@ -212,6 +214,7 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
|
||||
binding.list = subjectDigestList
|
||||
binding.clickListener = OnViewClickListener { v, data ->
|
||||
DataUtils.onMtaEvent(mContext, "推荐入口", if (TextUtils.isEmpty(blockName)) "首页" else blockName, (data).toString())
|
||||
if (data is Int) {
|
||||
if (data < subjectDigestList?.size!!) {
|
||||
val entity = subjectDigestList[data]
|
||||
@ -246,6 +249,7 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
}
|
||||
|
||||
binding.entranceContainer5.setOnClickListener(View.OnClickListener {
|
||||
DataUtils.onMtaEvent(mContext, "推荐入口", if (TextUtils.isEmpty(blockName)) "首页" else blockName, "5")
|
||||
if (mViewModel.blockData != null) {
|
||||
if (subjectDigestList != null && subjectDigestList.size >= 5) {
|
||||
val entity = subjectDigestList[4]
|
||||
@ -293,7 +297,7 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
}
|
||||
}
|
||||
|
||||
binding.viewPager.adapter = ImagePagerAdapter(mContext, slideList, true)
|
||||
binding.viewPager.adapter = ImagePagerAdapter(mContext, slideList, true, if (TextUtils.isEmpty(blockName)) "首页" else blockName)
|
||||
binding.viewPager.interval = 3000
|
||||
binding.viewPager.startAutoScroll()
|
||||
binding.viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
|
||||
@ -371,7 +375,7 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
})
|
||||
holder.binding.gameImageIcon.setOnClickListener({
|
||||
DataCollectionUtils.uploadClick(mContext, "$name-大图", "游戏-专题")
|
||||
|
||||
DataUtils.onMtaEvent(mContext, "游戏专题", "大图", name)
|
||||
when (entity?.type) {
|
||||
"game" -> GameDetailActivity.startGameDetailActivity(mContext, link, "(游戏-专题:$name-大图)", mItemDataList[position].exposureEvent)
|
||||
"news" -> {
|
||||
|
||||
Reference in New Issue
Block a user