Merge branch 'dev' of git.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -734,7 +734,9 @@ public class BindingAdapters {
|
||||
try {
|
||||
ArrayList<TagStyleEntity> tagStyle = new ArrayList<>();
|
||||
TestEntity test = gameEntity.getTest();
|
||||
if (test != null) {
|
||||
if (test != null
|
||||
// 这个判断用于开测表列表
|
||||
&& !"type_tag".equals(test.getGameTag())) {
|
||||
TagStyleEntity typeTag = new TagStyleEntity();
|
||||
typeTag.setName(test.getType() != null ? test.getType() : "");
|
||||
typeTag.setBackground("FFF3E0");
|
||||
|
||||
@ -37,6 +37,7 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
|
||||
}
|
||||
|
||||
fun setupFilter(mainFilterList: ArrayList<String>,
|
||||
defaultSelectedMainFilter: String? = null,
|
||||
subFilterList: ArrayList<String>,
|
||||
subFilterText: String,
|
||||
mainFilterSelectedCallback: ((String) -> Unit),
|
||||
@ -46,13 +47,16 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
|
||||
|
||||
mBinding?.subFilterTv?.text = subFilterText
|
||||
mBinding?.subFilterTv?.setOnClickListener {
|
||||
showSelectionPopupWindow(this, it as TextView, mSelectedSubFilter) {
|
||||
subFilterSelectedCallback.invoke(it)
|
||||
showSelectionPopupWindow(this, it as TextView, mSelectedSubFilter) { selectedText ->
|
||||
subFilterSelectedCallback.invoke(selectedText)
|
||||
}
|
||||
}
|
||||
|
||||
mBinding?.filterRecyclerView?.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
|
||||
mBinding?.filterRecyclerView?.adapter = FilterAdapter(context, mMainFilterList) {
|
||||
mBinding?.filterRecyclerView?.adapter = FilterAdapter(
|
||||
context,
|
||||
mMainFilterList,
|
||||
defaultSelectedMainFilter ?: mainFilterList.first()) {
|
||||
mainFilterSelectedCallback.invoke(it)
|
||||
}
|
||||
}
|
||||
@ -143,13 +147,17 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
|
||||
popupWindow.isTouchable = true
|
||||
popupWindow.isFocusable = true
|
||||
popupWindow.animationStyle = 0
|
||||
popupWindow.showAsDropDown(containerView, 0, 0)
|
||||
// 在模拟器上会有 1dp 的位移
|
||||
popupWindow.showAsDropDown(containerView, 0, -3)
|
||||
}
|
||||
|
||||
class FilterAdapter(val context: Context, private val mFilterList: ArrayList<String>, private val mClickCallback: (String) -> Unit)
|
||||
class FilterAdapter(val context: Context,
|
||||
private val mFilterList: ArrayList<String>,
|
||||
private val mDefaultSelectedFilter: String,
|
||||
private val mClickCallback: (String) -> Unit)
|
||||
: RecyclerView.Adapter<FilterAdapter.FilterViewHolder>() {
|
||||
|
||||
private var mSelectedFilter = ""
|
||||
private var mSelectedFilter = mDefaultSelectedFilter
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FilterViewHolder {
|
||||
return FilterViewHolder(ItemFilterBinding.inflate(LayoutInflater.from(context)))
|
||||
|
||||
@ -262,6 +262,9 @@ data class GameEntity(
|
||||
@IgnoredOnParcel
|
||||
var testTime: String? = "" // 开测时间
|
||||
|
||||
@IgnoredOnParcel
|
||||
var briefStyle: String? = "" // 本地处理得到的简介显示配置
|
||||
|
||||
@IgnoredOnParcel
|
||||
var shouldShowNameSuffix = true // 专题级开关,只要这个开关为 false,实体有 suffix 也不显示
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ class GameServersTestAdapter(context: Context,
|
||||
StringUtils.buildString(mEntrance, "+(开服表[", viewHolder.adapterPosition.toString(), "])"),
|
||||
StringUtils.buildString("开服表:", gameEntity.name),
|
||||
mExposureEventArray[viewHolder.adapterPosition])
|
||||
DownloadItemUtils.updateItem(mContext, gameEntity, GameViewHolder(viewHolder.binding), true)
|
||||
DownloadItemUtils.updateItem(mContext, gameEntity, GameViewHolder(viewHolder.binding), true, gameEntity.briefStyle)
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
GameDetailActivity.startGameDetailActivity(mContext, gameEntity,
|
||||
StringUtils.buildString(mEntrance, "+(开服表[", viewHolder.adapterPosition.toString(), "])"),
|
||||
|
||||
@ -105,9 +105,10 @@ class GameServersTestFragment : NormalFragment() {
|
||||
mShouldScrollToToday = false
|
||||
scrollToDay("今天")
|
||||
}
|
||||
mSubBinding?.recyclerView?.visibility = View.VISIBLE
|
||||
|
||||
hideError()
|
||||
mSubBinding?.root?.post {
|
||||
mSubBinding?.recyclerView?.visibility = View.VISIBLE
|
||||
hideError()
|
||||
}
|
||||
}
|
||||
})
|
||||
mViewModel?.loadStatusLiveData?.observe(this, Observer { isSuccess ->
|
||||
@ -186,6 +187,7 @@ class GameServersTestFragment : NormalFragment() {
|
||||
mBinding?.filterView?.visibility = View.VISIBLE
|
||||
mBinding?.filterView?.setupFilter(
|
||||
mViewModel!!.dayList,
|
||||
mViewModel!!.dayList[2],
|
||||
mViewModel!!.typeList,
|
||||
"测试状态",
|
||||
{ day ->
|
||||
|
||||
@ -177,9 +177,7 @@ class GameServersTestViewModel(application: Application, private val mColumnId:
|
||||
if (filter == ALL || game.serverType == filter) {
|
||||
ApkActiveUtils.filterHideApk(game) // 过滤隐藏apk
|
||||
|
||||
if (game.test?.gameTag == "type_tag") {
|
||||
game.test = null
|
||||
}
|
||||
game.briefStyle = game.test?.gameInfo
|
||||
|
||||
game.sequence = index
|
||||
game.testTime = testTimeInHumanReadableFormat
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
android:id="@+id/flexbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/all_white"
|
||||
android:background="@color/white"
|
||||
android:paddingBottom="8dp"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap" />
|
||||
|
||||
Reference in New Issue
Block a user