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