fix: 吧页面取色错误时闪退
This commit is contained in:
parent
dc48b977e1
commit
27c0d4e78f
|
|
@ -401,10 +401,14 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
|
|||
private fun refreshHeaderView() {
|
||||
if (mDataBean != null && mDataBean!!.forum != null) {
|
||||
headerView.visibility = View.VISIBLE
|
||||
val color = getDarkerColor(greifyColor(Color.parseColor("#${mDataBean?.forum?.themeColor?.day?.commonColor ?: ThemeUtils.getColorById(this, R.color.default_color_primary)}"), 0.15f), 0.1f)
|
||||
toolbarColor = color
|
||||
appbar.backgroundTintList = ColorStateList.valueOf(color)
|
||||
setCustomStatusColor(color)
|
||||
try {
|
||||
val color = getDarkerColor(greifyColor(Color.parseColor("#${mDataBean?.forum?.themeColor?.day?.commonColor ?: ThemeUtils.getColorById(this, R.color.default_color_primary)}"), 0.15f), 0.1f)
|
||||
toolbarColor = color
|
||||
appbar.backgroundTintList = ColorStateList.valueOf(color)
|
||||
setCustomStatusColor(color)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
if (avatarView.tag == null) {
|
||||
ImageUtil.load(avatarView, ImageUtil.LOAD_TYPE_AVATAR, mDataBean!!.forum!!.avatar)
|
||||
ImageUtil.initImageView(avatarView, PhotoViewBean(mDataBean!!.forum!!.avatar, false))
|
||||
|
|
|
|||
|
|
@ -75,13 +75,17 @@ public abstract class BaseBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
return statusBarHeight;
|
||||
}
|
||||
|
||||
protected boolean isFullScreen() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
Dialog dialog = getDialog();
|
||||
if (dialog != null) {
|
||||
View bottomSheet = dialog.findViewById(R.id.design_bottom_sheet);
|
||||
bottomSheet.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
bottomSheet.getLayoutParams().height = isFullScreen() ? ViewGroup.LayoutParams.MATCH_PARENT : ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
}
|
||||
final View view = getView();
|
||||
if (view != null) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ class FloorFragment : BaseBottomSheetDialogFragment() {
|
|||
AccountUtil.getLoginInfo(attachContext)!!.nameShow).setPn(pn.toString()).toString()))
|
||||
}
|
||||
|
||||
override fun isFullScreen(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
val filter = IntentFilter()
|
||||
|
|
|
|||
Loading…
Reference in New Issue