fix: 【光环助手】部分页面文字显示颜色没有适配深色模式 https://jira.shanqu.cc/browse/GHZS-4982
This commit is contained in:
@ -7,6 +7,7 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -213,6 +214,10 @@ public class CleanApkAdapter extends BaseRecyclerAdapter<KcSelectGameViewHolder>
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String sizeName = df.format(size) + "MB";
|
||||
|
||||
View itemView = holder.itemView;
|
||||
Drawable background = ContextCompat.getDrawable(itemView.getContext(), R.drawable.reuse_listview_item_style);
|
||||
itemView.setBackground(background);
|
||||
|
||||
holder.binding.selectGameCbRl.setVisibility(View.VISIBLE);
|
||||
holder.binding.selectGameBtn.setVisibility(View.VISIBLE);
|
||||
if (mSelectPosition.get(position)) {
|
||||
|
||||
@ -725,39 +725,12 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
|
||||
private fun showMorePopup() {
|
||||
if (!::mPopupWindow.isInitialized) {
|
||||
val contentView = View.inflate(activity, R.layout.popup_user_home_more, null)
|
||||
mPopupWindow = PopupWindow(
|
||||
contentView,
|
||||
inflateMorePopupView(),
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
|
||||
contentView.run {
|
||||
findViewById<TextView>(R.id.shareBtn)
|
||||
.setOnClickListener {
|
||||
IntegralLogHelper.log("click_share", "更多面板")
|
||||
mPopupWindow.dismiss()
|
||||
shareUserHome()
|
||||
}
|
||||
|
||||
findViewById<TextView>(R.id.reportBtn).setOnClickListener {
|
||||
IntegralLogHelper.log("click_report", "更多面板")
|
||||
mPopupWindow.dismiss()
|
||||
val items = arrayListOf(
|
||||
context.getString(R.string.report_reason_one),
|
||||
context.getString(R.string.report_reason_two),
|
||||
context.getString(R.string.report_reason_three),
|
||||
context.getString(R.string.report_reason_four),
|
||||
context.getString(R.string.report_reason_other)
|
||||
)
|
||||
DialogUtils.showReportReasonDialog(requireContext(), items) { reason, desc ->
|
||||
ifLogin("个人主页-举报") {
|
||||
mUserHomeViewModel.postReport(reason, desc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mPopupWindow.run {
|
||||
isTouchable = true
|
||||
isFocusable = true
|
||||
@ -768,6 +741,36 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
mPopupWindow.showAsDropDown(mHomeBinding?.ivMore, (-49F).dip2px(), 0)
|
||||
}
|
||||
|
||||
private fun inflateMorePopupView(): View {
|
||||
val contentView = View.inflate(activity, R.layout.popup_user_home_more, null)
|
||||
contentView.run {
|
||||
findViewById<TextView>(R.id.shareBtn)
|
||||
.setOnClickListener {
|
||||
IntegralLogHelper.log("click_share", "更多面板")
|
||||
mPopupWindow.dismiss()
|
||||
shareUserHome()
|
||||
}
|
||||
|
||||
findViewById<TextView>(R.id.reportBtn).setOnClickListener {
|
||||
IntegralLogHelper.log("click_report", "更多面板")
|
||||
mPopupWindow.dismiss()
|
||||
val items = arrayListOf(
|
||||
context.getString(R.string.report_reason_one),
|
||||
context.getString(R.string.report_reason_two),
|
||||
context.getString(R.string.report_reason_three),
|
||||
context.getString(R.string.report_reason_four),
|
||||
context.getString(R.string.report_reason_other)
|
||||
)
|
||||
DialogUtils.showReportReasonDialog(requireContext(), items) { reason, desc ->
|
||||
ifLogin("个人主页-举报") {
|
||||
mUserHomeViewModel.postReport(reason, desc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return contentView
|
||||
}
|
||||
|
||||
private fun shareUserHome() {
|
||||
val content = (if (mPlayGameCount == 0) "" else "好燃~ 玩过 $mPlayGameCount 款游戏\n") +
|
||||
(if (mBadgeCount == 0) "" else "给力~ 已领取 $mBadgeCount 枚徽章\n") +
|
||||
@ -828,6 +831,10 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (::mPopupWindow.isInitialized) {
|
||||
mPopupWindow.contentView = inflateMorePopupView()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@ -56,6 +56,10 @@ public class ApkCleanerFragment extends ToolbarFragment implements CleanApkAdapt
|
||||
private boolean isChooseApk = false;
|
||||
private String platformRequestsId;
|
||||
|
||||
private RecyclerView mRv;
|
||||
|
||||
private VerticalItemDecoration mItemDecoration;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_apk_cleaner;
|
||||
@ -65,7 +69,7 @@ public class ApkCleanerFragment extends ToolbarFragment implements CleanApkAdapt
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.apk_rv);
|
||||
mRv = view.findViewById(R.id.apk_rv);
|
||||
mApkCount = view.findViewById(R.id.apk_count);
|
||||
mApkDeleteBtn = view.findViewById(R.id.delete_btn);
|
||||
mApkSelectAll = view.findViewById(R.id.select_game_all);
|
||||
@ -86,9 +90,10 @@ public class ApkCleanerFragment extends ToolbarFragment implements CleanApkAdapt
|
||||
mNodataSkipLl.setVisibility(View.GONE);
|
||||
|
||||
mAdapter = new CleanApkAdapter(getContext(), this, mApkDeleteBtn, mApkSelectAll, isChooseApk);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
recyclerView.addItemDecoration(new VerticalItemDecoration(getContext(), 8, true));
|
||||
recyclerView.setAdapter(mAdapter);
|
||||
mItemDecoration = new VerticalItemDecoration(getContext(), 8, true);
|
||||
mRv.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
mRv.addItemDecoration(mItemDecoration);
|
||||
mRv.setAdapter(mAdapter);
|
||||
|
||||
mApkSelectAll.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
ArrayMap<Integer, Boolean> selectPosition = new ArrayMap<>();
|
||||
@ -269,4 +274,13 @@ public class ApkCleanerFragment extends ToolbarFragment implements CleanApkAdapt
|
||||
mInstallAllData.setVisibility(View.GONE);
|
||||
mDeleteBottom.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDarkModeChanged() {
|
||||
if (mItemDecoration != null) {
|
||||
mRv.removeItemDecoration(mItemDecoration);
|
||||
mItemDecoration = new VerticalItemDecoration(getContext(), 8, true);
|
||||
mRv.addItemDecoration(mItemDecoration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user