diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index aa66c34ba..98de19317 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -1,5 +1,9 @@ package com.yunbao.live.activity; +import static com.yunbao.common.CommonAppContext.logger; +import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -36,6 +40,8 @@ import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.L; import com.yunbao.common.utils.SVGAViewUtils; @@ -46,10 +52,6 @@ import com.yunbao.live.R; import java.net.MalformedURLException; import java.net.URL; -import static com.yunbao.common.CommonAppContext.logger; -import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; -import static com.yunbao.common.utils.RouteUtil.PATH_COIN; - public class ZhuangBanActivity extends AbsActivity { private ProgressBar mProgressBar; @@ -82,9 +84,9 @@ public class ZhuangBanActivity extends AbsActivity { title.setVisibility(View.GONE); } if (getIntent().hasExtra("title")) { - if (TextUtils.isEmpty(titleString)){ + if (TextUtils.isEmpty(titleString)) { title.setVisibility(View.GONE); - }else { + } else { if (TextUtils.equals(titleString, "blank")) { title.setVisibility(View.GONE); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) rootView.getLayoutParams(); @@ -114,7 +116,13 @@ public class ZhuangBanActivity extends AbsActivity { copy(content); } } else { - view.loadUrl(url); + mWebView.post(new Runnable() { + @Override + public void run() { + view.loadUrl(url); + } + }); + } return true; } @@ -273,6 +281,23 @@ public class ZhuangBanActivity extends AbsActivity { mContext.startActivity(intent); } + + /** + * 设置超皇字体颜色 + * + * @param startColor 渐变色 + * @param endColor 渐变色 + * @param contentColor 内容颜色 + */ + @JavascriptInterface + public void androidSetColor(String startColor, String endColor, String contentColor) { + IMLoginModel model = IMLoginManager.get(mContext).getUserInfo(); + model.setStartColor("#"+startColor) + .setEndColor("#"+endColor) + .setContentColor("#"+contentColor); + IMLoginManager.get(mContext).upDataUserInfo(model); + } + } // //js调用原生 diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index fe0365787..9150749eb 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -33,7 +33,9 @@ import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GifCacheUtil; import com.yunbao.common.utils.L; @@ -301,6 +303,21 @@ public class ZhuangBanActivity extends AbsActivity { mContext.startActivity(intent); } + /** + * 设置超皇字体颜色 + * + * @param startColor 渐变色 + * @param endColor 渐变色 + * @param contentColor 内容颜色 + */ + @JavascriptInterface + public void androidSetColor(String startColor, String endColor, String contentColor) { + IMLoginModel model = IMLoginManager.get(mContext).getUserInfo(); + model.setStartColor("#"+startColor) + .setEndColor("#"+endColor) + .setContentColor("#"+contentColor); + IMLoginManager.get(mContext).upDataUserInfo(model); + } } private void openImageChooserActivity(ValueCallback valueCallback) {