Merge branch 'update_targetSDK' into 'dev'

Update targetSdk and fix MTA bugs.

See merge request !1
This commit is contained in:
juntao
2018-09-12 14:48:52 +08:00
14 changed files with 28 additions and 20 deletions

View File

@ -157,7 +157,7 @@ class GHUmengNotificationService : UmengMessageService() {
EntranceUtils.jumpActivity(context, bundle)
DataUtils.onMtaEvent(context, "消息弹窗",
type, "")
type, "Does not contains any parameter.")
Notifier.hide()
})

View File

@ -47,6 +47,14 @@ public class StringUtils {
return displayName + "(" + description + ")";
}
public static String eliminateHtmlContent(String s) {
if (TextUtils.isEmpty(s)) return "";
s = Html.fromHtml(s).toString();
s = s.replace("\n", "");
return s;
}
/**
* 截取字符串部分长度,超出的以 "..." 代替
*

View File

@ -9,6 +9,7 @@ import android.support.v7.widget.RecyclerView
import android.view.View
import com.gh.common.util.DataUtils
import com.gh.common.util.EntranceUtils
import com.gh.common.util.StringUtils
import com.gh.gamecenter.baselist.ListActivity
import com.gh.gamecenter.baselist.LoadStatus
import com.gh.gamecenter.entity.PersonalHistoryEntity
@ -56,6 +57,10 @@ class PersonalHomeActivity : ListActivity<PersonalHistoryEntity, PersonalHomeVie
mUnreadViewModel?.liveData?.observe(this, Observer {
mAdapter?.setMessageUnreadData(it)
})
mPath = intent.getStringExtra(EntranceUtils.KEY_PATH)
mUserId = intent.getStringExtra(EntranceUtils.KEY_USER_ID)
mListViewModel.personalDataLD.observe(this, Observer {
if (mListViewModel.userId == UserManager.getInstance().userId) {
val data = mUserViewModel?.loginObsUserinfo?.value?.data
@ -63,6 +68,8 @@ class PersonalHomeActivity : ListActivity<PersonalHistoryEntity, PersonalHomeVie
it?.name = data.name!!
it?.introduce = data.introduce
}
trackMtaEvent(it?.name)
mAdapter?.personalData = it
mAdapter?.notifyDataSetChanged()
})
@ -98,12 +105,10 @@ class PersonalHomeActivity : ListActivity<PersonalHistoryEntity, PersonalHomeVie
}
}
})
trackMtaEvent()
}
private fun trackMtaEvent() {
DataUtils.onMtaEvent(this, "个人主页", mPath, mUserId)
private fun trackMtaEvent(name: String? = "") {
DataUtils.onMtaEvent(this, "个人主页", mPath, StringUtils.combineTwoString(name, mUserId))
}
override fun onLoadRefresh() {

View File

@ -88,7 +88,7 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
, "=", String.valueOf(getPosition(position) + 1)
, "])");
DataUtils.onMtaEvent(mContext, "轮播图", mSource, String.valueOf(position));
DataUtils.onMtaEvent(mContext, "轮播图", mSource, String.valueOf(getPosition(position) % mSlideEntityList.size() + 1));
switch (slideEntity.getType()) {
case "game":

View File

@ -214,7 +214,7 @@ public class GameDetailFragment extends NormalFragment {
mTanBarXinXiTv.setTextColor(Color.BLACK);
mTanBarXinXiTv.setBackgroundDrawable(new ColorDrawable(0));
DataUtils.onMtaEvent(getContext(), "游戏详情", "默认[动态]", mGameEntity.getName());
DataUtils.onMtaEvent(getContext(), "游戏详情", "默认_动态", mGameEntity.getName());
} else {
mKaifuHint.setVisibility(View.GONE);
mTanBarXinXiTv.setTextColor(Color.WHITE);
@ -222,7 +222,7 @@ public class GameDetailFragment extends NormalFragment {
mTanBarFuLiTv.setTextColor(Color.BLACK);
mTanBarFuLiTv.setBackgroundDrawable(new ColorDrawable(0));
DataUtils.onMtaEvent(getContext(), "游戏详情", "默认[介绍]", mGameEntity.getName());
DataUtils.onMtaEvent(getContext(), "游戏详情", "默认_介绍", mGameEntity.getName());
}
}

View File

@ -133,7 +133,7 @@ class FuLiAdapter(context: Context,
holder.initItemPadding()
holder.itemView.setOnClickListener {
SuggestionActivity.startSuggestionActivity(mContext, SuggestType.gameQuestion, "game", mFuLiViewModel?.game?.name + ",问题反馈:")
DataUtils.onMtaEvent(mContext, "游戏详情", "此游戏有问题点击反馈", mFuLiViewModel?.game?.name)
DataUtils.onMtaEvent(mContext, "游戏详情", "此游戏有问题_点击反馈", mFuLiViewModel?.game?.name)
}
}
}
@ -199,7 +199,7 @@ class FuLiAdapter(context: Context,
viewHolder.newsMore.setOnClickListener {
DataCollectionUtils.uploadClick(mContext, "资讯攻略-全部", "游戏详情", mFuLiViewModel?.game?.name)
DataUtils.onMtaEvent(mContext, "游戏详情", "资讯攻略[全部]", mFuLiViewModel?.game?.name)
DataUtils.onMtaEvent(mContext, "游戏详情", "资讯攻略_全部", mFuLiViewModel?.game?.name)
val intent = GameNewsActivity.getIntent(mContext, mFuLiViewModel?.game?.name, mFuLiViewModel?.game?.id,
mEntrance + "+(游戏详情[" + mFuLiViewModel?.game?.name + "]:资讯攻略-全部)")
mContext.startActivity(intent)

View File

@ -152,7 +152,7 @@ class FuLiFragment : BaseFragment<Any>() {
EventBus.getDefault().post(EBReuse("showKaifuHint"))
} else if (GameDetailFragment.SCROLL_TO_KAIFU == reuse.type && layoutManager != null) {
DataUtils.onMtaEvent(context, "游戏详情开服表按钮", mFuLiViewModel?.game?.name)
DataUtils.onMtaEvent(context, "游戏详情", "开服表", mFuLiViewModel?.game?.name)
DataUtils.onMtaEvent(context, "游戏详情", "开服表", mFuLiViewModel?.game?.name)
val position = getServerPosition()
if (position > 0) layoutManager?.smoothScrollToPosition(mRecyclerView, null, position)
}

View File

@ -212,7 +212,7 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
EntranceUtils.jumpActivity(getActivity(), bundle);
DataUtils.onMtaEvent(getActivity(), "消息弹窗",
suffixText, "");
suffixText, "Does not contains any parameter.");
Notifier.hide();
})

View File

@ -9,6 +9,7 @@ import android.text.Html;
import com.gh.common.util.DataUtils;
import com.gh.common.util.LogUtils;
import com.gh.common.util.StringUtils;
import com.gh.gamecenter.qa.entity.AnswerDetailEntity;
import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
@ -41,14 +42,8 @@ public class AnswerDetailViewModel extends AndroidViewModel {
LogUtils.uploadAnswers(getApplication(), entrance, response.getQuestion(), answerId);
String uploadCount;
String content = Html.fromHtml(response.getContent()).toString();
if (content.length() > 30) {
uploadCount = content.substring(0, 30);
} else {
uploadCount = content;
}
DataUtils.onMtaEvent(getApplication(), "详情页面", "答案详情", uploadCount);
DataUtils.onMtaEvent(getApplication(), "详情页面", "答案详情", StringUtils.combineTwoString(content, answerId));
}
@Override

View File

@ -4,7 +4,7 @@ ext {
compileSdkVersion = 27
minSdkVersion = 14
// TODO fix permission/ target 23 will cause permission issues
targetSdkVersion = 22
targetSdkVersion = 27
// application info
versionCode = 26

Binary file not shown.

Binary file not shown.

Binary file not shown.