Commit 25920727 by 范玉宾

code review fix

parent 31075c3f
...@@ -296,11 +296,7 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -296,11 +296,7 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override @Override
public void shareAction(H5JsBean.H5JsCmd.Params params) { public void shareAction(H5JsBean.H5JsCmd.Params params) {
if (mContext != null) {
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).showShareMenu(params);
}
}
} }
@Override @Override
......
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="29dp" android:width="29dp"
android:height="29dp" android:height="29dp"
......
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="7dp" android:width="7dp"
android:height="8dp" android:height="8dp"
......
...@@ -16,13 +16,13 @@ internal class AppLocalImpl private constructor(): AppLocal { ...@@ -16,13 +16,13 @@ internal class AppLocalImpl private constructor(): AppLocal {
return Holder.INSTANCE return Holder.INSTANCE
} }
private val APP = "app" private const val APP = "app"
private val RED_POCKET_TIME = "red_pocket_time" private const val RED_POCKET_TIME = "red_pocket_time"
private val UPDATE = "update" private const val UPDATE = "update"
private val CONFIDE = "confide" private const val CONFIDE = "confide"
private val CONSULT = "consult" private const val CONSULT = "consult"
private val COUPON = "coupon" private const val COUPON = "coupon"
} }
......
...@@ -14,11 +14,12 @@ class ShareData : Serializable { ...@@ -14,11 +14,12 @@ class ShareData : Serializable {
var cover: String? = null var cover: String? = null
var desc: String? = null var desc: String? = null
// just for Meditation // just for Meditation
var type:String? = null var type: String? = null
var isDarkMode = false var isDarkMode = false
// 兼容评价列表分享H5传参数据结构
var imageBase64:String?=null // 兼容评价列表分享H5传参数据结构
var imageBase64: String? = null
//分享到动态url //分享到动态url
var url: String? = null var url: String? = null
......
...@@ -198,15 +198,17 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -198,15 +198,17 @@ class ShareMeditationDialog : DialogFragment() {
private const val KEY_SHARE_MINI_ID = "key_share_mini_id" private const val KEY_SHARE_MINI_ID = "key_share_mini_id"
private const val KEY_SHARE_MINI_PATH = "key_share_mini_path" private const val KEY_SHARE_MINI_PATH = "key_share_mini_path"
fun newInstance(isDarkMode: Boolean,shareUrl:String,shareTitle:String, fun newInstance(
shareContent:String,shareCover:String,miniId:String,miniPath:String): ShareMeditationDialog { isDarkMode: Boolean, shareUrl: String, shareTitle: String,
shareContent: String, shareCover: String, miniId: String, miniPath: String
): ShareMeditationDialog {
val args = Bundle() val args = Bundle()
args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode) args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode)
args.putString(KEY_SHARE_URL, shareUrl) args.putString(KEY_SHARE_URL, shareUrl)
args.putString(KEY_SHARE_TITLE, shareTitle) args.putString(KEY_SHARE_TITLE, shareTitle)
args.putString(KEY_SHARE_CONTENT, shareContent) args.putString(KEY_SHARE_CONTENT, shareContent)
args.putString(KEY_SHARE_COVER, shareCover) args.putString(KEY_SHARE_COVER, shareCover)
args.putString(KEY_SHARE_MINI_ID,miniId ) args.putString(KEY_SHARE_MINI_ID, miniId)
args.putString(KEY_SHARE_MINI_PATH, miniPath) args.putString(KEY_SHARE_MINI_PATH, miniPath)
val fragment = ShareMeditationDialog() val fragment = ShareMeditationDialog()
......
...@@ -548,12 +548,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -548,12 +548,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
miniId = params.getShare().getMinProgramId(); miniId = params.getShare().getMinProgramId();
miniPath = params.getShare().getMinProgramPath(); miniPath = params.getShare().getMinProgramPath();
isDarkMode = params.getShare().isDarkMode(); isDarkMode = params.getShare().isDarkMode();
if(shareMeditationDialog == null){ if (shareMeditationDialog == null) {
shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode, shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode,
shareUrl,shareTitle,shareDesc,cover,miniId,miniPath); shareUrl, shareTitle, shareDesc, cover, miniId, miniPath);
} }
if (shareMeditationDialog!=null && !shareMeditationDialog.isAdded()){ if (shareMeditationDialog != null && !shareMeditationDialog.isAdded()) {
shareMeditationDialog.show(getSupportFragmentManager(),"share_meditation"); shareMeditationDialog.show(getSupportFragmentManager(), "share_meditation");
} }
}else { }else {
purl = params.getShare().getUrl(); purl = params.getShare().getUrl();
...@@ -1058,11 +1058,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1058,11 +1058,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share)); tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share));
tb_title.setOnRightTextClick((view, isActive) -> { tb_title.setOnRightTextClick((view, isActive) -> {
ShareData shareData = paramsForCommentList.getShare(); ShareData shareData = paramsForCommentList.getShare();
if (shareData!=null && "commentList".equals(shareData.getType())){ if (shareData != null && "commentList".equals(shareData.getType())) {
isShareCommentList = true; isShareCommentList = true;
ActionCountUtils.Companion.baiDuCountSign3("experts_comment_list_page", "comment_share_click", "", "", ""); ActionCountUtils.Companion.record("experts_comment_list_page", "comment_share_click");
share(shareData.getImageBase64(),paramsForCommentList); share(shareData.getImageBase64(), paramsForCommentList);
}else { } else {
share(null, null); share(null, null);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment