光环助手V4.0-测试问题汇总(20200304-1900)5,11 https://gitlab.ghzs.com/pm/halo-app-issues/issues/796
This commit is contained in:
@ -14,6 +14,7 @@ import com.gh.common.constant.Constants
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.db.GameTrendsDao
|
||||
import com.gh.gamecenter.entity.FunctionalGroupEntity
|
||||
import com.gh.gamecenter.entity.FunctionalLinkEntity
|
||||
import com.gh.gamecenter.entity.FunctionalMessageType
|
||||
import com.gh.gamecenter.gamedetail.myrating.MyRatingActivity
|
||||
@ -27,11 +28,12 @@ import com.gh.gamecenter.video.videomanager.VideoManagerActivity
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
|
||||
class PersonalFunctionAdapter(val context: Context, val groupName: String, val mEntityList: ArrayList<FunctionalLinkEntity>)
|
||||
class PersonalFunctionAdapter(val context: Context, val groupName: String, var mEntityList: ArrayList<FunctionalLinkEntity>)
|
||||
: BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
|
||||
|
||||
private var mDisplayUpdateHint = false
|
||||
private val gameTrendsDao = GameTrendsDao(HaloApp.getInstance().application)
|
||||
private var countAndKey: Pair<Int, String>? = null
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
return object : RecyclerView.ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_personal_func, parent, false)) {}
|
||||
@ -89,8 +91,10 @@ class PersonalFunctionAdapter(val context: Context, val groupName: String, val m
|
||||
private fun directPage(linkEntity: FunctionalLinkEntity) {
|
||||
if (linkEntity.remind) {
|
||||
val haveReadRecord: HashSet<String> = SPUtils.getStringSet(Constants.SP_ADDONS_FUNCS_HAVE_READ) as HashSet<String>
|
||||
haveReadRecord.add(linkEntity.id)
|
||||
SPUtils.setStringSet(Constants.SP_ADDONS_FUNCS_HAVE_READ, haveReadRecord)
|
||||
val newReadRecord = hashSetOf<String>()//这里必须重新创建HashSet对象,否则重启app数据不能保存
|
||||
newReadRecord.addAll(haveReadRecord)
|
||||
newReadRecord.add(linkEntity.id)
|
||||
SPUtils.setStringSet(Constants.SP_ADDONS_FUNCS_HAVE_READ, newReadRecord)
|
||||
MessageUnreadRepository.loadMessageUnreadTotal()
|
||||
linkEntity.remind = false
|
||||
notifyDataSetChanged()
|
||||
@ -231,4 +235,21 @@ class PersonalFunctionAdapter(val context: Context, val groupName: String, val m
|
||||
|
||||
}
|
||||
|
||||
fun checkResetData(entity: FunctionalGroupEntity) {
|
||||
var dataIds = ""
|
||||
entity.addons.forEach {
|
||||
dataIds += it.id
|
||||
}
|
||||
|
||||
mEntityList = entity.addons
|
||||
if (countAndKey?.first == entity.addons.size && countAndKey?.second != dataIds) {
|
||||
notifyItemRangeChanged(0, itemCount)
|
||||
} else {
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
// 重新刷新数据标识
|
||||
countAndKey = Pair(entity.addons.size, dataIds)
|
||||
}
|
||||
|
||||
}
|
||||
@ -43,8 +43,12 @@ class PersonalFunctionGroupAdapter(val context: Context) : BaseRecyclerAdapter<R
|
||||
groupNameTv.text = groupEntity.name
|
||||
val mPersonalFunctionAdapter: PersonalFunctionAdapter
|
||||
funcRv.apply {
|
||||
mPersonalFunctionAdapter = PersonalFunctionAdapter(context, groupEntity.name, groupEntity.addons)
|
||||
adapter = mPersonalFunctionAdapter
|
||||
if (adapter == null) {
|
||||
mPersonalFunctionAdapter = PersonalFunctionAdapter(context, groupEntity.name, groupEntity.addons)
|
||||
adapter = mPersonalFunctionAdapter
|
||||
} else {
|
||||
(adapter as PersonalFunctionAdapter).checkResetData(groupEntity)
|
||||
}
|
||||
layoutManager = GridLayoutManager(context, 4)
|
||||
isNestedScrollingEnabled = false
|
||||
if (itemDecorationCount == 0) {
|
||||
|
||||
@ -51,9 +51,9 @@ class PersonalViewModel(application: Application) : AndroidViewModel(application
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : BiResponse<ArrayList<FunctionalGroupEntity>>() {
|
||||
override fun onSuccess(data: ArrayList<FunctionalGroupEntity>) {
|
||||
//if (!BuildConfig.DEBUG) {
|
||||
if (!BuildConfig.DEBUG) {
|
||||
haloAddData.postValue(data)
|
||||
//}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.halo.assistant.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -45,8 +46,10 @@ import com.lightgame.utils.Utils;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
@ -97,6 +100,7 @@ public class WebFragment extends NormalFragment {
|
||||
private boolean mIsBackpressRequireConfirmation;
|
||||
private String mBackConfirmationContent;
|
||||
private String mGameName;
|
||||
private List<String> titles = new ArrayList<>();
|
||||
|
||||
private TimeElapsedHelper mTimeElapsedHelper;
|
||||
|
||||
@ -309,6 +313,7 @@ public class WebFragment extends NormalFragment {
|
||||
mNavigationTitle = title;
|
||||
setNavigationTitle(mNavigationTitle);
|
||||
}
|
||||
titles.add(title);
|
||||
}
|
||||
});
|
||||
boolean isSecurityCertification = args.getBoolean(KEY_IS_SECURITY_CERTIFICATION, false);
|
||||
@ -387,6 +392,9 @@ public class WebFragment extends NormalFragment {
|
||||
} else if (mWebView.canGoBack()) {
|
||||
mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
mWebView.goBack();
|
||||
titles.remove(titles.size() - 1);
|
||||
String title = titles.remove(titles.size() - 1);
|
||||
setNavigationTitle(title);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user