日夜间模式的切换(游戏单部分) https://git.shanqu.cc/halo/android/assistant-android/-/issues/65
This commit is contained in:
@ -24,6 +24,7 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.LayoutInflaterCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@ -321,15 +322,28 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
|
||||
if (NightModeUtils.INSTANCE.getSystemMode()) {
|
||||
NightModeUtils.INSTANCE.setNightMode(false);
|
||||
NightModeUtils.INSTANCE.setSystemMode(false);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
}
|
||||
} else {
|
||||
NightModeUtils.INSTANCE.setSystemMode(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||
}
|
||||
}
|
||||
NightModeUtils.INSTANCE.initNightMode();
|
||||
}, () -> {
|
||||
if (NightModeUtils.INSTANCE.getSystemMode()) {
|
||||
NightModeUtils.INSTANCE.setNightMode(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
}
|
||||
} else {
|
||||
boolean nightMode = NightModeUtils.INSTANCE.getNightMode();
|
||||
NightModeUtils.INSTANCE.setNightMode(!NightModeUtils.INSTANCE.getNightMode());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
getDelegate().setLocalNightMode(nightMode ? AppCompatDelegate.MODE_NIGHT_NO : AppCompatDelegate.MODE_NIGHT_YES);
|
||||
}
|
||||
}
|
||||
NightModeUtils.INSTANCE.setSystemMode(false);
|
||||
NightModeUtils.INSTANCE.initNightMode();
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.gh.base.fragment;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.gh.common.util.ClickUtils;
|
||||
import com.gh.common.util.NightModeUtils;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.lightgame.utils.RuntimeUtils;
|
||||
import com.lightgame.utils.Utils;
|
||||
@ -28,6 +30,14 @@ import androidx.lifecycle.Lifecycle;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment {
|
||||
|
||||
protected boolean mNightMode;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mNightMode = NightModeUtils.INSTANCE.isNightMode(requireContext());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
@ -95,6 +105,16 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
onNightModeChange();
|
||||
}
|
||||
|
||||
protected void onNightModeChange() {
|
||||
mNightMode = NightModeUtils.INSTANCE.isNightMode(requireContext());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -166,6 +166,7 @@ object DownloadItemUtils {
|
||||
hideDownloadBtnIfNoAvailableContent: Boolean = false,
|
||||
pluginLocation: PluginLocation? = PluginLocation.only_game
|
||||
) {
|
||||
downloadBtn.background = R.drawable.download_button_normal_style.toDrawable(context)
|
||||
// 控制是否显示下载按钮
|
||||
downloadBtn.goneIf(!Config.isShowDownload(gameEntity.id) || context.getString(R.string.app_name) == gameEntity.name)
|
||||
// 青少年模式显示查看
|
||||
|
||||
@ -6,6 +6,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
@ -295,6 +296,7 @@ public abstract class ListFragment<T, VM extends BaseListViewModel /* 该泛型
|
||||
@Override
|
||||
protected void onNightModeChange() {
|
||||
super.onNightModeChange();
|
||||
mCachedView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background));
|
||||
if (provideListAdapter() != null) {
|
||||
mListRv.getRecycledViewPool().clear();
|
||||
provideListAdapter().notifyItemRangeChanged(0, provideListAdapter().getItemCount());
|
||||
|
||||
@ -2,14 +2,27 @@ package com.gh.gamecenter.gamecollection.choose
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.gamecenter.NormalActivity
|
||||
import com.gh.gamecenter.R
|
||||
|
||||
class AddGamesActivity : NormalActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, AddGamesActivity::class.java, AddGamesFragment::class.java)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context): Intent {
|
||||
return getTargetIntent(context, AddGamesActivity::class.java, AddGamesFragment::class.java)
|
||||
|
||||
@ -40,8 +40,8 @@ class AddSearchAndPlayedGameAdapter(context: Context, val mChooseGamesViewModel:
|
||||
holder.bindGameItem(entity)
|
||||
holder.binding.downloadBtn.text = if (isSelected) "删除" else "添加"
|
||||
holder.binding.downloadBtn.background =
|
||||
if (isSelected) R.drawable.bg_shape_f5_radius_999.toDrawable() else R.drawable.download_button_normal_style.toDrawable()
|
||||
holder.binding.downloadBtn.setTextColor(if (isSelected) R.color.text_subtitleDesc.toColor() else R.color.white.toColor())
|
||||
if (isSelected) R.drawable.bg_shape_f5_radius_999.toDrawable(mContext) else R.drawable.download_button_normal_style.toDrawable(mContext)
|
||||
holder.binding.downloadBtn.setTextColor(if (isSelected) R.color.text_subtitleDesc.toColor(mContext) else R.color.white.toColor(mContext))
|
||||
|
||||
holder.binding.downloadBtn.setOnClickListener {
|
||||
val chooseGameList = mChooseGamesViewModel.chooseGamesLiveData.value ?: arrayListOf()
|
||||
|
||||
@ -5,8 +5,11 @@ import android.view.View
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.toDrawable
|
||||
import com.gh.common.util.viewModelProvider
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.SuggestionActivity
|
||||
import com.gh.gamecenter.databinding.FragmentSearchGameBinding
|
||||
import com.gh.gamecenter.entity.GameEntity
|
||||
@ -94,4 +97,21 @@ class AddSearchGameFragment : GameFragment() {
|
||||
override fun shouldLoadMore(): Boolean = true
|
||||
|
||||
override fun isAutoSearch(): Boolean = false
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.searchContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mBinding.listRv.setBackgroundColor(R.color.background.toColor(requireContext()))
|
||||
mBinding.divider.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
mBinding.promptTv.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mBinding.applyGameTv.background = R.drawable.game_detail_btn_receive.toDrawable(requireContext())
|
||||
mBinding.searchInput.background = R.drawable.community_editor_insert_search_background.toDrawable(requireContext())
|
||||
mBinding.searchInput.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
mBinding.searchButton.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
mBinding.promptTv.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
mBinding.reuseTvNoneData.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,9 +3,7 @@ package com.gh.gamecenter.gamecollection.choose
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.viewModelProvider
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.baselist.ListAdapter
|
||||
import com.gh.gamecenter.baselist.ListFragment
|
||||
@ -36,7 +34,7 @@ class AddUserPlayedGameFragment : ListFragment<GameEntity, PlayedGameViewModel>(
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
mCachedView.setBackgroundColor(R.color.white.toColor())
|
||||
mCachedView.setBackgroundColor(R.color.background_white.toColor())
|
||||
}
|
||||
|
||||
override fun provideListAdapter(): ListAdapter<GameEntity> {
|
||||
@ -55,4 +53,11 @@ class AddUserPlayedGameFragment : ListFragment<GameEntity, PlayedGameViewModel>(
|
||||
mViewModel = viewModelProvider(AddUserPlayedGameViewModel.Factory(userId, true))
|
||||
return mViewModel
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mCachedView?.setRootBackgroundColor(R.color.background_white)
|
||||
mCachedView?.findViewById<View>(R.id.divider)?.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
}
|
||||
}
|
||||
@ -3,18 +3,26 @@ package com.gh.gamecenter.gamecollection.choose
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.gamecenter.NormalActivity
|
||||
import com.gh.gamecenter.R
|
||||
|
||||
class ChooseGamesActivity : NormalActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setNavigationTitle("选择游戏")
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, ChooseGamesActivity::class.java, ChooseGamesFragment::class.java)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context): Intent {
|
||||
return getTargetIntent(context, ChooseGamesActivity::class.java, ChooseGamesFragment::class.java)
|
||||
|
||||
@ -7,10 +7,8 @@ import android.view.ViewGroup
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.BaseRecyclerViewHolder
|
||||
import com.gh.common.util.PatternUtils
|
||||
import com.gh.common.util.TextHelper
|
||||
import com.gh.common.util.consume
|
||||
import com.gh.common.util.toBinding
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.baselist.ListAdapter
|
||||
import com.gh.gamecenter.databinding.ItemChooseGamesBinding
|
||||
import com.gh.gamecenter.entity.GameEntity
|
||||
@ -39,6 +37,13 @@ class ChooseGamesAdapter(context: Context, val dragListener: ItemDragListener) :
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if (holder is ChooseGamesViewHolder) {
|
||||
holder.binding.root.setBackgroundColor(R.color.background_white.toColor(mContext))
|
||||
holder.binding.recommendContainer.background = R.drawable.bg_shape_f5_radius_6.toDrawable(mContext)
|
||||
holder.binding.gameNameTv.setTextColor(R.color.text_title.toColor(mContext))
|
||||
holder.binding.recommendReasonEt.setTextColor(R.color.text_title.toColor(mContext))
|
||||
holder.binding.ratingScoreTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
holder.binding.recommendReasonEt.setHintTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
|
||||
val gameEntity = mEntityList[position]
|
||||
holder.binding.root.tag = gameEntity.id
|
||||
holder.binding.gameNameTv.text = gameEntity.name
|
||||
|
||||
@ -8,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.DialogHelper
|
||||
import com.gh.common.util.goneIf
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.viewModelProvider
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.FragmentChooseGamesBinding
|
||||
@ -141,4 +142,16 @@ class ChooseGamesFragment : NormalFragment(), ChooseGamesAdapter.ItemDragListene
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.run {
|
||||
root.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
gameCountTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
addGamesButton.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
addGamesTv.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
gamesRv.adapter?.run { notifyItemRangeChanged(0, itemCount) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -25,6 +25,7 @@ import com.gh.common.view.GridSpacingItemColorDecoration
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.databinding.GameCollectionDetailNoneGameItemBinding
|
||||
import com.gh.gamecenter.databinding.GameCollectionGameItemBinding
|
||||
import com.gh.gamecenter.databinding.ItemArticleDetailCommentBinding
|
||||
import com.gh.gamecenter.databinding.LayoutGameCollectionAuthTagBinding
|
||||
@ -51,6 +52,7 @@ open class GameCollectionDetailAdapter(
|
||||
var recommendPrefBitmap: Bitmap? = null
|
||||
val positionAndPackageMap = HashMap<String, Int>()
|
||||
private var mExposureEventArray: SparseArray<ExposureEvent>? = null
|
||||
private var mItemDecoration: RecyclerView.ItemDecoration? = null
|
||||
|
||||
override fun setListData(updateData: MutableList<CommentItemData>?) {
|
||||
mExposureEventArray = SparseArray(updateData?.size ?: 0)
|
||||
@ -94,10 +96,12 @@ open class GameCollectionDetailAdapter(
|
||||
)
|
||||
|
||||
ITEM_GAME_EMPTY -> GameCollectionGameEmptyViewHolder(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.game_collection_detail_none_game_item,
|
||||
parent,
|
||||
false
|
||||
GameCollectionDetailNoneGameItemBinding.bind(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.game_collection_detail_none_game_item,
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@ -128,7 +132,11 @@ open class GameCollectionDetailAdapter(
|
||||
)
|
||||
}
|
||||
|
||||
is GameCollectionGameEmptyViewHolder -> mViewModel.postFirstItemInitOver()
|
||||
is GameCollectionGameEmptyViewHolder -> {
|
||||
mViewModel.postFirstItemInitOver()
|
||||
holder.binding.noneGameContainer.setBackgroundColor(R.color.background_white.toColor(mContext))
|
||||
holder.binding.noneGameTv.setTextColor(R.color.text_body.toColor(mContext))
|
||||
}
|
||||
|
||||
is CommentItemViewHolder -> {
|
||||
bindComment(holder.binding, mEntityList[position].commentNormal!!) { deleteCommentEntity ->
|
||||
@ -164,6 +172,10 @@ open class GameCollectionDetailAdapter(
|
||||
holder.bindView(mIsLoading, mIsNetworkError, mIsOver, R.string.game_collection_load_over_hint)
|
||||
}
|
||||
|
||||
is GameCollectionDividerViewHolder -> {
|
||||
holder.itemView.setBackgroundColor(R.color.background.toColor(mContext))
|
||||
}
|
||||
|
||||
else -> super.onBindViewHolder(holder, position)
|
||||
}
|
||||
}
|
||||
@ -180,7 +192,7 @@ open class GameCollectionDetailAdapter(
|
||||
updateSubComment(this, comment)
|
||||
|
||||
floorHintTv.visibility = View.INVISIBLE
|
||||
bottomDivider.visibility = View.VISIBLE
|
||||
bottomDivider.visibility = View.GONE
|
||||
|
||||
root.setOnClickListener {
|
||||
mContext.startActivity(
|
||||
@ -274,18 +286,36 @@ open class GameCollectionDetailAdapter(
|
||||
deleteCallBack: ((comment: CommentEntity) -> Unit)? = null
|
||||
) {
|
||||
binding.run {
|
||||
root.setBackgroundColor(R.color.background_white.toColor(mContext))
|
||||
subCommentContainer.setBackgroundColor(R.color.background.toColor(mContext))
|
||||
divider.setBackgroundColor(R.color.text_F8F8F8.toColor(mContext))
|
||||
bottomDivider.setBackgroundColor(R.color.divider.toColor(mContext))
|
||||
userNameTv.setTextColor(R.color.text_subtitle.toColor(mContext))
|
||||
badgeTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
floorHintTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
contentTv.setTextColor(R.color.text_444444.toColor(mContext))
|
||||
collapseTv.setTextColor(R.color.theme_font.toColor(mContext))
|
||||
firstSubCommentTv.setTextColor(R.color.text_subtitle.toColor(mContext))
|
||||
secondSubCommentTv.setTextColor(R.color.text_subtitle.toColor(mContext))
|
||||
moreSubCommentBtn.setTextColor(R.color.theme_font.toColor(mContext))
|
||||
timeTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
likeCountTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
commentCountTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
|
||||
if (!comment.images.isNullOrEmpty()) {
|
||||
if (commentPictureRv.adapter == null) {
|
||||
commentPictureRv.apply {
|
||||
layoutManager = GridLayoutManager(context, 3)
|
||||
adapter = CommentPictureAdapter(context, comment.images!!, "")
|
||||
if (itemDecorationCount == 0) {
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 2, R.color.white))
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 2, R.color.background_white).apply { mItemDecoration = this })
|
||||
}
|
||||
visibility = View.VISIBLE
|
||||
}
|
||||
} else {
|
||||
(commentPictureRv.adapter as CommentPictureAdapter).checkResetData(comment.images!!)
|
||||
mItemDecoration?.let { commentPictureRv.removeItemDecoration(it) }
|
||||
commentPictureRv.addItemDecoration(GridSpacingItemColorDecoration(commentPictureRv.context, 2, R.color.background_white).apply { mItemDecoration = this })
|
||||
}
|
||||
} else {
|
||||
binding.commentPictureRv.visibility = View.GONE
|
||||
@ -491,7 +521,7 @@ open class GameCollectionDetailAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
inner class GameCollectionGameEmptyViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||
inner class GameCollectionGameEmptyViewHolder(val binding: GameCollectionDetailNoneGameItemBinding) : RecyclerView.ViewHolder(binding.root)
|
||||
|
||||
inner class GameCollectionDividerViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||
|
||||
@ -499,17 +529,28 @@ open class GameCollectionDetailAdapter(
|
||||
|
||||
fun bindView(gameEntity: GameEntity, position: Int, isLast: Boolean) {
|
||||
binding.run {
|
||||
container.background = R.drawable.reuse_listview_item_style.toDrawable(mContext)
|
||||
gameCollectionRecommendTv.background = R.drawable.bg_shape_f8_radius_8.toDrawable(mContext)
|
||||
gameCollectionRecommendTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
gameItemIncluded.run {
|
||||
root.background = R.drawable.reuse_listview_item_style.toDrawable(mContext)
|
||||
gameKaifuType.setBackgroundColor(R.color.theme.toColor(mContext))
|
||||
gameName.setTextColor(R.color.text_title.toColor(mContext))
|
||||
gameDes.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
downloadSpeed.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
downloadPercentage.setTextColor(R.color.theme_font.toColor(mContext))
|
||||
recommendStarPref.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
|
||||
gameIconView.displayGameIcon(gameEntity)
|
||||
BindingAdapters.setGameName(gameName, gameEntity, false, null)
|
||||
BindingAdapters.setTextSize(gameRating, if (gameEntity.commentCount > 3) 12 else 10)
|
||||
BindingAdapters.setGameTags(labelList, gameEntity)
|
||||
gameRating.setCompoundDrawablesWithIntrinsicBounds(if (gameEntity.commentCount > 3) R.drawable.game_horizontal_rating.toDrawable() else null, null, null, null)
|
||||
gameRating.setCompoundDrawablesWithIntrinsicBounds(if (gameEntity.commentCount > 3) R.drawable.game_horizontal_rating.toDrawable(mContext) else null, null, null, null)
|
||||
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
|
||||
gameRating.text = if (gameEntity.commentCount > 3) {
|
||||
if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString()
|
||||
} else ""
|
||||
gameRating.setTextColor(if (gameEntity.commentCount > 3) R.color.theme_font.toColor() else R.color.theme.toColor())
|
||||
gameRating.setTextColor(if (gameEntity.commentCount > 3) R.color.theme_font.toColor(mContext) else R.color.theme.toColor(mContext))
|
||||
gameDes.text = gameEntity.decoratedDes
|
||||
recommendStar.rating = gameEntity.recommendStar.toFloat()
|
||||
}
|
||||
|
||||
@ -6,8 +6,10 @@ import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -130,7 +132,7 @@ class GameCollectionDetailFragment :
|
||||
insets.consumeSystemWindowInsets()
|
||||
}
|
||||
|
||||
root.setBackgroundColor(Color.WHITE)
|
||||
root.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mSkeletonScreen = Skeleton.bind(listSkeleton)
|
||||
.shimmer(true)
|
||||
.angle(Constants.SHIMMER_ANGLE)
|
||||
@ -243,12 +245,12 @@ class GameCollectionDetailFragment :
|
||||
mListViewModel.getGameCollectionDetail()
|
||||
mReuseNoConn?.visibility = View.GONE
|
||||
showSkeleton(true)
|
||||
mBinding?.root?.setBackgroundColor(Color.WHITE)
|
||||
mBinding?.root?.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
|
||||
DisplayUtils.setStatusBarColor(requireActivity(), R.color.white, true)
|
||||
mBinding?.toolbarContainer?.setBackgroundColor(Color.WHITE)
|
||||
DisplayUtils.setStatusBarColor(requireActivity(), R.color.background_white, !mNightMode)
|
||||
mBinding?.toolbarContainer?.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mBinding?.backIv?.setImageResource(R.drawable.ic_bar_back)
|
||||
|
||||
mListLoading?.visibility = View.GONE
|
||||
@ -328,10 +330,10 @@ class GameCollectionDetailFragment :
|
||||
squareIv.setImageResource(R.drawable.ic_game_collection_square_light)
|
||||
toolbarUserContainer.visibility = View.GONE
|
||||
} else {
|
||||
DisplayUtils.setStatusBarColor(requireActivity(), R.color.white, true)
|
||||
toolbarContainer.setBackgroundColor(Color.WHITE)
|
||||
DisplayUtils.setStatusBarColor(requireActivity(), R.color.background_white, !mNightMode)
|
||||
toolbarContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
backIv.setImageResource(R.drawable.ic_bar_back)
|
||||
squareIv.setImageResource(R.drawable.ic_game_collection_square)
|
||||
squareIv.setImageResource(if (mNightMode) R.drawable.ic_game_collection_square_light else R.drawable.ic_game_collection_square)
|
||||
toolbarUserContainer.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@ -486,9 +488,9 @@ class GameCollectionDetailFragment :
|
||||
): View {
|
||||
return LayoutGameCollectionTagBinding.inflate(layoutInflater).apply {
|
||||
divider.goneIf(isLast)
|
||||
divider.setBackgroundColor(R.color.theme_alpha_20.toColor())
|
||||
divider.setBackgroundColor(R.color.theme_alpha_20.toColor(requireContext()))
|
||||
contentTv.text = content
|
||||
contentTv.setTextColor(R.color.theme_font.toColor())
|
||||
contentTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
}.root
|
||||
}
|
||||
|
||||
@ -510,7 +512,7 @@ class GameCollectionDetailFragment :
|
||||
visibility = View.VISIBLE
|
||||
text = if (isFollow) "已关注" else "关注"
|
||||
setBackgroundResource(if (isFollow) R.drawable.button_round_f5f5f5 else R.drawable.button_round_2496ff_alpha_10)
|
||||
setTextColor(if (isFollow) R.color.text_subtitleDesc.toColor() else R.color.theme.toColor())
|
||||
setTextColor(if (isFollow) R.color.text_subtitleDesc.toColor(requireContext()) else R.color.theme.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -556,10 +558,10 @@ class GameCollectionDetailFragment :
|
||||
bottomStarTv.text = mListViewModel.getStarText()
|
||||
if (mEntity?.me?.isFavorite == true) {
|
||||
bottomStarIv.setImageResource(R.drawable.ic_article_detail_stared_bottom_bar)
|
||||
bottomStarTv.setTextColor(R.color.theme_font.toColor())
|
||||
bottomStarTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
} else {
|
||||
bottomStarIv.setImageResource(R.drawable.ic_article_detail_star_bottom_bar)
|
||||
bottomStarTv.setTextColor(R.color.text_subtitle.toColor())
|
||||
bottomStarTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -569,10 +571,10 @@ class GameCollectionDetailFragment :
|
||||
bottomLikeTv.text = mListViewModel.getLikeText()
|
||||
if (mEntity?.me?.isVoted == true) {
|
||||
bottomLikeIv.setImageResource(R.drawable.ic_article_detail_liked_bottom_bar)
|
||||
bottomLikeTv.setTextColor(R.color.theme_font.toColor())
|
||||
bottomLikeTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
} else {
|
||||
bottomLikeIv.setImageResource(R.drawable.ic_article_detail_like_bottom_bar)
|
||||
bottomLikeTv.setTextColor(R.color.text_subtitle.toColor())
|
||||
bottomLikeTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1021,4 +1023,52 @@ class GameCollectionDetailFragment :
|
||||
shareType
|
||||
)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
mBinding?.run {
|
||||
appbar.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mListRv.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
tagContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
playedContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
divider.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
toolbarUserName.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
playedTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
playedPro.progressDrawable = R.drawable.progressbar_played_game_blue_style.toDrawable(requireContext())
|
||||
updateFollowView()
|
||||
videoItem.run {
|
||||
container.background = R.drawable.bg_game_collection_video_item.toDrawable(requireContext())
|
||||
nameTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
videoItemDesTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
userNameTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
videoItemFollowTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
}
|
||||
inputContainer.run {
|
||||
bottomContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
replyTv.setBackgroundColor(R.color.background.toColor(requireContext()))
|
||||
replyTv.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
bottomShareTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomLikeTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomStarTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomCommentTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
}
|
||||
fixedTopFilterView.run {
|
||||
filterView.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
divider.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
commentHintTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
commentHintCountTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
orderSfv.run {
|
||||
setContainerBackground(R.drawable.button_round_f5f5f5.toDrawable(requireContext()))
|
||||
setIndicatorBackground(R.drawable.progressbar_game_collection_primary.toDrawable(requireContext()))
|
||||
setTextColor(ContextCompat.getColorStateList(requireContext(), R.color.game_collection_rg_button_selector))
|
||||
}
|
||||
}
|
||||
for (i in 0 until tagList.childCount) {
|
||||
val tagBinding = LayoutGameCollectionTagBinding.bind(tagList.getChildAt(i) as LinearLayout)
|
||||
tagBinding.divider.setBackgroundColor(R.color.theme_alpha_20.toColor(requireContext()))
|
||||
tagBinding.contentTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.gh.common.dialog.BaseDraggableDialogFragment
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.DialogGameCollectionShareBinding
|
||||
import com.gh.gamecenter.entity.NormalShareEntity
|
||||
import com.gh.gamecenter.eventbus.EBShare
|
||||
@ -108,6 +109,17 @@ class GameCollectionShareDialog : BaseDraggableDialogFragment() {
|
||||
override fun getRootView(): View = mBinding.root
|
||||
override fun getDragCloseView(): View = mBinding.dragClose
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mBinding.run {
|
||||
container.background = R.drawable.game_detail_more_dialog_background.toDrawable(requireContext())
|
||||
cancelTv.background = R.drawable.bg_shape_f5_radius_999.toDrawable(requireContext())
|
||||
dividerLine1.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
cancelTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
titleTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val KEY_SHARE = "share"
|
||||
const val REQUEST_CODE = 1105
|
||||
|
||||
@ -6,6 +6,7 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.ethanhua.skeleton.Skeleton
|
||||
import com.gh.common.AppExecutor
|
||||
import com.gh.common.syncpage.SyncDataEntity
|
||||
@ -168,4 +169,32 @@ class GameCollectionCommentConversationFragment : BaseCommentFragment<CommentIte
|
||||
comment)
|
||||
startActivityForResult(intent, CommentActivity.REQUEST_CODE)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.container.background = R.drawable.game_detail_more_dialog_background.toDrawable(requireContext())
|
||||
mBinding.toolbarContainer.commentDialogCountTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
mBinding.inputContainer.run {
|
||||
bottomContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
replyTv.setBackgroundColor(R.color.background.toColor(requireContext()))
|
||||
replyTv.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
bottomShareTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomLikeTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomStarTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
bottomCommentTv.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
}
|
||||
mBinding.fixedTopFilterView.run {
|
||||
filterView.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
divider.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
commentHintTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
commentHintCountTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
orderSfv.run {
|
||||
setContainerBackground(R.drawable.button_round_f5f5f5.toDrawable(requireContext()))
|
||||
setIndicatorBackground(R.drawable.progressbar_game_collection_primary.toDrawable(requireContext()))
|
||||
setTextColor(ContextCompat.getColorStateList(requireContext(), R.color.game_collection_rg_button_selector))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,14 +2,27 @@ package com.gh.gamecenter.gamecollection.mine
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.gamecenter.NormalActivity
|
||||
import com.gh.gamecenter.R
|
||||
|
||||
class MyGameCollectionActivity : NormalActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, MyGameCollectionActivity::class.java, MyGameCollectionFragment::class.java)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context): Intent {
|
||||
return getTargetIntent(context, MyGameCollectionActivity::class.java, MyGameCollectionFragment::class.java)
|
||||
|
||||
@ -4,10 +4,10 @@ import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.ToolBarActivity
|
||||
import com.gh.common.constant.Constants
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.common.util.showRegulationTestDialogIfNeeded
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.view.GridSpacingItemColorDecoration
|
||||
import com.gh.common.view.VerticalItemDecoration
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.WebActivity
|
||||
@ -26,6 +26,7 @@ class MyGameCollectionFragment : ListFragment<GamesCollectionEntity, MyGameColle
|
||||
|
||||
private var mAdapter: MyGameCollectionAdapter? = null
|
||||
private lateinit var mBinding: FragmentMyGameCollectionListBinding
|
||||
private var mItemDecoration: RecyclerView.ItemDecoration? = null
|
||||
|
||||
override fun getLayoutId(): Int = 0
|
||||
|
||||
@ -92,7 +93,7 @@ class MyGameCollectionFragment : ListFragment<GamesCollectionEntity, MyGameColle
|
||||
}
|
||||
|
||||
override fun getItemDecoration(): RecyclerView.ItemDecoration {
|
||||
return VerticalItemDecoration(requireContext(), 16F, true, R.color.white)
|
||||
return VerticalItemDecoration(requireContext(), 16F, true, R.color.background_white).apply { mItemDecoration = this }
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@ -102,4 +103,22 @@ class MyGameCollectionFragment : ListFragment<GamesCollectionEntity, MyGameColle
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
(requireActivity() as ToolBarActivity).getMenuItem(R.id.menu_game_collection_square).setIcon(R.drawable.ic_menu_game_collection_square)
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.run {
|
||||
root.setRootBackgroundColor(R.color.background)
|
||||
listContainer.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
createBtn.background = R.drawable.textview_concern_red_up_round.toDrawable(requireContext())
|
||||
specificationLinkTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
reuseTvNoneData.setTextColor(R.color.text_body.toColor(requireContext()))
|
||||
listRv.run {
|
||||
mItemDecoration?.let { removeItemDecoration(it) }
|
||||
addItemDecoration(itemDecoration)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,8 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import com.gh.base.fragment.BaseDialogFragment
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.toDrawable
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.DialogChooseActivityBinding
|
||||
import com.gh.gamecenter.entity.ActivityLabelEntity
|
||||
@ -83,6 +85,15 @@ class ChooseGameCollectionActivityDialog : BaseDialogFragment() {
|
||||
dialog?.window?.setLayout(width, height)
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.dialogContainer.background = R.drawable.game_detail_more_dialog_background.toDrawable(requireContext())
|
||||
mBinding.titleTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
mBinding.confirmTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG_ACTIVITY_ID = "tagActivityId"
|
||||
|
||||
|
||||
@ -12,10 +12,7 @@ import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import com.gh.base.fragment.BaseDialogFragment
|
||||
import com.gh.common.util.EmptyCallback
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.common.util.PermissionHelper
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.DialogChooseGameCollectionCoverTypeBinding
|
||||
import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity.Companion.REQUEST_CODE_IMAGE
|
||||
@ -90,6 +87,29 @@ class ChooseGameCollectionCoverTypeDialog : BaseDialogFragment() {
|
||||
NewLogUtils.logClickGameCollectionChooseCoverDialog("关闭弹窗")
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.run {
|
||||
root.setRootBackgroundDrawable(R.drawable.background_shape_white_radius_12_top_only)
|
||||
line1.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
line2.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
line3.setBackgroundColor(R.color.divider.toColor(requireContext()))
|
||||
localUploadContainer.background = R.drawable.choose_game_collection_cover_type_selector.toDrawable(requireContext())
|
||||
defaultUploadContainer.background = R.drawable.choose_game_collection_cover_type_selector.toDrawable(requireContext())
|
||||
cancelBtn.background = R.drawable.bg_shape_f5_radius_999.toDrawable(requireContext())
|
||||
recommentTv.background = R.drawable.bg_game_collection_cover_tag.toDrawable(requireContext())
|
||||
titleTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
localUploadTitleTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
localUploadDesTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
defaultUploadTitleTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
defaultUploadDesTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
|
||||
recommentTv.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
cancelBtn.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun show(activity: AppCompatActivity, parentTag: String) {
|
||||
ChooseGameCollectionCoverTypeDialog().apply {
|
||||
|
||||
@ -13,6 +13,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.fragment.BaseDialogFragment
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.view.GridSpacingItemColorDecoration
|
||||
@ -26,6 +27,7 @@ class ChooseGameCollectionDefaultCoverDialog : BaseDialogFragment() {
|
||||
private lateinit var mBinding: DialogChooseGameCollectionDefaultCoverBinding
|
||||
private var mViewModel: ChooseGameCollectionDefaultCoverViewModel? = null
|
||||
private var mAdapter: ChooseGameCollectionDefaultAdapter? = null
|
||||
private var mItemDecoration: RecyclerView.ItemDecoration? = null
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
return DialogChooseGameCollectionDefaultCoverBinding.inflate(layoutInflater, null, false).apply {
|
||||
@ -55,7 +57,7 @@ class ChooseGameCollectionDefaultCoverDialog : BaseDialogFragment() {
|
||||
}
|
||||
adapter = mAdapter
|
||||
layoutManager = GridLayoutManager(requireContext(), 2)
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 8, R.color.white))
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 8, R.color.background_white).apply { mItemDecoration = this })
|
||||
}
|
||||
|
||||
mViewModel = viewModelProvider()
|
||||
@ -96,6 +98,24 @@ class ChooseGameCollectionDefaultCoverDialog : BaseDialogFragment() {
|
||||
NewLogUtils.logClickGameCollectionDefaultCoverDialog("关闭弹窗")
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.run {
|
||||
root.setRootBackgroundDrawable(R.drawable.background_shape_white_radius_12_top_only)
|
||||
cancelBtn.background = R.drawable.bg_shape_f5_radius_999.toDrawable(requireContext())
|
||||
titleTv.setTextColor(R.color.text_title.toColor(requireContext()))
|
||||
changeBatchBtn.setTextColor(R.color.theme_font.toColor(requireContext()))
|
||||
cancelBtn.setTextColor(R.color.text_subtitle.toColor(requireContext()))
|
||||
coverRv.run {
|
||||
mItemDecoration?.let { removeItemDecoration(it) }
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 8, R.color.background_white).apply { mItemDecoration = this })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val REQUEST_CODE_DEFAULT_IMAGE = 104
|
||||
|
||||
|
||||
@ -65,4 +65,9 @@ class GameCollectionActivityLabelFragment : NormalFragment() {
|
||||
fun getSelectedActivity(): ActivityLabelEntity? {
|
||||
return mAdapter?.getSelectedActivity()
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) }
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import com.gh.base.ToolBarActivity
|
||||
import com.gh.base.fragment.WaitingDialogFragment
|
||||
@ -41,6 +42,7 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
mBinding = ActivityGameCollectionEditBinding.bind(mContentView)
|
||||
mViewModel = viewModelProvider()
|
||||
mChooseGamesViewModel = viewModelProvider(ChooseGamesViewModel.Factory())
|
||||
@ -308,7 +310,7 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
val tagBinding = ItemGameCollectionFlexTagBinding.inflate(LayoutInflater.from(this), null, false)
|
||||
tagBinding.tagNameTv.run {
|
||||
text = "选择标签"
|
||||
setTextColor(R.color.text_title.toColor())
|
||||
setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
textSize = 14f
|
||||
}
|
||||
tagBinding.divider.visibility = View.GONE
|
||||
@ -318,12 +320,12 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
val tagBinding = ItemGameCollectionFlexTagBinding.inflate(LayoutInflater.from(this), null, false)
|
||||
tagBinding.tagNameTv.run {
|
||||
text = tag.name
|
||||
setTextColor(R.color.text_title.toColor())
|
||||
setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
textSize = 14f
|
||||
}
|
||||
tagBinding.divider.run {
|
||||
alpha = 0.2f
|
||||
setBackgroundColor(R.color.text_title.toColor())
|
||||
setBackgroundColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
goneIf(index == tags.size - 1)
|
||||
setPadding(8f.dip2px(), 0, 8f.dip2px(), 0)
|
||||
}
|
||||
@ -447,6 +449,42 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
mChooseGamesViewModel.chooseGamesLiveData.postValue(arrayListOf())
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
mMenuPost.actionView.findViewById<TextView>(R.id.postTv)?.background = R.drawable.textview_concern_red_up_round.toDrawable(this)
|
||||
if (::mBinding.isInitialized) {
|
||||
mBinding.run {
|
||||
root.setBackgroundColor(R.color.background_white.toColor(this@GameCollectionEditActivity))
|
||||
labelDivider.setBackgroundColor(R.color.divider.toColor(this@GameCollectionEditActivity))
|
||||
gameDivider.setBackgroundColor(R.color.divider.toColor(this@GameCollectionEditActivity))
|
||||
activityDivider.setBackgroundColor(R.color.divider.toColor(this@GameCollectionEditActivity))
|
||||
titleDivider.setBackgroundColor(R.color.divider.toColor(this@GameCollectionEditActivity))
|
||||
introduceDivider.setBackgroundColor(R.color.divider.toColor(this@GameCollectionEditActivity))
|
||||
placeholderView.background = R.drawable.bg_shape_f5_radius_8.toDrawable(this@GameCollectionEditActivity)
|
||||
selfOnlyCb.background = R.drawable.border_round_stroke_0dot5_eee_999.toDrawable(this@GameCollectionEditActivity)
|
||||
uploadPictureTv.setTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
labelTipTv.setTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
gamesTv.setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
gamesTipTv.setTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
activityTv.setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
gameCollectionTitleEt.setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
gameCollectionIntroduceEt.setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
introduceSizeTv.setTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
normsLinkTv.setTextColor(R.color.theme_font.toColor(this@GameCollectionEditActivity))
|
||||
selfOnlyCb.setTextColor(R.color.text_subtitleDesc.toColor(this@GameCollectionEditActivity))
|
||||
labelTipTv.setHintTextColor(R.color.text_subtitleDesc.toColor(this@GameCollectionEditActivity))
|
||||
gamesTipTv.setHintTextColor(R.color.text_subtitleDesc.toColor(this@GameCollectionEditActivity))
|
||||
activityTipTv.setHintTextColor(R.color.text_subtitleDesc.toColor(this@GameCollectionEditActivity))
|
||||
gameCollectionTitleEt.setHintTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
gameCollectionIntroduceEt.setHintTextColor(R.color.text_body.toColor(this@GameCollectionEditActivity))
|
||||
for (i in 0 until mBinding.gameCollectionTagsContainer.childCount) {
|
||||
mBinding.gameCollectionTagsContainer.getChildAt(i)?.findViewById<TextView>(R.id.tagNameTv)?.setTextColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
mBinding.gameCollectionTagsContainer.getChildAt(i)?.findViewById<View>(R.id.divider)?.setBackgroundColor(R.color.text_title.toColor(this@GameCollectionEditActivity))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
|
||||
@ -486,6 +486,7 @@ class GameCollectionSquareFragment : LazyListFragment<GamesCollectionEntity, Gam
|
||||
mDefaultBinding.listRefresh.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mDefaultBinding.appbar.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mDefaultBinding.collapsingToolbar.setContentScrimColor(R.color.background_white.toColor(requireContext()))
|
||||
mDefaultBinding.bannerBackground.background = R.drawable.bg_game_collection_square_banner.toDrawable(requireContext())
|
||||
mDefaultBinding.orderSfv.run {
|
||||
setContainerBackground(R.drawable.button_round_f5f5f5.toDrawable(requireContext()))
|
||||
setIndicatorBackground(R.drawable.progressbar_game_collection_primary.toDrawable(requireContext()))
|
||||
|
||||
@ -4,10 +4,8 @@ import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.common.util.ToastUtils
|
||||
import com.gh.common.util.dip2px
|
||||
import com.gh.common.util.goneIf
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.*
|
||||
import com.gh.gamecenter.entity.GameCollectionTagEntity
|
||||
import com.gh.gamecenter.entity.TagInfoEntity
|
||||
@ -49,6 +47,7 @@ class GameCollectionTagAdapter(
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
when (holder) {
|
||||
is GameCollectionSelectedTagViewHolder -> {
|
||||
holder.binding.hintTv.setTextColor(R.color.text_body.toColor(holder.binding.root.context))
|
||||
holder.binding.selectedTagFlexbox.removeAllViews()
|
||||
holder.binding.hintTv.goneIf(selectedTagEntityList.size != 0)
|
||||
for (tag in selectedTagEntityList) {
|
||||
@ -69,6 +68,7 @@ class GameCollectionTagAdapter(
|
||||
val data = mTagList[if (singleChoice) position else position - 1]
|
||||
holder.binding.tagFlexbox.removeAllViews()
|
||||
holder.binding.titleTv.text = data.categoryName
|
||||
holder.binding.titleTv.setTextColor(R.color.text_title.toColor(holder.binding.root.context))
|
||||
holder.binding.titleTv.setPadding(
|
||||
16F.dip2px(),
|
||||
if (position == 0) 40F.dip2px() else 10F.dip2px(),
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gh.gamecenter.gamecollection.tag
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.gamecenter.NormalActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.entity.TagInfoEntity
|
||||
@ -11,6 +12,7 @@ class GameCollectionTagSelectActivity : NormalActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
setNavigationTitle("选择标签")
|
||||
if (intent.getBundleExtra(NORMAL_FRAGMENT_BUNDLE)?.getBoolean(KEY_IS_SINGLE_CHOICE) == false) {
|
||||
setToolbarMenu(R.menu.menu_save)
|
||||
@ -19,6 +21,11 @@ class GameCollectionTagSelectActivity : NormalActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val KEY_IS_SINGLE_CHOICE = "single_choice"
|
||||
const val KEY_SINGLE_SELECTED_TAG = "single_selected_tag"
|
||||
|
||||
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.viewModelProvider
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.FragmentGameCollectionTagSelectBinding
|
||||
@ -114,6 +115,15 @@ class GameCollectionTagSelectFragment : NormalFragment() {
|
||||
requireActivity().finish()
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
mBinding.root.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
mBinding.selectedTagScrollView.setBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
if (::mAdapter.isInitialized) {
|
||||
mAdapter.notifyItemRangeChanged(0, mAdapter.itemCount)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val SELECTED_TAG = "selected_tag"
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.constant.ItemViewType
|
||||
@ -22,6 +23,7 @@ import com.gh.gamecenter.baselist.ListAdapter
|
||||
import com.gh.gamecenter.baselist.LoadStatus
|
||||
import com.gh.gamecenter.baselist.LoadType
|
||||
import com.gh.gamecenter.databinding.ItemArticleDetailCommentBinding
|
||||
import com.gh.gamecenter.databinding.ItemArticleDetailCommentEmptyBinding
|
||||
import com.gh.gamecenter.databinding.ItemArticleDetailCommentFooterBinding
|
||||
import com.gh.gamecenter.databinding.PieceArticleDetailCommentFilterBinding
|
||||
import com.gh.gamecenter.entity.CommentEntity
|
||||
@ -103,20 +105,24 @@ abstract class BaseCommentAdapter(
|
||||
|
||||
ITEM_ERROR_EMPTY -> {
|
||||
CommentErrorViewHolder(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.item_article_detail_comment_empty,
|
||||
parent,
|
||||
false
|
||||
ItemArticleDetailCommentEmptyBinding.bind(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.item_article_detail_comment_empty,
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
ITEM_ERROR_CONNECTION -> {
|
||||
CommentErrorViewHolder(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.item_article_detail_comment_empty,
|
||||
parent,
|
||||
false
|
||||
ItemArticleDetailCommentEmptyBinding.bind(
|
||||
mLayoutInflater.inflate(
|
||||
R.layout.item_article_detail_comment_empty,
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -194,6 +200,11 @@ abstract class BaseCommentAdapter(
|
||||
is CommentFooterViewHolder -> {
|
||||
holder.bindView(mIsLoading, mIsNetworkError, mIsOver)
|
||||
}
|
||||
|
||||
is CommentErrorViewHolder -> {
|
||||
holder.binding.container.setBackgroundColor(R.color.background_white.toColor(mContext))
|
||||
holder.binding.hintTv.setTextColor(R.color.text_body.toColor(mContext))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,7 +239,7 @@ abstract class BaseCommentAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
inner class CommentErrorViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||
inner class CommentErrorViewHolder(val binding: ItemArticleDetailCommentEmptyBinding) : RecyclerView.ViewHolder(binding.root)
|
||||
inner class CommentFilterViewHolder(var binding: PieceArticleDetailCommentFilterBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
fun bindView(
|
||||
@ -238,6 +249,16 @@ abstract class BaseCommentAdapter(
|
||||
gameCollection: Boolean? = null
|
||||
) {
|
||||
binding.run {
|
||||
filterView.setBackgroundColor(R.color.background_white.toColor(mContext))
|
||||
divider.setBackgroundColor(R.color.divider.toColor(mContext))
|
||||
commentHintTv.setTextColor(R.color.text_title.toColor(mContext))
|
||||
commentHintCountTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
orderSfv.run {
|
||||
setContainerBackground(R.drawable.button_round_f5f5f5.toDrawable(mContext))
|
||||
setIndicatorBackground(R.drawable.progressbar_game_collection_primary.toDrawable(mContext))
|
||||
setTextColor(ContextCompat.getColorStateList(mContext, R.color.game_collection_rg_button_selector))
|
||||
}
|
||||
|
||||
val commentCount = mViewModel.commentCount
|
||||
commentHintTv.text = when {
|
||||
article != null -> {
|
||||
@ -576,7 +597,7 @@ abstract class BaseCommentAdapter(
|
||||
layoutManager = GridLayoutManager(context, 3)
|
||||
adapter = CommentPictureAdapter(context, comment.images!!, entrance)
|
||||
if (itemDecorationCount == 0) {
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 2, R.color.white))
|
||||
addItemDecoration(GridSpacingItemColorDecoration(context, 2, R.color.background_white))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package com.gh.gamecenter.qa.comment.base
|
||||
|
||||
import android.graphics.drawable.InsetDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.DisplayUtils
|
||||
import com.gh.common.util.toDrawable
|
||||
import com.gh.common.view.CustomDividerItemDecoration
|
||||
import com.gh.common.view.SegmentedFilterView
|
||||
import com.gh.common.view.vertical_recycler.SnappingLinearLayoutManager
|
||||
@ -15,7 +12,6 @@ import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.baselist.ListFragment
|
||||
import com.gh.gamecenter.gamecollection.detail.conversation.GameCollectionCommentConversationFragment
|
||||
import com.gh.gamecenter.qa.comment.conversation.CommentConversationFragment
|
||||
import com.zhihu.matisse.listener.OnCheckedListener
|
||||
|
||||
abstract class BaseCommentFragment<T, VM : BaseCommentViewModel> : ListFragment<T, VM>() {
|
||||
|
||||
@ -26,6 +22,8 @@ abstract class BaseCommentFragment<T, VM : BaseCommentViewModel> : ListFragment<
|
||||
protected lateinit var skeletonView: View
|
||||
protected lateinit var orderSfv: SegmentedFilterView
|
||||
|
||||
protected var mItemDecoration: RecyclerView.ItemDecoration? = null
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
findView()
|
||||
@ -107,6 +105,7 @@ abstract class BaseCommentFragment<T, VM : BaseCommentViewModel> : ListFragment<
|
||||
}
|
||||
|
||||
itemDecoration.setDrawable(drawable!!)
|
||||
mItemDecoration = itemDecoration
|
||||
return itemDecoration
|
||||
}
|
||||
|
||||
@ -123,4 +122,12 @@ abstract class BaseCommentFragment<T, VM : BaseCommentViewModel> : ListFragment<
|
||||
return (provideListAdapter() as BaseCommentAdapter).filterVH
|
||||
}
|
||||
|
||||
override fun onNightModeChange() {
|
||||
super.onNightModeChange()
|
||||
if (mListRv != null) {
|
||||
mListRv.removeItemDecoration(mItemDecoration)
|
||||
mListRv.addItemDecoration(itemDecoration)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,8 +4,11 @@ import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.BaseRecyclerViewHolder
|
||||
import com.gh.common.util.setRootBackgroundColor
|
||||
import com.gh.common.util.toBinding
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.util.visibleIf
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.VideoLabelItemBinding
|
||||
import com.gh.gamecenter.entity.ActivityLabelEntity
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
@ -33,6 +36,12 @@ class VideoLabelAdapter(
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if (holder is VideoLabelViewHolder) {
|
||||
holder.binding.run {
|
||||
root.setRootBackgroundColor(R.color.background_white)
|
||||
titleTv.setTextColor(R.color.text_title.toColor(mContext))
|
||||
contentTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext))
|
||||
}
|
||||
|
||||
val activityLabelEntity = entityList[position]
|
||||
holder.binding.titleTv.text = activityLabelEntity.name
|
||||
holder.binding.contentTv.text = activityLabelEntity.desc.ifEmpty { activityLabelEntity.remark }
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@ -2,8 +2,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<gradient
|
||||
android:startColor="#00F5F5F5"
|
||||
android:endColor="#FFF5F5F5"
|
||||
android:startColor="@color/background_alpha_0"
|
||||
android:endColor="@color/background"
|
||||
android:angle="270"/>
|
||||
|
||||
</shape>
|
||||
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white" />
|
||||
<solid android:color="@color/background_white" />
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="@color/divider"/>
|
||||
|
||||
@ -3,5 +3,5 @@
|
||||
|
||||
<item android:drawable = "@color/black_alpha_3" android:state_pressed = "true" />
|
||||
<item android:drawable = "@color/black_alpha_3" android:state_focused = "true" />
|
||||
<item android:drawable = "@color/white" android:state_focused = "false" />
|
||||
<item android:drawable = "@color/background_white" android:state_focused = "false" />
|
||||
</selector>
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<solid android:color="@color/background_white" />
|
||||
<size android:height="0.5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/reuse_toolbar" />
|
||||
@ -134,6 +134,7 @@
|
||||
android:hint="请至少添加一个标签"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/text_body"
|
||||
android:textColorHint="@color/text_subtitleDesc"
|
||||
android:textSize="@dimen/secondary_size" />
|
||||
|
||||
<ImageView
|
||||
@ -144,6 +145,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/labelDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
@ -183,6 +185,7 @@
|
||||
android:hint="8款 以上可发布"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/text_body"
|
||||
android:textColorHint="@color/text_subtitleDesc"
|
||||
android:textSize="@dimen/secondary_size" />
|
||||
|
||||
<ImageView
|
||||
@ -193,6 +196,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/gameDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
@ -234,6 +238,7 @@
|
||||
android:lines="1"
|
||||
android:maxWidth="200dp"
|
||||
android:textColor="@color/game_collection_activity"
|
||||
android:textColorHint="@color/text_subtitleDesc"
|
||||
android:textSize="@dimen/secondary_size" />
|
||||
|
||||
<ImageView
|
||||
@ -266,6 +271,7 @@
|
||||
android:textSize="@dimen/secondary_title_text_size" />
|
||||
|
||||
<View
|
||||
android:id="@+id/titleDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
@ -302,6 +308,7 @@
|
||||
android:textSize="@dimen/secondary_size" />
|
||||
|
||||
<View
|
||||
android:id="@+id/introduceDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/dialogContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="488dp"
|
||||
android:layout_gravity="bottom"
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recommentTv"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
@ -64,6 +65,7 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/localUploadTitleTv" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/localUploadDesTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
@ -110,6 +112,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/defaultUploadDesTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="488dp"
|
||||
android:layout_gravity="bottom"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:gravity="center"
|
||||
app:elevation="0dp"
|
||||
app:layout_behavior="com.gh.common.view.FixAppBarLayoutBehavior">
|
||||
@ -51,7 +51,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:scrollbars="none"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:nestedScrollingEnabled="false">
|
||||
|
||||
<LinearLayout
|
||||
@ -72,7 +72,7 @@
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_white">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/playedPro"
|
||||
@ -196,7 +196,7 @@
|
||||
android:id="@+id/list_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
android:layout_height="66dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/bannerBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/bg_game_collection_square_banner"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_white">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/tagRv"
|
||||
@ -18,7 +18,7 @@
|
||||
android:id="@+id/selectedTagScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@ -5,10 +5,11 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/listContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_white">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/list_refresh"
|
||||
|
||||
@ -13,14 +13,16 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/searchContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:descendantFocusability="beforeDescendants"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical"
|
||||
@ -102,7 +104,7 @@
|
||||
android:id="@+id/promptTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="204dp"
|
||||
android:text="搜索好玩的游戏,加入我的游戏单"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
android:layout_height="374dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_white">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/noneGameIv"
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/theme">
|
||||
android:background="#2496FF">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_white">
|
||||
|
||||
<com.gh.common.view.AvatarBorderView
|
||||
android:id="@+id/userIconIv"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="288dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
tools:text="御龙正版授权" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ratingScoreTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
@ -89,6 +90,7 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/gameNameTv" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/recommendContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/menu_game_collection_post"
|
||||
android:id="@+id/postTv"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
android:id="@+id/filterView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:clickable="false"
|
||||
tools:showIn="@layout/fragment_article_detail">
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
tools:showIn="@layout/fragment_article_detail">
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_white"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingRight="16dp"
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
<!-- 通用背景 -->
|
||||
<color name="background">#121212</color>
|
||||
<color name="background_white">#000000</color>
|
||||
<color name="background_alpha_0">#00121212</color>
|
||||
<!-- 分隔线 -->
|
||||
<color name="divider">#333333</color>
|
||||
<!-- 资源边框 -->
|
||||
@ -164,7 +165,7 @@
|
||||
<color name="dcdcdc">@color/background</color>
|
||||
<color name="c7c7c7">#c7c7c7</color>
|
||||
<color name="d6d5ff">#d6d5ff</color>
|
||||
<color name="f8f8f8">#f8f8f8</color>
|
||||
<color name="f8f8f8">@color/background</color>
|
||||
<color name="e5e5e5">#e5e5e5</color>
|
||||
<color name="e6e6e6">#e6e6e6</color>
|
||||
<color name="ECF6FF">#ECF6FF</color>
|
||||
@ -217,9 +218,9 @@
|
||||
<color name="text_FA8500">#FA8500</color>
|
||||
<color name="text_f67722">#f67722</color>
|
||||
<color name="text_989898">#989898</color>
|
||||
<color name="text_444444">#444444</color>
|
||||
<color name="text_444444">@color/text_title</color>
|
||||
<color name="text_777777">#777777</color>
|
||||
<color name="text_f2f2f2">#f2f2f2</color>
|
||||
<color name="text_f2f2f2">@color/background</color>
|
||||
<color name="text_292929">#292929</color>
|
||||
<color name="text_00DD08">#00DD08</color>
|
||||
<color name="text_E0FFF9">#E0FFF9</color>
|
||||
@ -249,8 +250,8 @@
|
||||
<color name="text_242529">#242529</color>
|
||||
<color name="text_ebebeb">#ebebeb</color>
|
||||
<color name="text_4BC7FF">#4BC7FF</color>
|
||||
<color name="text_F8F8F8">#F8F8F8</color>
|
||||
<color name="text_F0F0F0">#F0F0F0</color>
|
||||
<color name="text_F8F8F8">@color/background</color>
|
||||
<color name="text_F0F0F0">@color/background</color>
|
||||
<color name="text_00DBB0">#00DBB0</color>
|
||||
<color name="text_00B8B8">#00B8B8</color>
|
||||
<color name="text_00D7B0">#00D7B0</color>
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
<!-- 通用背景 -->
|
||||
<color name="background">#F5F5F5</color>
|
||||
<color name="background_white">#FFFFFF</color>
|
||||
<color name="background_alpha_0">#00F5F5F5</color>
|
||||
<!-- 分隔线 -->
|
||||
<color name="divider">#EEEEEE</color>
|
||||
<!-- 资源边框 -->
|
||||
|
||||
Reference in New Issue
Block a user