Showing
36 changed files
with
3230 additions
and
445 deletions
Too many changes to show.
To preserve performance only 36 of 36+ files are displayed.
| @@ -9,7 +9,7 @@ android { | @@ -9,7 +9,7 @@ android { | ||
| 9 | buildToolsVersion var.buildToolsVersion | 9 | buildToolsVersion var.buildToolsVersion |
| 10 | 10 | ||
| 11 | defaultConfig { | 11 | defaultConfig { |
| 12 | - applicationId "com.example.myapplication" | 12 | + applicationId "com.wondertek.easycode" |
| 13 | minSdkVersion var.minSdkVersion | 13 | minSdkVersion var.minSdkVersion |
| 14 | targetSdkVersion var.targetSdkVersion | 14 | targetSdkVersion var.targetSdkVersion |
| 15 | versionCode var.versionCode | 15 | versionCode var.versionCode |
| @@ -11,9 +11,9 @@ | @@ -11,9 +11,9 @@ | ||
| 11 | android:name=".MyApplication" | 11 | android:name=".MyApplication" |
| 12 | android:allowBackup="true" | 12 | android:allowBackup="true" |
| 13 | android:fullBackupContent="@xml/backup_rules" | 13 | android:fullBackupContent="@xml/backup_rules" |
| 14 | - android:icon="@mipmap/ic_launcher" | 14 | + android:icon="@mipmap/ic_fastcode" |
| 15 | android:label="@string/app_name" | 15 | android:label="@string/app_name" |
| 16 | - android:roundIcon="@mipmap/ic_launcher_round" | 16 | + android:roundIcon="@mipmap/ic_fastcode" |
| 17 | android:supportsRtl="true" | 17 | android:supportsRtl="true" |
| 18 | android:theme="@style/Theme.MyApplication" | 18 | android:theme="@style/Theme.MyApplication" |
| 19 | tools:targetApi="31"> | 19 | tools:targetApi="31"> |
5.63 KB
| 1 | +/* | ||
| 2 | + * Copyright (c) Wondertek Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.common.dialog; | ||
| 6 | + | ||
| 7 | +import android.app.Dialog; | ||
| 8 | +import android.content.Context; | ||
| 9 | +import android.graphics.Typeface; | ||
| 10 | +import android.text.TextUtils; | ||
| 11 | +import android.view.Display; | ||
| 12 | +import android.view.LayoutInflater; | ||
| 13 | +import android.view.MotionEvent; | ||
| 14 | +import android.view.View; | ||
| 15 | +import android.view.View.OnClickListener; | ||
| 16 | +import android.view.WindowManager; | ||
| 17 | +import android.widget.FrameLayout; | ||
| 18 | +import android.widget.ImageView; | ||
| 19 | +import android.widget.LinearLayout; | ||
| 20 | +import android.widget.LinearLayout.LayoutParams; | ||
| 21 | +import android.widget.TextView; | ||
| 22 | + | ||
| 23 | +import androidx.core.content.ContextCompat; | ||
| 24 | + | ||
| 25 | +import com.wd.fastcoding.base.R; | ||
| 26 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * @author yangchenggong | ||
| 31 | + * @date 2022/6/28 15:29 | ||
| 32 | + */ | ||
| 33 | +public class AlertDialog { | ||
| 34 | + private Context context; | ||
| 35 | + | ||
| 36 | + private Dialog dialog; | ||
| 37 | + | ||
| 38 | + private LinearLayout lLayout_bg; | ||
| 39 | + | ||
| 40 | + private TextView txt_title; | ||
| 41 | + | ||
| 42 | + private TextView txt_msg; | ||
| 43 | + | ||
| 44 | + private TextView btn_neg; | ||
| 45 | + | ||
| 46 | + private TextView btn_pos; | ||
| 47 | + | ||
| 48 | + private ImageView img_line; | ||
| 49 | + | ||
| 50 | + private ImageView horizontal_line; | ||
| 51 | + | ||
| 52 | + private Display display; | ||
| 53 | + | ||
| 54 | + private boolean showTitle = false; | ||
| 55 | + | ||
| 56 | + private boolean showMsg = false; | ||
| 57 | + | ||
| 58 | + private boolean showPosBtn = false; | ||
| 59 | + | ||
| 60 | + private boolean showNegBtn = false; | ||
| 61 | + | ||
| 62 | + public AlertDialog(Context context) { | ||
| 63 | + this.context = context; | ||
| 64 | + WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); | ||
| 65 | + display = windowManager.getDefaultDisplay(); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public AlertDialog builder() { | ||
| 69 | + // 获取Dialog布局 | ||
| 70 | + View view = LayoutInflater.from(context).inflate(R.layout.dialog_layout, null); | ||
| 71 | + | ||
| 72 | + // 获取自定义Dialog布局中的控件 | ||
| 73 | + lLayout_bg = (LinearLayout) view.findViewById(R.id.lLayout_bg); | ||
| 74 | + txt_title = (TextView) view.findViewById(R.id.txt_title); | ||
| 75 | + txt_title.setVisibility(View.GONE); | ||
| 76 | + txt_msg = (TextView) view.findViewById(R.id.txt_msg); | ||
| 77 | + txt_msg.setVisibility(View.GONE); | ||
| 78 | + btn_neg = view.findViewById(R.id.btn_neg); | ||
| 79 | + btn_neg.setVisibility(View.GONE); | ||
| 80 | + btn_pos = view.findViewById(R.id.btn_pos); | ||
| 81 | + btn_pos.setVisibility(View.GONE); | ||
| 82 | + horizontal_line = view.findViewById(R.id.horizontal_line); | ||
| 83 | + img_line = (ImageView) view.findViewById(R.id.img_line); | ||
| 84 | + img_line.setVisibility(View.GONE); | ||
| 85 | + | ||
| 86 | + // 定义Dialog布局和参数 | ||
| 87 | + dialog = new Dialog(context, R.style.AlertDialogStyle); | ||
| 88 | + dialog.setContentView(view); | ||
| 89 | + | ||
| 90 | + WindowManager.LayoutParams lp = dialog.getWindow().getAttributes(); | ||
| 91 | + lp.dimAmount = 0.3f; | ||
| 92 | + // lp.y = 250; | ||
| 93 | + dialog.getWindow().setAttributes(lp); | ||
| 94 | + dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); | ||
| 95 | + | ||
| 96 | + // 调整dialog背景大小 | ||
| 97 | + lLayout_bg.setLayoutParams( | ||
| 98 | + new FrameLayout.LayoutParams((int) (display.getWidth() * 0.75), LayoutParams.WRAP_CONTENT)); | ||
| 99 | + //设置按压效果 | ||
| 100 | + setButtonSelect(); | ||
| 101 | + return this; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public AlertDialog setNightKeep() { | ||
| 105 | + if(lLayout_bg != null){ | ||
| 106 | + lLayout_bg.setBackground(ContextCompat.getDrawable(context,R.drawable.alert_bg_keep)); | ||
| 107 | + txt_title.setTextColor(ContextCompat.getColor(context,R.color.res_color_general_333333_keep)); | ||
| 108 | + txt_msg.setTextColor(ContextCompat.getColor(context,R.color.res_color_common_C3_keep)); | ||
| 109 | + horizontal_line.setBackground(ContextCompat.getDrawable(context,R.color.res_color_common_C7_keep)); | ||
| 110 | + img_line.setBackground(ContextCompat.getDrawable(context,R.color.res_color_common_C7_keep)); | ||
| 111 | + btn_pos.setTextColor(ContextCompat.getColor(context,R.color.res_color_general_333333_keep)); | ||
| 112 | + } | ||
| 113 | + return this; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + public AlertDialog setTitle(String title) { | ||
| 117 | + showTitle = true; | ||
| 118 | + txt_title.setText(TextUtils.isEmpty(title)?"Title":title); | ||
| 119 | + return this; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public AlertDialog setMsg(String msg) { | ||
| 123 | + showMsg = true; | ||
| 124 | + txt_msg.setText(TextUtils.isEmpty(msg)?"Msg":msg); | ||
| 125 | + return this; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public AlertDialog setCancelable(boolean cancel) { | ||
| 129 | + dialog.setCancelable(cancel); | ||
| 130 | + return this; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public AlertDialog setPositiveButton(String text, final OnClickListener listener) { | ||
| 134 | + showPosBtn = true; | ||
| 135 | + btn_pos.setText(TextUtils.isEmpty(text)? ResUtils.getString(R.string.yes_btn) :text); | ||
| 136 | + btn_pos.setOnClickListener(new OnClickListener() { | ||
| 137 | + @Override | ||
| 138 | + public void onClick(View v) { | ||
| 139 | + dialog.dismiss(); | ||
| 140 | + if(listener != null){ | ||
| 141 | + listener.onClick(v); | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + }); | ||
| 145 | + return this; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + public AlertDialog setNegativeButton(String text, final OnClickListener listener) { | ||
| 149 | + showNegBtn = true; | ||
| 150 | + btn_neg.setText(TextUtils.isEmpty(text)?ResUtils.getString(R.string.res_cancel) :text); | ||
| 151 | + btn_neg.setOnClickListener(new OnClickListener() { | ||
| 152 | + @Override | ||
| 153 | + public void onClick(View v) { | ||
| 154 | + if(listener != null){ | ||
| 155 | + listener.onClick(v); | ||
| 156 | + } | ||
| 157 | + dialog.dismiss(); | ||
| 158 | + } | ||
| 159 | + }); | ||
| 160 | + return this; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + private void setLayout() { | ||
| 164 | + if (!showTitle && !showMsg) { | ||
| 165 | + txt_title.setText(ResUtils.getString(R.string.tips)); | ||
| 166 | + txt_title.setVisibility(View.VISIBLE); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + if (showTitle) { | ||
| 170 | + txt_title.setVisibility(View.VISIBLE); | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + if (showMsg) { | ||
| 174 | + txt_msg.setVisibility(View.VISIBLE); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + if (!showPosBtn && !showNegBtn) { | ||
| 178 | + btn_pos.setText(ResUtils.getString(R.string.yes_btn)); | ||
| 179 | + btn_pos.setVisibility(View.VISIBLE); | ||
| 180 | + btn_pos.setOnClickListener(new OnClickListener() { | ||
| 181 | + @Override | ||
| 182 | + public void onClick(View v) { | ||
| 183 | + dialog.dismiss(); | ||
| 184 | + } | ||
| 185 | + }); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + if (showPosBtn && showNegBtn) { | ||
| 189 | + btn_pos.setVisibility(View.VISIBLE); | ||
| 190 | + btn_neg.setVisibility(View.VISIBLE); | ||
| 191 | + img_line.setVisibility(View.VISIBLE); | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + if (showPosBtn && !showNegBtn) { | ||
| 195 | + btn_pos.setVisibility(View.VISIBLE); | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + if (!showPosBtn && showNegBtn) { | ||
| 199 | + btn_neg.setVisibility(View.VISIBLE); | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + public void show() { | ||
| 204 | + if (dialog != null && !dialog.isShowing()) { | ||
| 205 | + setLayout(); | ||
| 206 | + dialog.show(); | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + /** | ||
| 211 | + * 设置变粗 | ||
| 212 | + */ | ||
| 213 | + private void setButtonSelect(){ | ||
| 214 | + btn_pos.setOnTouchListener(new View.OnTouchListener() { | ||
| 215 | + @Override | ||
| 216 | + public boolean onTouch(View v, MotionEvent event) { | ||
| 217 | + | ||
| 218 | + switch (event.getAction()) { | ||
| 219 | + // When the user clicks the Button | ||
| 220 | + case MotionEvent.ACTION_DOWN: | ||
| 221 | + btn_pos.setTypeface(Typeface.DEFAULT_BOLD); | ||
| 222 | + break; | ||
| 223 | + | ||
| 224 | + // When the user releases the Button | ||
| 225 | + case MotionEvent.ACTION_UP: | ||
| 226 | + btn_pos.setTypeface(Typeface.DEFAULT); | ||
| 227 | + break; | ||
| 228 | + default: | ||
| 229 | + break; | ||
| 230 | + } | ||
| 231 | + return false; | ||
| 232 | + } | ||
| 233 | + }); | ||
| 234 | + | ||
| 235 | + btn_neg.setOnTouchListener(new View.OnTouchListener() { | ||
| 236 | + @Override | ||
| 237 | + public boolean onTouch(View v, MotionEvent event) { | ||
| 238 | + | ||
| 239 | + switch (event.getAction()) { | ||
| 240 | + // When the user clicks the Button | ||
| 241 | + case MotionEvent.ACTION_DOWN: | ||
| 242 | + btn_neg.setTypeface(Typeface.DEFAULT_BOLD); | ||
| 243 | + break; | ||
| 244 | + | ||
| 245 | + // When the user releases the Button | ||
| 246 | + case MotionEvent.ACTION_UP: | ||
| 247 | + btn_neg.setTypeface(Typeface.DEFAULT); | ||
| 248 | + break; | ||
| 249 | + default: | ||
| 250 | + break; | ||
| 251 | + } | ||
| 252 | + return false; | ||
| 253 | + } | ||
| 254 | + }); | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + /** | ||
| 258 | + * 是否在展示 | ||
| 259 | + * @return | ||
| 260 | + */ | ||
| 261 | + public boolean isShow(){ | ||
| 262 | + if(dialog != null){ | ||
| 263 | + return dialog.isShowing(); | ||
| 264 | + } | ||
| 265 | + return false; | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + /** | ||
| 269 | + * 隐藏弹框 | ||
| 270 | + */ | ||
| 271 | + public void dismissDialog(){ | ||
| 272 | + if(dialog != null && dialog.isShowing()){ | ||
| 273 | + dialog.dismiss(); | ||
| 274 | + } | ||
| 275 | + } | ||
| 276 | +} |
| 1 | +package com.wd.common.dialog; | ||
| 2 | + | ||
| 3 | +import android.app.Activity; | ||
| 4 | +import android.app.Dialog; | ||
| 5 | +import android.content.Context; | ||
| 6 | +import android.view.Window; | ||
| 7 | +import android.view.WindowManager; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Time:2022/10/10 | ||
| 11 | + * Author:ypf | ||
| 12 | + * Description:进度条 | ||
| 13 | + */ | ||
| 14 | +public class AliPayAuthLoadingDialog { | ||
| 15 | + | ||
| 16 | + private static AliPayAuthLoadingDialog instance = null; | ||
| 17 | + | ||
| 18 | + private Dialog mLoadingDialog; | ||
| 19 | + | ||
| 20 | + private AliPayAuthLoadingDialog() { | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public static AliPayAuthLoadingDialog getInstance() { | ||
| 24 | + if (instance == null) { | ||
| 25 | + instance = new AliPayAuthLoadingDialog(); | ||
| 26 | + } | ||
| 27 | + return instance; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 创建dialog 对象 | ||
| 32 | + */ | ||
| 33 | + private void createLoadingDialog(Context context, boolean allowCancel) { | ||
| 34 | + mLoadingDialog = DialogUtils.createRequestDialog(context, allowCancel); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public void startLoading(Activity activity, boolean allowCancel) { | ||
| 38 | + runOnUiThreadStartLoading(activity, allowCancel); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 设置对话框透明度 | ||
| 43 | + */ | ||
| 44 | + public void setAlpha(float alpha){ | ||
| 45 | + | ||
| 46 | + if (mLoadingDialog != null) { | ||
| 47 | + Window window = mLoadingDialog.getWindow(); | ||
| 48 | + if (window != null) { | ||
| 49 | + WindowManager.LayoutParams attributes = window.getAttributes(); | ||
| 50 | + if (attributes != null) { | ||
| 51 | + attributes.alpha = alpha; | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public void stopLoading() { | ||
| 58 | + //异常处理,not attached to window manager | ||
| 59 | + try { | ||
| 60 | + if (mLoadingDialog != null && mLoadingDialog.isShowing()) { | ||
| 61 | + mLoadingDialog.dismiss(); | ||
| 62 | + } | ||
| 63 | + } catch (Exception e) { | ||
| 64 | + e.printStackTrace(); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + private void runOnUiThreadStartLoading(Activity activity, boolean allowCancel) { | ||
| 69 | + | ||
| 70 | + activity.runOnUiThread(new Runnable() { | ||
| 71 | + @Override | ||
| 72 | + public void run() { | ||
| 73 | + startLoadingDialog(activity, allowCancel); | ||
| 74 | + } | ||
| 75 | + }); | ||
| 76 | + | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + private void startLoadingDialog(Activity activity, boolean allowCancel) { | ||
| 80 | + if (activity == null || activity.isDestroyed()) { | ||
| 81 | + return; | ||
| 82 | + } | ||
| 83 | + createLoadingDialog(activity, allowCancel); | ||
| 84 | + if (mLoadingDialog != null && !mLoadingDialog.isShowing()) { | ||
| 85 | + mLoadingDialog.show(); | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public void cancelDialog() { | ||
| 90 | + if (mLoadingDialog != null) { | ||
| 91 | + mLoadingDialog.cancel(); | ||
| 92 | + mLoadingDialog = null; | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | +} |
| @@ -11,8 +11,9 @@ import android.os.Bundle; | @@ -11,8 +11,9 @@ import android.os.Bundle; | ||
| 11 | import android.os.SystemClock; | 11 | import android.os.SystemClock; |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -//import com.wd.common.manager.MyActivityManager; | 14 | +//import com.wd.foundation.wdkit.utils.MyActivityManager; |
| 15 | import com.wd.base.log.Logger; | 15 | import com.wd.base.log.Logger; |
| 16 | +import com.wd.foundation.wdkit.utils.MyActivityManager; | ||
| 16 | import com.wd.foundation.wdkit.constant.Constants; | 17 | import com.wd.foundation.wdkit.constant.Constants; |
| 17 | import com.wd.capability.network.constant.EventConstants; | 18 | import com.wd.capability.network.constant.EventConstants; |
| 18 | import com.wd.foundation.wdkit.interfaces.ActivityState; | 19 | import com.wd.foundation.wdkit.interfaces.ActivityState; |
| @@ -64,7 +65,7 @@ public class UserActivityLifecycleCallbacks implements Application.ActivityLifec | @@ -64,7 +65,7 @@ public class UserActivityLifecycleCallbacks implements Application.ActivityLifec | ||
| 64 | } | 65 | } |
| 65 | // restartSingleInstanceActivity(activity); | 66 | // restartSingleInstanceActivity(activity); |
| 66 | } | 67 | } |
| 67 | -// MyActivityManager.INSTANCE.setCurrentActivity(activity); | 68 | + MyActivityManager.INSTANCE.setCurrentActivity(activity); |
| 68 | //拦截小窗 | 69 | //拦截小窗 |
| 69 | // ProcessUtils.interceptorPictureInPicture(); | 70 | // ProcessUtils.interceptorPictureInPicture(); |
| 70 | 71 |
lib_base/src/main/res/drawable/alert_bg.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:id="@+id/lLayout_bg" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="wrap_content" | ||
| 6 | + android:background="@drawable/alert_bg" | ||
| 7 | + android:orientation="vertical"> | ||
| 8 | + | ||
| 9 | + <TextView | ||
| 10 | + android:id="@+id/txt_title" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="wrap_content" | ||
| 13 | + android:layout_marginTop="@dimen/rmrb_dp25" | ||
| 14 | + android:layout_marginHorizontal="@dimen/rmrb_dp24" | ||
| 15 | + android:gravity="center" | ||
| 16 | + android:textColor="@color/res_color_general_333333" | ||
| 17 | + android:textSize="@dimen/rmrb_dp17" | ||
| 18 | + android:textStyle="bold" /> | ||
| 19 | + | ||
| 20 | + <TextView | ||
| 21 | + android:id="@+id/txt_msg" | ||
| 22 | + android:layout_width="match_parent" | ||
| 23 | + android:layout_height="wrap_content" | ||
| 24 | + android:layout_marginHorizontal="@dimen/rmrb_dp24" | ||
| 25 | + android:layout_marginTop="@dimen/rmrb_dp5" | ||
| 26 | + android:gravity="center" | ||
| 27 | + android:textColor="@color/res_color_common_C3_keep" | ||
| 28 | + android:textSize="@dimen/rmrb_dp14" /> | ||
| 29 | + | ||
| 30 | + <View | ||
| 31 | + android:layout_width="match_parent" | ||
| 32 | + android:layout_height="@dimen/rmrb_dp25" /> | ||
| 33 | + | ||
| 34 | + <ImageView | ||
| 35 | + android:id="@+id/horizontal_line" | ||
| 36 | + android:layout_width="match_parent" | ||
| 37 | + android:layout_height="@dimen/rmrb_dp1" | ||
| 38 | + android:background="@color/res_color_common_C7" /> | ||
| 39 | + | ||
| 40 | + <RelativeLayout | ||
| 41 | + android:layout_width="match_parent" | ||
| 42 | + android:layout_height="wrap_content" | ||
| 43 | + android:orientation="horizontal"> | ||
| 44 | + | ||
| 45 | + <TextView | ||
| 46 | + android:id="@+id/btn_pos" | ||
| 47 | + android:layout_width="match_parent" | ||
| 48 | + android:layout_height="@dimen/rmrb_dp50" | ||
| 49 | + android:layout_alignParentLeft="true" | ||
| 50 | + android:layout_marginLeft="@dimen/rmrb_dp16" | ||
| 51 | + android:layout_toLeftOf="@+id/img_line" | ||
| 52 | + android:gravity="center" | ||
| 53 | + android:textColor="@color/res_color_general_333333" | ||
| 54 | + android:textSize="@dimen/rmrb_dp18" /> | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + <ImageView | ||
| 58 | + android:id="@+id/img_line" | ||
| 59 | + android:layout_width="@dimen/rmrb_dp1" | ||
| 60 | + android:layout_height="@dimen/rmrb_dp44" | ||
| 61 | + android:layout_centerInParent="true" | ||
| 62 | + android:background="@color/res_color_common_C7" /> | ||
| 63 | + | ||
| 64 | + <TextView | ||
| 65 | + android:id="@+id/btn_neg" | ||
| 66 | + android:layout_width="match_parent" | ||
| 67 | + android:layout_height="@dimen/rmrb_dp50" | ||
| 68 | + android:layout_alignParentRight="true" | ||
| 69 | + android:layout_marginRight="@dimen/rmrb_dp16" | ||
| 70 | + android:layout_toRightOf="@+id/img_line" | ||
| 71 | + android:gravity="center" | ||
| 72 | + android:textColor="@color/res_color_general_648DF2" | ||
| 73 | + android:textSize="@dimen/rmrb_dp18" /> | ||
| 74 | + </RelativeLayout> | ||
| 75 | + | ||
| 76 | +</LinearLayout> |
| @@ -41,6 +41,7 @@ dependencies { | @@ -41,6 +41,7 @@ dependencies { | ||
| 41 | implementation rootProject.ext.dependencies["material"] | 41 | implementation rootProject.ext.dependencies["material"] |
| 42 | implementation project(path: ':wdlayout') | 42 | implementation project(path: ':wdlayout') |
| 43 | api project(path: ':wdrouter') | 43 | api project(path: ':wdrouter') |
| 44 | + api project(path: ':wdinterface') | ||
| 44 | annotationProcessor 'com.alibaba:arouter-compiler:1.5.2' | 45 | annotationProcessor 'com.alibaba:arouter-compiler:1.5.2' |
| 45 | implementation 'androidx.activity:activity:1.8.0' | 46 | implementation 'androidx.activity:activity:1.8.0' |
| 46 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | 47 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
| @@ -10,8 +10,9 @@ import androidx.core.content.FileProvider; | @@ -10,8 +10,9 @@ import androidx.core.content.FileProvider; | ||
| 10 | import androidx.fragment.app.FragmentActivity; | 10 | import androidx.fragment.app.FragmentActivity; |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -import com.wd.capability.network.NetManager; | ||
| 14 | import com.wd.common.base.BaseApplication; | 13 | import com.wd.common.base.BaseApplication; |
| 14 | +import com.wd.foundation.wdinterface.config.INetConfig; | ||
| 15 | +import com.wd.foundation.wdinterface.constant.InterfaceConstant; | ||
| 15 | import com.wd.foundation.wdkit.constant.Constants; | 16 | import com.wd.foundation.wdkit.constant.Constants; |
| 16 | import com.wd.capability.network.constant.EventConstants; | 17 | import com.wd.capability.network.constant.EventConstants; |
| 17 | import com.wd.common.utils.ProcessUtils; | 18 | import com.wd.common.utils.ProcessUtils; |
| @@ -20,6 +21,7 @@ import com.wd.foundation.bean.response.BottomNavBean; | @@ -20,6 +21,7 @@ import com.wd.foundation.bean.response.BottomNavBean; | ||
| 20 | import com.wd.foundation.bean.response.ChannelBean; | 21 | import com.wd.foundation.bean.response.ChannelBean; |
| 21 | import com.wd.foundation.wdkit.utils.SpUtils; | 22 | import com.wd.foundation.wdkit.utils.SpUtils; |
| 22 | import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | 23 | import com.wd.foundation.wdkitcore.livedata.LiveDataBus; |
| 24 | +import com.wd.foundation.wdkitcore.router.ArouterServiceManager; | ||
| 23 | import com.wd.foundation.wdkitcore.tools.JsonUtils; | 25 | import com.wd.foundation.wdkitcore.tools.JsonUtils; |
| 24 | import com.wd.foundation.wdkitcore.tools.StringUtils; | 26 | import com.wd.foundation.wdkitcore.tools.StringUtils; |
| 25 | import com.wd.module_home.R; | 27 | import com.wd.module_home.R; |
| @@ -271,8 +273,9 @@ public class WelcomeUtils { | @@ -271,8 +273,9 @@ public class WelcomeUtils { | ||
| 271 | * @return | 273 | * @return |
| 272 | */ | 274 | */ |
| 273 | private static boolean isProdEnvironmentMode() { | 275 | private static boolean isProdEnvironmentMode() { |
| 274 | - String tag = NetManager.getUrlTag(); | ||
| 275 | - if (NetManager.BASE_URL_REL.equals(tag)) { | 276 | + INetConfig config = ArouterServiceManager.provide(InterfaceConstant.PATH_NET_CONFIG); |
| 277 | + String tag = config.getUrlTag(); | ||
| 278 | + if (config.getBaseUrlRelTag().equals(tag)) { | ||
| 276 | return true; | 279 | return true; |
| 277 | } else { | 280 | } else { |
| 278 | return false; | 281 | return false; |
| @@ -12,3 +12,23 @@ include ':wdlayout' | @@ -12,3 +12,23 @@ include ':wdlayout' | ||
| 12 | include ':wdinterface' | 12 | include ':wdinterface' |
| 13 | include ':wdinterfaceimpl' | 13 | include ':wdinterfaceimpl' |
| 14 | include ':module_home' | 14 | include ':module_home' |
| 15 | +include ':lib_routermanager' | ||
| 16 | +include ':lib_entityclass' | ||
| 17 | +include ':module_personalcenter' | ||
| 18 | +include ':aar_repo:lib_logger' | ||
| 19 | +include ':aar_repo:localaar_ability' | ||
| 20 | +include ':base_res' | ||
| 21 | +include ':lib_network' | ||
| 22 | +include ':aar_repo:localaar_weiboaar' | ||
| 23 | +include ':base_location' | ||
| 24 | +include ':aar_repo:lib_main' | ||
| 25 | +include ':aar_repo:localaar_framework' | ||
| 26 | +include ':base_share' | ||
| 27 | +include ':base_component' | ||
| 28 | +include ':lib_liveDataBus' | ||
| 29 | +include ':base_player' | ||
| 30 | +include ':base_interact' | ||
| 31 | +include ':lib_logutil' | ||
| 32 | +include ':wd_annotation' | ||
| 33 | +include ':lib_common' | ||
| 34 | +include ':lib_kittools' |
| 1 | +package com.wd.foundation.bean.analytics; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 行为类型 | ||
| 5 | + * @author baozhaoxin | ||
| 6 | + * @version [V1.0.0, 2023/6/21] | ||
| 7 | + * @since V1.0.0 | ||
| 8 | + */ | ||
| 9 | +public class ActionConstants { | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * 曝光/展示 | ||
| 13 | + */ | ||
| 14 | + public static final String SHOW = "show"; | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 点击 | ||
| 18 | + */ | ||
| 19 | + public static final String DETAIL_PAGE_SHOW = "detailPageShow"; | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + */ | ||
| 23 | + public static final String CLOSEINTERESTCARD = "closeInterestCard"; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * | ||
| 27 | + */ | ||
| 28 | + public static final String SELECTINTERESTCARD = "selectInterestCard"; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 收藏 | ||
| 32 | + */ | ||
| 33 | + public static final String COLLECT = "collect"; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 收藏加入标签 | ||
| 37 | + */ | ||
| 38 | + public static final String COLLECT_TAG = "collectTag"; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 取消收藏 | ||
| 42 | + */ | ||
| 43 | + public static final String UN_COLLECT = "uncollect"; | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 关注 | ||
| 47 | + */ | ||
| 48 | + public static final String FOLLOW = "follow"; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 取消关注 | ||
| 52 | + */ | ||
| 53 | + public static final String UN_FOLLOW = "unfollow"; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 赞/顶/喜欢 | ||
| 57 | + */ | ||
| 58 | + public static final String LIKE = "like"; | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 踩/不喜欢/不感兴趣 | ||
| 62 | + */ | ||
| 63 | + public static final String DIS_LIKE = "dislike"; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 分享 | ||
| 67 | + */ | ||
| 68 | + public static final String SHARE = "share"; | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 评论 | ||
| 72 | + */ | ||
| 73 | + public static final String COMMENT = "comment"; | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 浏览 | ||
| 77 | + */ | ||
| 78 | + public static final String BROWSE = "browse"; | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 下载 | ||
| 82 | + */ | ||
| 83 | + public static final String DOWNLOAD = "download"; | ||
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * 订阅 | ||
| 87 | + */ | ||
| 88 | + public static final String SUBSCRIBE = "subscribe"; | ||
| 89 | + | ||
| 90 | +} |
| @@ -24,6 +24,26 @@ public class LiveTypeConstants { | @@ -24,6 +24,26 @@ public class LiveTypeConstants { | ||
| 24 | public static final String LIVE_END = "liveEnd"; | 24 | public static final String LIVE_END = "liveEnd"; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | + * 直播取消-埋点用 | ||
| 28 | + */ | ||
| 29 | + public static final String LIVE_CANCEL = "liveCancel"; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 直播暂停-埋点用 | ||
| 33 | + */ | ||
| 34 | + public static final String LIVE_PAUSED = "livePaused"; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 直播回放-埋点用 | ||
| 38 | + */ | ||
| 39 | + public static final String LIVE_BACK = "liveBack"; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 未知状态-埋点用 | ||
| 43 | + */ | ||
| 44 | + public static final String UN_KNOW = "unKnow"; | ||
| 45 | + | ||
| 46 | + /** | ||
| 27 | * 直播中 | 47 | * 直播中 |
| 28 | */ | 48 | */ |
| 29 | public static final String RUNNING = "running"; | 49 | public static final String RUNNING = "running"; |
| 1 | package com.wd.foundation.bean.analytics; | 1 | package com.wd.foundation.bean.analytics; |
| 2 | 2 | ||
| 3 | /** | 3 | /** |
| 4 | - * Time:2023/3/22 | ||
| 5 | - * Author:ypf | ||
| 6 | - * Description:名称:专题类型,属性值:summary_type | 4 | + * 专题类型 |
| 5 | + * @author baozhaoxin | ||
| 6 | + * @version [V1.0.0, 2024/1/23] | ||
| 7 | + * @since V1.0.0 | ||
| 7 | */ | 8 | */ |
| 8 | public class SummaryTypeConstants { | 9 | public class SummaryTypeConstants { |
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | - * 普通专题 | 12 | + * 直播专题 |
| 12 | */ | 13 | */ |
| 13 | - public static final String NORMAL_SUBJECT = "normal_subject"; | 14 | + public static final String LIVE_TOPIC = "liveTopic"; |
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | - * 主题专题 | 17 | + * 文章专题 |
| 17 | */ | 18 | */ |
| 18 | - public static final String THEMATIC_SUBJECT = "thematic_subject"; | 19 | + public static final String ARTICLE_TOPIC = "articleTopic"; |
| 19 | 20 | ||
| 20 | /** | 21 | /** |
| 21 | - * 作者专题 | 22 | + * 音频专题 |
| 23 | + * 页面浏览(原生) | ||
| 24 | + * 内容点击(原生) | ||
| 25 | + * 内容曝光(原生) | ||
| 26 | + * 音频专题-普通按钮点击(原生) | ||
| 27 | + * 分享方式点击(原生) | ||
| 28 | + * 评论点击发布(原生) | ||
| 22 | */ | 29 | */ |
| 23 | - public static final String AUTHOR_SUBJECT = "author_subject"; | 30 | + public static final String AUDIO_TOPIC = "audioTopic"; |
| 24 | 31 | ||
| 32 | + /** | ||
| 33 | + * 话题专题 | ||
| 34 | + */ | ||
| 35 | + public static final String TALK_TOPIC = "talkTopic"; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 早晚报专题 | ||
| 39 | + */ | ||
| 40 | + public static final String MORNING_AND_EVENING_NEWS_TOPIC = "morningAndEveningNewsTopic"; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 时间轴专题 | ||
| 44 | + */ | ||
| 45 | + public static final String TIME_AXIS_TOPIC = "timeAxisTopic"; | ||
| 25 | } | 46 | } |
| 1 | - | ||
| 2 | package com.wd.foundation.bean.analytics; | 1 | package com.wd.foundation.bean.analytics; |
| 3 | 2 | ||
| 4 | import android.text.TextUtils; | 3 | import android.text.TextUtils; |
| 5 | 4 | ||
| 5 | + | ||
| 6 | +import com.wd.foundation.bean.adv.CompAdvBean; | ||
| 6 | import com.wd.foundation.bean.base.BaseBean; | 7 | import com.wd.foundation.bean.base.BaseBean; |
| 7 | import com.wd.foundation.bean.custom.act.BaseActivityBean; | 8 | import com.wd.foundation.bean.custom.act.BaseActivityBean; |
| 8 | import com.wd.foundation.bean.custom.comp.ChannelInfoBean; | 9 | import com.wd.foundation.bean.custom.comp.ChannelInfoBean; |
| 9 | import com.wd.foundation.bean.custom.comp.CompBean; | 10 | import com.wd.foundation.bean.custom.comp.CompBean; |
| 10 | import com.wd.foundation.bean.custom.comp.PageBean; | 11 | import com.wd.foundation.bean.custom.comp.PageBean; |
| 11 | import com.wd.foundation.bean.custom.comp.TopicInfoBean; | 12 | import com.wd.foundation.bean.custom.comp.TopicInfoBean; |
| 13 | +import com.wd.foundation.bean.custom.content.CommentItem; | ||
| 12 | import com.wd.foundation.bean.custom.content.ContentBean; | 14 | import com.wd.foundation.bean.custom.content.ContentBean; |
| 13 | import com.wd.foundation.bean.custom.content.ContentTypeConstant; | 15 | import com.wd.foundation.bean.custom.content.ContentTypeConstant; |
| 14 | import com.wd.foundation.bean.custom.content.PeopleMasterBean; | 16 | import com.wd.foundation.bean.custom.content.PeopleMasterBean; |
| 15 | import com.wd.foundation.bean.mail.LiveInfo; | 17 | import com.wd.foundation.bean.mail.LiveInfo; |
| 18 | +import com.wd.foundation.bean.mail.VliveBean; | ||
| 16 | import com.wd.foundation.bean.response.ConvertLiveBean; | 19 | import com.wd.foundation.bean.response.ConvertLiveBean; |
| 20 | +import com.wd.foundation.wdkitcore.tools.ArrayUtils; | ||
| 21 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 22 | + | ||
| 23 | +import java.util.List; | ||
| 17 | 24 | ||
| 18 | /** | 25 | /** |
| 19 | * 埋点-内容bean | 26 | * 埋点-内容bean |
| 20 | - * TODO 涉及业务,待梳理 拆解 | ||
| 21 | - * | 27 | + * |
| 22 | * @author baozhaoxin | 28 | * @author baozhaoxin |
| 23 | * @version [V1.0.0, 2023/3/14] | 29 | * @version [V1.0.0, 2023/3/14] |
| 24 | * @since V1.0.0 | 30 | * @since V1.0.0 |
| @@ -44,7 +50,6 @@ public class TrackContentBean extends BaseBean { | @@ -44,7 +50,6 @@ public class TrackContentBean extends BaseBean { | ||
| 44 | * 内容类型 | 50 | * 内容类型 |
| 45 | */ | 51 | */ |
| 46 | private String content_type; | 52 | private String content_type; |
| 47 | - | ||
| 48 | /** | 53 | /** |
| 49 | * 内容分类 | 54 | * 内容分类 |
| 50 | */ | 55 | */ |
| @@ -93,12 +98,12 @@ public class TrackContentBean extends BaseBean { | @@ -93,12 +98,12 @@ public class TrackContentBean extends BaseBean { | ||
| 93 | /** | 98 | /** |
| 94 | * 所属一级频道ID | 99 | * 所属一级频道ID |
| 95 | */ | 100 | */ |
| 96 | - private String content_show_channel_id; | 101 | + private String contentShowChannelId; |
| 97 | 102 | ||
| 98 | /** | 103 | /** |
| 99 | - * 所属二级频道ID | 104 | + * 所属一级频道名称 |
| 100 | */ | 105 | */ |
| 101 | - private String level2channel_id; | 106 | + private String contentShowChannelName; |
| 102 | 107 | ||
| 103 | /** | 108 | /** |
| 104 | * H5地址-待定 | 109 | * H5地址-待定 |
| @@ -125,6 +130,16 @@ public class TrackContentBean extends BaseBean { | @@ -125,6 +130,16 @@ public class TrackContentBean extends BaseBean { | ||
| 125 | */ | 130 | */ |
| 126 | public String position; | 131 | public String position; |
| 127 | 132 | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 专题类型 | ||
| 136 | + */ | ||
| 137 | + public String specialType; | ||
| 138 | + /** | ||
| 139 | + * 专题链接 | ||
| 140 | + */ | ||
| 141 | + public String specialLink; | ||
| 142 | + | ||
| 128 | /** | 143 | /** |
| 129 | * 耗时 | 144 | * 耗时 |
| 130 | */ | 145 | */ |
| @@ -143,6 +158,11 @@ public class TrackContentBean extends BaseBean { | @@ -143,6 +158,11 @@ public class TrackContentBean extends BaseBean { | ||
| 143 | private int complet_rate; | 158 | private int complet_rate; |
| 144 | 159 | ||
| 145 | /** | 160 | /** |
| 161 | + * 试验id | ||
| 162 | + */ | ||
| 163 | + public String expIds; | ||
| 164 | + | ||
| 165 | + /** | ||
| 146 | * 错误信息 | 166 | * 错误信息 |
| 147 | */ | 167 | */ |
| 148 | private String error_information; | 168 | private String error_information; |
| @@ -199,12 +219,6 @@ public class TrackContentBean extends BaseBean { | @@ -199,12 +219,6 @@ public class TrackContentBean extends BaseBean { | ||
| 199 | * 推荐数据 | 219 | * 推荐数据 |
| 200 | */ | 220 | */ |
| 201 | private TraceBean traceBean; | 221 | private TraceBean traceBean; |
| 202 | - | ||
| 203 | - /** | ||
| 204 | - * 直播数据 | ||
| 205 | - */ | ||
| 206 | - private TraceLiveBean traceLiveBean; | ||
| 207 | - | ||
| 208 | /** | 222 | /** |
| 209 | * 开屏广告类型 | 223 | * 开屏广告类型 |
| 210 | */ | 224 | */ |
| @@ -214,51 +228,41 @@ public class TrackContentBean extends BaseBean { | @@ -214,51 +228,41 @@ public class TrackContentBean extends BaseBean { | ||
| 214 | * 活动ID | 228 | * 活动ID |
| 215 | */ | 229 | */ |
| 216 | public String activityId; | 230 | public String activityId; |
| 217 | - | ||
| 218 | /** | 231 | /** |
| 219 | * 活动名称 | 232 | * 活动名称 |
| 220 | */ | 233 | */ |
| 221 | public String activityName; | 234 | public String activityName; |
| 222 | - | ||
| 223 | /** | 235 | /** |
| 224 | * 活动类型 | 236 | * 活动类型 |
| 225 | */ | 237 | */ |
| 226 | public String activityType; | 238 | public String activityType; |
| 227 | - | ||
| 228 | /** | 239 | /** |
| 229 | * 活动状态 | 240 | * 活动状态 |
| 230 | */ | 241 | */ |
| 231 | public String activityState; | 242 | public String activityState; |
| 232 | 243 | ||
| 244 | + | ||
| 245 | + /** | ||
| 246 | + * 直播流类型 | ||
| 247 | + * 直播必填,1、普通 2、VR | ||
| 248 | + */ | ||
| 233 | public String live_stream_type; | 249 | public String live_stream_type; |
| 234 | 250 | ||
| 235 | public String vlive_id; | 251 | public String vlive_id; |
| 236 | - | ||
| 237 | - private String vlive_name; | ||
| 238 | - | ||
| 239 | - private String live_mode; | ||
| 240 | - | 252 | + public String vlive_name; |
| 253 | + public String live_mode; | ||
| 241 | public String author_id; | 254 | public String author_id; |
| 242 | - | ||
| 243 | public String author_name; | 255 | public String author_name; |
| 244 | - | ||
| 245 | private String item_id; | 256 | private String item_id; |
| 246 | - | ||
| 247 | private String item_type; | 257 | private String item_type; |
| 248 | - | ||
| 249 | private String bhv_type; | 258 | private String bhv_type; |
| 250 | - | ||
| 251 | private String trace_id; | 259 | private String trace_id; |
| 252 | - | ||
| 253 | private String trace_info; | 260 | private String trace_info; |
| 254 | - | ||
| 255 | private String scene_id; | 261 | private String scene_id; |
| 256 | - | ||
| 257 | private String bhv_value; | 262 | private String bhv_value; |
| 258 | 263 | ||
| 259 | private String extend_play; | 264 | private String extend_play; |
| 260 | - | ||
| 261 | - // private String expose ; | 265 | + // private String expose ; |
| 262 | private String stay; | 266 | private String stay; |
| 263 | 267 | ||
| 264 | public String followPDUserId; | 268 | public String followPDUserId; |
| @@ -280,6 +284,34 @@ public class TrackContentBean extends BaseBean { | @@ -280,6 +284,34 @@ public class TrackContentBean extends BaseBean { | ||
| 280 | */ | 284 | */ |
| 281 | private String adType; | 285 | private String adType; |
| 282 | 286 | ||
| 287 | + /** | ||
| 288 | + * 行为针对的物料ID | ||
| 289 | + */ | ||
| 290 | + public String itemId; | ||
| 291 | + | ||
| 292 | + /** | ||
| 293 | + * 当前交互触点(或页面) | ||
| 294 | + */ | ||
| 295 | + public String saPosition; | ||
| 296 | + | ||
| 297 | + /** | ||
| 298 | + * 视频观看时长 | ||
| 299 | + */ | ||
| 300 | + public long pybkDuration; | ||
| 301 | + | ||
| 302 | + /** | ||
| 303 | + * 发布标识,0-cms;1-表示号主发布 2-普通用户 | ||
| 304 | + */ | ||
| 305 | + private int rmhPlatform = 0; | ||
| 306 | + | ||
| 307 | + public int getRmhPlatform() { | ||
| 308 | + return rmhPlatform; | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + public void setRmhPlatform(int rmhPlatform) { | ||
| 312 | + this.rmhPlatform = rmhPlatform; | ||
| 313 | + } | ||
| 314 | + | ||
| 283 | public String getAdId() { | 315 | public String getAdId() { |
| 284 | return adId; | 316 | return adId; |
| 285 | } | 317 | } |
| @@ -320,12 +352,20 @@ public class TrackContentBean extends BaseBean { | @@ -320,12 +352,20 @@ public class TrackContentBean extends BaseBean { | ||
| 320 | this.bhv_type = bhv_type; | 352 | this.bhv_type = bhv_type; |
| 321 | } | 353 | } |
| 322 | 354 | ||
| 323 | - public String getContent_show_channel_id() { | ||
| 324 | - return content_show_channel_id; | 355 | + public String getContentShowChannelId() { |
| 356 | + return contentShowChannelId; | ||
| 357 | + } | ||
| 358 | + | ||
| 359 | + public void setContentShowChannelId(String contentShowChannelId) { | ||
| 360 | + this.contentShowChannelId = contentShowChannelId; | ||
| 361 | + } | ||
| 362 | + | ||
| 363 | + public String getChannelSourceId() { | ||
| 364 | + return channelSourceId; | ||
| 325 | } | 365 | } |
| 326 | 366 | ||
| 327 | - public void setContent_show_channel_id(String content_show_channel_id) { | ||
| 328 | - this.content_show_channel_id = content_show_channel_id; | 367 | + public void setChannelSourceId(String channelSourceId) { |
| 368 | + this.channelSourceId = channelSourceId; | ||
| 329 | } | 369 | } |
| 330 | 370 | ||
| 331 | public String getPage_name() { | 371 | public String getPage_name() { |
| @@ -416,13 +456,6 @@ public class TrackContentBean extends BaseBean { | @@ -416,13 +456,6 @@ public class TrackContentBean extends BaseBean { | ||
| 416 | this.live_type = live_type; | 456 | this.live_type = live_type; |
| 417 | } | 457 | } |
| 418 | 458 | ||
| 419 | - public String getLevel2channel_id() { | ||
| 420 | - return level2channel_id; | ||
| 421 | - } | ||
| 422 | - | ||
| 423 | - public void setLevel2channel_id(String level2channel_id) { | ||
| 424 | - this.level2channel_id = level2channel_id; | ||
| 425 | - } | ||
| 426 | 459 | ||
| 427 | public String getH5_url() { | 460 | public String getH5_url() { |
| 428 | return h5_url; | 461 | return h5_url; |
| @@ -460,6 +493,7 @@ public class TrackContentBean extends BaseBean { | @@ -460,6 +493,7 @@ public class TrackContentBean extends BaseBean { | ||
| 460 | this.region_name = region_name; | 493 | this.region_name = region_name; |
| 461 | } | 494 | } |
| 462 | 495 | ||
| 496 | + | ||
| 463 | public TraceBean getTraceBean() { | 497 | public TraceBean getTraceBean() { |
| 464 | return traceBean; | 498 | return traceBean; |
| 465 | } | 499 | } |
| @@ -468,14 +502,6 @@ public class TrackContentBean extends BaseBean { | @@ -468,14 +502,6 @@ public class TrackContentBean extends BaseBean { | ||
| 468 | this.traceBean = traceBean; | 502 | this.traceBean = traceBean; |
| 469 | } | 503 | } |
| 470 | 504 | ||
| 471 | - public TraceLiveBean getTraceLiveBean() { | ||
| 472 | - return traceLiveBean; | ||
| 473 | - } | ||
| 474 | - | ||
| 475 | - public void setTraceLiveBean(TraceLiveBean traceLiveBean) { | ||
| 476 | - this.traceLiveBean = traceLiveBean; | ||
| 477 | - } | ||
| 478 | - | ||
| 479 | public int getTime_consuming() { | 505 | public int getTime_consuming() { |
| 480 | return time_consuming; | 506 | return time_consuming; |
| 481 | } | 507 | } |
| @@ -572,6 +598,7 @@ public class TrackContentBean extends BaseBean { | @@ -572,6 +598,7 @@ public class TrackContentBean extends BaseBean { | ||
| 572 | this.action = action; | 598 | this.action = action; |
| 573 | } | 599 | } |
| 574 | 600 | ||
| 601 | + | ||
| 575 | /** | 602 | /** |
| 576 | * ContentBean和CompBean 转换成 埋点对象( 组件和稿件使用) | 603 | * ContentBean和CompBean 转换成 埋点对象( 组件和稿件使用) |
| 577 | * | 604 | * |
| @@ -595,23 +622,27 @@ public class TrackContentBean extends BaseBean { | @@ -595,23 +622,27 @@ public class TrackContentBean extends BaseBean { | ||
| 595 | if (compStyle.contains("Zh_")) { | 622 | if (compStyle.contains("Zh_")) { |
| 596 | component_type = compStyle; | 623 | component_type = compStyle; |
| 597 | comp_id = compBean.getId(); | 624 | comp_id = compBean.getId(); |
| 625 | + contentBean.contentByStyle = component_type; | ||
| 598 | } else { | 626 | } else { |
| 599 | content_style = compStyle; | 627 | content_style = compStyle; |
| 600 | } | 628 | } |
| 601 | } | 629 | } |
| 602 | } | 630 | } |
| 603 | 631 | ||
| 632 | + | ||
| 604 | ChannelInfoBean channelInfoBean = compBean.getChannelInfoBean(); | 633 | ChannelInfoBean channelInfoBean = compBean.getChannelInfoBean(); |
| 605 | if (channelInfoBean != null) { | 634 | if (channelInfoBean != null) { |
| 606 | - content_show_channel_id = channelInfoBean.getChannelId(); | 635 | + contentShowChannelId = channelInfoBean.getChannelId(); |
| 636 | + contentShowChannelName = channelInfoBean.getChannelName(); | ||
| 607 | } | 637 | } |
| 638 | + channelSourceId = contentShowChannelId; | ||
| 608 | 639 | ||
| 609 | } else { | 640 | } else { |
| 610 | content_style = contentBean.getAppStyle(); | 641 | content_style = contentBean.getAppStyle(); |
| 611 | page_name = contentBean.getFromPage(); | 642 | page_name = contentBean.getFromPage(); |
| 612 | - // 普通页面 | 643 | + //普通页面 |
| 613 | String pageId = contentBean.getPageId(); | 644 | String pageId = contentBean.getPageId(); |
| 614 | - if (isBlank(pageId)) { | 645 | + if (StringUtils.isBlank(pageId)) { |
| 615 | page_id = contentBean.getFromPage(); | 646 | page_id = contentBean.getFromPage(); |
| 616 | } else { | 647 | } else { |
| 617 | page_id = pageId; | 648 | page_id = pageId; |
| @@ -619,63 +650,82 @@ public class TrackContentBean extends BaseBean { | @@ -619,63 +650,82 @@ public class TrackContentBean extends BaseBean { | ||
| 619 | 650 | ||
| 620 | } | 651 | } |
| 621 | 652 | ||
| 622 | - if (!TextUtils.isEmpty(contentBean.getObjectType())) { | ||
| 623 | - int type = Integer.parseInt(contentBean.getObjectType()); | ||
| 624 | - if (ContentTypeConstant.URL_TYPE_FIVE == type && !TextUtils.isEmpty(contentBean.getObjectLevel())) { | 653 | + // 广告 |
| 654 | + CompAdvBean compAdvBean = contentBean.getCompAdvBean(); | ||
| 655 | + if (compAdvBean != null) { | ||
| 656 | + adId = contentBean.getObjectId(); | ||
| 657 | + adName = contentBean.getNewsTitle(); | ||
| 658 | + adType = "2"; | ||
| 659 | + }else { | ||
| 625 | 660 | ||
| 626 | - summary_id = contentBean.getObjectId(); | ||
| 627 | - try { | ||
| 628 | - int topicTemplate = Integer.parseInt(contentBean.getObjectLevel()); | ||
| 629 | - summary_type = summary_type_parameter(topicTemplate); | ||
| 630 | - } catch (Exception e) { | ||
| 631 | - e.printStackTrace(); | ||
| 632 | - } | ||
| 633 | - link_url = contentBean.getLinkUrl(); | ||
| 634 | - } else if (ContentTypeConstant.URL_TYPE_TWO == type && contentBean.getLiveInfo() != null) { | ||
| 635 | - | ||
| 636 | - LiveInfo liveInfo = contentBean.getLiveInfo(); | ||
| 637 | - | ||
| 638 | - String liveState = liveInfo.getLiveState(); | ||
| 639 | - | ||
| 640 | - if (ContentTypeConstant.LIVE_WAIT.equals(liveState)) { | ||
| 641 | - // 预约 | ||
| 642 | - live_type = LiveTypeConstants.LIVE_SUBSCRIBE; | ||
| 643 | - } else if (ContentTypeConstant.LIVE_RUNNING.equals(liveState)) { | ||
| 644 | - // 直播中 | ||
| 645 | - live_type = LiveTypeConstants.LIVE_RUNNING; | ||
| 646 | - } else if (ContentTypeConstant.LIVE_END.equals(liveState)) { | ||
| 647 | - // 结束 | ||
| 648 | - live_type = LiveTypeConstants.LIVE_END; | ||
| 649 | - } | ||
| 650 | - | ||
| 651 | - TraceLiveBean traceLiveBean = new TraceLiveBean(); | ||
| 652 | - traceLiveBean.liveStreamType = liveInfo.getVrType() == 1 ? "2" : "1"; | ||
| 653 | - traceLiveBean.liveMode = ""; | ||
| 654 | - traceLiveBean.vliveId = contentBean.getObjectId(); | ||
| 655 | - traceLiveBean.vliveName = contentBean.getNewsTitle(); | ||
| 656 | - setTraceLiveBean(traceLiveBean); | ||
| 657 | - | ||
| 658 | - } else if (ContentTypeConstant.URL_TYPE_SIX == type && ContentTypeConstant.URL_TYPE_TEN == type) { | ||
| 659 | - | ||
| 660 | - link_url = contentBean.getLinkUrl(); | ||
| 661 | - | ||
| 662 | - } else if (ContentTypeConstant.URL_TYPE_THREE == type) { | ||
| 663 | - // 活动 | 661 | + if (!TextUtils.isEmpty(contentBean.getObjectType())) { |
| 662 | + int type = Integer.parseInt(contentBean.getObjectType()); | ||
| 663 | + if (ContentTypeConstant.URL_TYPE_FIVE == type && !TextUtils.isEmpty(contentBean.getObjectLevel())) { | ||
| 664 | + | ||
| 665 | + summary_id = contentBean.getObjectId(); | ||
| 666 | + try { | ||
| 667 | + int topicTemplate = Integer.parseInt(contentBean.getObjectLevel()); | ||
| 668 | + summary_type = summary_type_parameter(topicTemplate); | ||
| 669 | + specialType = summary_type; | ||
| 670 | + specialLink = contentBean.getLinkUrl(); | ||
| 671 | + } catch (Exception e) { | ||
| 672 | + e.printStackTrace(); | ||
| 673 | + } | ||
| 674 | + //所属区域,专题为4 | ||
| 675 | + region_name = "4"; | ||
| 676 | + } else if (ContentTypeConstant.URL_TYPE_TWO == type && contentBean.getLiveInfo() != null) { // 直播 | ||
| 677 | + | ||
| 678 | + LiveInfo liveInfo = contentBean.getLiveInfo(); | ||
| 679 | + | ||
| 680 | + String liveState = liveInfo.getLiveState(); | ||
| 681 | + | ||
| 682 | + if (ContentTypeConstant.LIVE_WAIT.equals(liveState)) { | ||
| 683 | + // 预约 | ||
| 684 | + live_type = LiveTypeConstants.LIVE_SUBSCRIBE; | ||
| 685 | + } else if (ContentTypeConstant.LIVE_RUNNING.equals(liveState)) { | ||
| 686 | + // 直播中 | ||
| 687 | + live_type = LiveTypeConstants.LIVE_RUNNING; | ||
| 688 | + } else if (ContentTypeConstant.LIVE_END.equals(liveState)) { | ||
| 689 | + // 结束 | ||
| 690 | + live_type = LiveTypeConstants.LIVE_END; | ||
| 691 | + } else if (ContentTypeConstant.LIVE_CANCEL.equals(liveState)) { | ||
| 692 | + // 取消 | ||
| 693 | + live_type = LiveTypeConstants.LIVE_CANCEL; | ||
| 694 | + } else if (ContentTypeConstant.LIVE_PAUSED.equals(liveState)) { | ||
| 695 | + // 暂停 | ||
| 696 | + live_type = LiveTypeConstants.LIVE_PAUSED; | ||
| 697 | + }else { | ||
| 698 | + //未知 | ||
| 699 | + live_type = LiveTypeConstants.UN_KNOW; | ||
| 700 | + } | ||
| 664 | 701 | ||
| 665 | - BaseActivityBean activityBean = contentBean.itemActivity; | ||
| 666 | - if (activityBean != null) { | ||
| 667 | - activityId = activityBean.getActivityId(); | ||
| 668 | - activityName = activityBean.getActivityTitle(); | ||
| 669 | - // 0-征集活动 1-抽奖活动 2-答题活动 3-投票活动 接口现在没给区分 | ||
| 670 | - activityType = activityBean.getActivityType(); | ||
| 671 | - // 2-已结束 1-进行中 0-未开始 | ||
| 672 | - activityState = activityBean.checkActivityStatus(System.currentTimeMillis()) + ""; | 702 | + live_stream_type = liveInfo.getVrType() == 1 ? "2" : "1"; |
| 703 | + live_mode = ""; | ||
| 704 | + vlive_id = contentBean.getObjectId(); | ||
| 705 | + vlive_name = contentBean.getNewsTitle(); | ||
| 706 | + } else if (ContentTypeConstant.URL_TYPE_SIX == type && ContentTypeConstant.URL_TYPE_TEN == type) { | ||
| 707 | + } else if (ContentTypeConstant.URL_TYPE_SIX == type || ContentTypeConstant.URL_TYPE_TEN == type) { | ||
| 708 | + | ||
| 709 | + link_url = contentBean.getLinkUrl(); | ||
| 710 | + | ||
| 711 | + } else if (ContentTypeConstant.URL_TYPE_THREE == type) { | ||
| 712 | + // 活动 | ||
| 713 | + | ||
| 714 | + BaseActivityBean activityBean = contentBean.itemActivity; | ||
| 715 | + if (activityBean != null) { | ||
| 716 | + activityId = activityBean.getActivityId(); | ||
| 717 | + activityName = activityBean.getActivityTitle(); | ||
| 718 | + // 0-征集活动 1-抽奖活动 2-答题活动 3-投票活动 接口现在没给区分 | ||
| 719 | + activityType = activityBean.getActivityType(); | ||
| 720 | + // 2-已结束 1-进行中 0-未开始 | ||
| 721 | + activityState = activityBean.checkActivityStatus(System.currentTimeMillis()) + ""; | ||
| 722 | + } | ||
| 673 | } | 723 | } |
| 724 | + | ||
| 674 | } | 725 | } |
| 675 | 726 | ||
| 676 | } | 727 | } |
| 677 | 728 | ||
| 678 | - channelSourceId = ""; | ||
| 679 | 729 | ||
| 680 | PeopleMasterBean rmhInfo = contentBean.getRmhInfo(); | 730 | PeopleMasterBean rmhInfo = contentBean.getRmhInfo(); |
| 681 | if (rmhInfo != null) { | 731 | if (rmhInfo != null) { |
| @@ -693,8 +743,9 @@ public class TrackContentBean extends BaseBean { | @@ -693,8 +743,9 @@ public class TrackContentBean extends BaseBean { | ||
| 693 | content_id = contentBean.getObjectId(); | 743 | content_id = contentBean.getObjectId(); |
| 694 | 744 | ||
| 695 | region_name = "2"; | 745 | region_name = "2"; |
| 746 | + expIds = contentBean.getExpIds(); | ||
| 696 | 747 | ||
| 697 | - // 分享渠道 | 748 | + //分享渠道 |
| 698 | shareChannel = ""; | 749 | shareChannel = ""; |
| 699 | // 浏览时长 | 750 | // 浏览时长 |
| 700 | duration = 0; | 751 | duration = 0; |
| @@ -715,70 +766,148 @@ public class TrackContentBean extends BaseBean { | @@ -715,70 +766,148 @@ public class TrackContentBean extends BaseBean { | ||
| 715 | traceBean.traceId = contentBean.getTraceId(); | 766 | traceBean.traceId = contentBean.getTraceId(); |
| 716 | traceBean.sceneId = contentBean.getSceneId(); | 767 | traceBean.sceneId = contentBean.getSceneId(); |
| 717 | traceBean.subSceneId = contentBean.getSubSceneId(); | 768 | traceBean.subSceneId = contentBean.getSubSceneId(); |
| 769 | + traceBean.cardItemId = contentBean.getCardItemId(); | ||
| 718 | } | 770 | } |
| 719 | setTraceBean(traceBean); | 771 | setTraceBean(traceBean); |
| 772 | + | ||
| 773 | + if(contentBean.getTopicInfoBean() != null){ | ||
| 774 | + summary_type = contentBean.getTopicInfoBean().getTopicTypeWord(); | ||
| 775 | + summary_id = contentBean.getTopicInfoBean().getTopicId(); | ||
| 776 | + //所属区域,专题为4 | ||
| 777 | + region_name = "4"; | ||
| 778 | + } | ||
| 779 | + | ||
| 780 | + //信息流内容埋点,增加来源信息 | ||
| 781 | + rmhPlatform = contentBean.getRmhPlatform(); | ||
| 782 | + | ||
| 783 | + //所属区域处理 | ||
| 784 | + if(StringUtils.isEqual("21003",page_id)){ | ||
| 785 | + //播报页面,所属区域为5 | ||
| 786 | + region_name = "5"; | ||
| 787 | + }else if(StringUtils.isEqual("mainPersonalPage",page_name) || | ||
| 788 | + StringUtils.isEqual("customerPersonalPage",page_name)){ | ||
| 789 | + //个人主页,所属区域为6 | ||
| 790 | + region_name = "6"; | ||
| 791 | + }if(StringUtils.isEqual("search_result_page",page_name) || | ||
| 792 | + StringUtils.isEqual("searchPage",page_name)){ | ||
| 793 | + //搜索,所属区域为7 | ||
| 794 | + region_name = "7"; | ||
| 795 | + }if(StringUtils.isEqual("newsPaperPage",page_name)){ | ||
| 796 | + //版面,所属区域为8 | ||
| 797 | + region_name = "8"; | ||
| 798 | + } | ||
| 720 | } | 799 | } |
| 721 | 800 | ||
| 722 | public TrackContentBean() { | 801 | public TrackContentBean() { |
| 723 | 802 | ||
| 724 | } | 803 | } |
| 725 | 804 | ||
| 726 | - // 专属直播使用 | 805 | + /** |
| 806 | + * 评论 | ||
| 807 | + * | ||
| 808 | + * @param likeComment | ||
| 809 | + */ | ||
| 810 | + public void commentItemToBean(CommentItem likeComment, String pageName, String pageId) { | ||
| 811 | + | ||
| 812 | + page_name = pageName; | ||
| 813 | + page_id = pageId; | ||
| 814 | + | ||
| 815 | + content_name = likeComment.getRealCommentContent(); | ||
| 816 | + content_id = likeComment.getId() + ""; | ||
| 817 | + author_name = likeComment.getFromUserName(); | ||
| 818 | + author_id = likeComment.getFromUserId(); | ||
| 819 | + } | ||
| 820 | + | ||
| 821 | + | ||
| 822 | + //专属直播使用 | ||
| 727 | public TrackContentBean(ConvertLiveBean convertLiveBean) { | 823 | public TrackContentBean(ConvertLiveBean convertLiveBean) { |
| 728 | if (convertLiveBean == null) { | 824 | if (convertLiveBean == null) { |
| 729 | return; | 825 | return; |
| 730 | } | 826 | } |
| 731 | - this.content_name = ""; | 827 | + this.page_id = "liveDetailPage"; |
| 828 | + this.page_name = "liveDetailPage"; | ||
| 829 | + this.content_name = convertLiveBean.getTitle(); | ||
| 732 | this.content_type = "2"; | 830 | this.content_type = "2"; |
| 733 | - this.content_id = ""; | 831 | + this.content_id = convertLiveBean.getLiveId(); |
| 734 | this.component_type = ""; | 832 | this.component_type = ""; |
| 735 | this.comp_id = ""; | 833 | this.comp_id = ""; |
| 736 | this.content_style = ""; | 834 | this.content_style = ""; |
| 737 | - this.summary_type = "";// 没找到合适的数据 | ||
| 738 | - this.summary_id = "";// 没找到字段 | ||
| 739 | - // 直播预约 live_subscribe 直播中 live_running 直播回放 live_back | 835 | + this.summary_type = "";//没找到合适的数据 |
| 836 | + this.summary_id = "";//没找到字段 | ||
| 837 | + // 直播预约 live_subscribe 直播中 live_running 直播回放 live_back | ||
| 740 | String status = convertLiveBean.getStatus(); | 838 | String status = convertLiveBean.getStatus(); |
| 741 | if (ContentTypeConstant.LIVE_RUNNING.equals(status)) { | 839 | if (ContentTypeConstant.LIVE_RUNNING.equals(status)) { |
| 742 | - this.live_type = "live_running"; | ||
| 743 | - } | ||
| 744 | - if (ContentTypeConstant.LIVE_WAIT.equals(status)) { | ||
| 745 | - this.live_type = "live_subscribe"; | 840 | + this.live_type = LiveTypeConstants.LIVE_RUNNING; |
| 841 | + }else if (ContentTypeConstant.LIVE_WAIT.equals(status)) { | ||
| 842 | + this.live_type = LiveTypeConstants.LIVE_SUBSCRIBE; | ||
| 843 | + }else if (ContentTypeConstant.LIVE_END.equals(status)) { | ||
| 844 | + this.live_type = LiveTypeConstants.LIVE_END; | ||
| 845 | + } else if (ContentTypeConstant.LIVE_CANCEL.equals(status)) { | ||
| 846 | + // 取消 | ||
| 847 | + live_type = LiveTypeConstants.LIVE_CANCEL; | ||
| 848 | + } else if (ContentTypeConstant.LIVE_PAUSED.equals(status)) { | ||
| 849 | + // 暂停 | ||
| 850 | + live_type = LiveTypeConstants.LIVE_PAUSED; | ||
| 851 | + }else { | ||
| 852 | + //未知 | ||
| 853 | + live_type = LiveTypeConstants.UN_KNOW; | ||
| 746 | } | 854 | } |
| 747 | - if (ContentTypeConstant.LIVE_END.equals(status)) { | ||
| 748 | - this.live_type = "live_back"; | ||
| 749 | - } | ||
| 750 | - this.content_show_channel_id = "";// 没找到字段 | ||
| 751 | - this.level2channel_id = "";// 没找到字段 | ||
| 752 | - this.h5_url = "";// 没找到字段 | ||
| 753 | - this.link_url = "";// 没找到字段 | ||
| 754 | - // 0-固定位 | ||
| 755 | - // 1-权重 | ||
| 756 | - // 2-精选-推荐因子 | ||
| 757 | - // 3-机器下发 确认接口是否有,接口没有不传 | 855 | + this.contentShowChannelId = "";//没找到字段 |
| 856 | + this.h5_url = "";//没找到字段 | ||
| 857 | + this.link_url = "";//没找到字段 | ||
| 858 | + //0-固定位 | ||
| 859 | + //1-权重 | ||
| 860 | + //2-精选-推荐因子 | ||
| 861 | + //3-机器下发 确认接口是否有,接口没有不传 | ||
| 758 | this.feed_type = ""; | 862 | this.feed_type = ""; |
| 759 | - // 开屏 0 | ||
| 760 | - // 挂角 1 | ||
| 761 | - // 信息流 2 | 863 | + //开屏 0 |
| 864 | + //挂角 1 | ||
| 865 | + //信息流 2 | ||
| 762 | this.region_name = ""; | 866 | this.region_name = ""; |
| 763 | - // this.position = "" ;//没找到字段 | ||
| 764 | - // 1、普通2、VR | ||
| 765 | - this.live_stream_type = convertLiveBean.getLiveStreamType(); | ||
| 766 | - // 传当前直播直播的vlive_id,切了其他路直播,再曝光一次 (待确认) convertLiveBean.getLiveSourceList() | ||
| 767 | - this.vlive_id = ""; | ||
| 768 | - // 暂时标题意思 | ||
| 769 | - this.vlive_name = convertLiveBean.getTitle(); | ||
| 770 | - // 单路直播定义 1、单路直播2、多路直播 不是多路就是单路吧 | 867 | +// this.position = "" ;//没找到字段 |
| 868 | + // 直播流ID(视角id) | ||
| 869 | + List<VliveBean> liveSourceList = convertLiveBean.getLiveSourceList(); | ||
| 870 | + VliveBean vliveBean = ArrayUtils.getListElement(liveSourceList, 0); | ||
| 871 | + if (vliveBean != null) { | ||
| 872 | + // 直播流ID | ||
| 873 | + vlive_id = vliveBean.getVliveId(); | ||
| 874 | + // 1、普通 2、VR | ||
| 875 | + live_stream_type = "1"; | ||
| 876 | + // 直播流名称 | ||
| 877 | + vlive_name = vliveBean.getName(); | ||
| 878 | + } | ||
| 879 | + //暂时标题意思 | ||
| 880 | + if(convertLiveBean.getLiveSourceList() != null && convertLiveBean.getLiveSourceList().size()>0 | ||
| 881 | + && convertLiveBean.getLiveSourceList().get(0) != null){ | ||
| 882 | + this.vlive_name = convertLiveBean.getLiveSourceList().get(0).getName(); | ||
| 883 | + }else{ | ||
| 884 | + this.vlive_name = convertLiveBean.getTitle(); | ||
| 885 | + } | ||
| 886 | + // 单路直播定义 1、单路直播2、多路直播 不是多路就是单路吧 | ||
| 771 | this.live_mode = convertLiveBean.getTplId() == 6 ? "2" : "1"; | 887 | this.live_mode = convertLiveBean.getTplId() == 6 ? "2" : "1"; |
| 772 | this.author_id = convertLiveBean.getCreateUserId(); | 888 | this.author_id = convertLiveBean.getCreateUserId(); |
| 773 | this.author_name = convertLiveBean.getCreateUserName(); | 889 | this.author_name = convertLiveBean.getCreateUserName(); |
| 774 | this.item_id = convertLiveBean.getLiveId(); | 890 | this.item_id = convertLiveBean.getLiveId(); |
| 775 | this.item_type = "video"; | 891 | this.item_type = "video"; |
| 776 | - this.bhv_type = "";// 没找到合适的数据 | ||
| 777 | - this.trace_id = "";// 没找到合适的数据 | ||
| 778 | - this.trace_info = "";// 没找到合适的数据 | ||
| 779 | - this.scene_id = "";// 没找到合适的数据 | ||
| 780 | - this.bhv_value = "";// 没找到合适的数据 | ||
| 781 | - | 892 | + this.bhv_type = "";//没找到合适的数据 |
| 893 | + this.trace_id = "";//没找到合适的数据 | ||
| 894 | + this.trace_info = "";//没找到合适的数据 | ||
| 895 | + this.scene_id = "";//没找到合适的数据 | ||
| 896 | + this.bhv_value = "";//没找到合适的数据 | ||
| 897 | + this.rmhPlatform = convertLiveBean.getRmhPlatform(); | ||
| 898 | + //添加人民号信息 | ||
| 899 | + PeopleMasterBean rmhInfo = convertLiveBean.getRmhInfo(); | ||
| 900 | + if (rmhInfo != null) { | ||
| 901 | + this.author_name = rmhInfo.getRmhName(); | ||
| 902 | + this.author_id = rmhInfo.getRmhId(); | ||
| 903 | + this.followPDUserId = rmhInfo.getRmhId(); | ||
| 904 | + this.followUserName = rmhInfo.getRmhName(); | ||
| 905 | + } | ||
| 906 | + if(convertLiveBean.getNewsDetailBean() != null && | ||
| 907 | + convertLiveBean.getNewsDetailBean().getReLInfo() != null){ | ||
| 908 | + //设置频道id | ||
| 909 | + this.channelSourceId = convertLiveBean.getNewsDetailBean().getReLInfo().getChannelId(); | ||
| 910 | + } | ||
| 782 | } | 911 | } |
| 783 | 912 | ||
| 784 | public String getBhv_value() { | 913 | public String getBhv_value() { |
| @@ -811,18 +940,23 @@ public class TrackContentBean extends BaseBean { | @@ -811,18 +940,23 @@ public class TrackContentBean extends BaseBean { | ||
| 811 | * @param bean | 940 | * @param bean |
| 812 | */ | 941 | */ |
| 813 | public void topicInfoBeanBeantoBean(TopicInfoBean bean) { | 942 | public void topicInfoBeanBeantoBean(TopicInfoBean bean) { |
| 814 | - page_name = bean.getLocalPageName(); | ||
| 815 | - page_id = bean.getLocalPageId(); | ||
| 816 | - content_name = bean.getTitleName(); | ||
| 817 | - content_type = ContentTypeConstant.URL_TYPE_FIVE + ""; | 943 | + page_name = "summaryDetailPage"; |
| 944 | + page_id = "summaryDetailPage"; | ||
| 945 | + content_name = bean.getTitle(); | ||
| 946 | + content_type = bean.getTopicType()+""; | ||
| 818 | content_id = bean.getTopicId(); | 947 | content_id = bean.getTopicId(); |
| 819 | summary_id = bean.getTopicId(); | 948 | summary_id = bean.getTopicId(); |
| 820 | - summary_type = summary_type_parameter(bean.getTopicType()); | 949 | + summary_type = bean.getTopicTypeWord(); |
| 821 | link_url = bean.getShareUrl(); | 950 | link_url = bean.getShareUrl(); |
| 822 | 951 | ||
| 823 | - region_name = "2"; | 952 | + specialType = summary_type; |
| 953 | + specialLink = bean.linkUrl; | ||
| 954 | + //所属区域,专题为4 | ||
| 955 | + region_name = "4"; | ||
| 956 | + rmhPlatform = bean.getRmhPlatform(); | ||
| 824 | } | 957 | } |
| 825 | 958 | ||
| 959 | + | ||
| 826 | /** | 960 | /** |
| 827 | * pageBean对象转换成TrackContentBean对象 | 961 | * pageBean对象转换成TrackContentBean对象 |
| 828 | * | 962 | * |
| @@ -835,33 +969,39 @@ public class TrackContentBean extends BaseBean { | @@ -835,33 +969,39 @@ public class TrackContentBean extends BaseBean { | ||
| 835 | content_id = mPageBean.getId(); | 969 | content_id = mPageBean.getId(); |
| 836 | if (mPageBean.getTopicInfo() != null) { | 970 | if (mPageBean.getTopicInfo() != null) { |
| 837 | TopicInfoBean bean = mPageBean.getTopicInfo(); | 971 | TopicInfoBean bean = mPageBean.getTopicInfo(); |
| 838 | - content_type = ContentTypeConstant.URL_TYPE_FIVE + ""; | 972 | + //专题页pageId、pageName固定传值 |
| 973 | + page_name = "summaryDetailPage"; | ||
| 974 | + page_id = "summaryDetailPage"; | ||
| 975 | + content_type = bean.getTopicType()+""; | ||
| 976 | + content_name = bean.getTitle(); | ||
| 839 | content_id = bean.getTopicId(); | 977 | content_id = bean.getTopicId(); |
| 840 | summary_id = bean.getTopicId(); | 978 | summary_id = bean.getTopicId(); |
| 841 | - summary_type = summary_type_parameter(bean.getTopicType()); | 979 | + summary_type = bean.getTopicTypeWord(); |
| 842 | link_url = bean.linkUrl; | 980 | link_url = bean.linkUrl; |
| 981 | + rmhPlatform = bean.getRmhPlatform(); | ||
| 982 | + //所属区域,专题为4 | ||
| 983 | + region_name = "4"; | ||
| 843 | } else if (mPageBean.getChannelInfo() != null) { | 984 | } else if (mPageBean.getChannelInfo() != null) { |
| 844 | content_type = ContentTypeConstant.URL_TYPE_ELEVEN + ""; | 985 | content_type = ContentTypeConstant.URL_TYPE_ELEVEN + ""; |
| 845 | ChannelInfoBean bean = mPageBean.getChannelInfo(); | 986 | ChannelInfoBean bean = mPageBean.getChannelInfo(); |
| 846 | content_id = bean.getChannelId(); | 987 | content_id = bean.getChannelId(); |
| 847 | - content_show_channel_id = bean.getChannelId(); | 988 | + contentShowChannelId = bean.getChannelId(); |
| 989 | + contentShowChannelName = bean.getChannelName(); | ||
| 990 | + region_name = "2"; | ||
| 848 | } | 991 | } |
| 849 | - | ||
| 850 | - region_name = "2"; | ||
| 851 | - | ||
| 852 | } | 992 | } |
| 853 | 993 | ||
| 854 | - // /** | ||
| 855 | - // * 设置页面浏览 | ||
| 856 | - // * | ||
| 857 | - // * @param duration | ||
| 858 | - // */ | ||
| 859 | - // public void setExposure(long duration) { | ||
| 860 | - // setAction(ActionConstants.BROWSE); | ||
| 861 | - // setDuration(duration); | ||
| 862 | - // //当前交互触点(或页面) | ||
| 863 | - // position = page_name + "_" + action; | ||
| 864 | - // } | 994 | + /** |
| 995 | + * 设置页面浏览 | ||
| 996 | + * | ||
| 997 | + * @param duration | ||
| 998 | + */ | ||
| 999 | + public void setExposure(long duration) { | ||
| 1000 | + setAction(ActionConstants.BROWSE); | ||
| 1001 | + setDuration(duration); | ||
| 1002 | + //当前交互触点(或页面) | ||
| 1003 | + position = page_name + "_" + action; | ||
| 1004 | + } | ||
| 865 | 1005 | ||
| 866 | /** | 1006 | /** |
| 867 | * 专题类型 | 1007 | * 专题类型 |
| @@ -870,113 +1010,106 @@ public class TrackContentBean extends BaseBean { | @@ -870,113 +1010,106 @@ public class TrackContentBean extends BaseBean { | ||
| 870 | * @return | 1010 | * @return |
| 871 | */ | 1011 | */ |
| 872 | private String summary_type_parameter(int objectLevel) { | 1012 | private String summary_type_parameter(int objectLevel) { |
| 873 | - String type = null; | ||
| 874 | - if (ContentTypeConstant.SUBJECT_TOPICTYPE_21 == objectLevel) { | ||
| 875 | - // 文章专题 | ||
| 876 | - type = "articleTopic"; | ||
| 877 | - } else if (ContentTypeConstant.SUBJECT_TOPICTYPE_22 == objectLevel) { | ||
| 878 | - // 音频专题 | ||
| 879 | - type = "audioTopic"; | ||
| 880 | - } else if (ContentTypeConstant.SUBJECT_TOPICTYPE_23 == objectLevel) { | ||
| 881 | - // 直播专题 | ||
| 882 | - type = "liveTopic"; | ||
| 883 | - } else if (ContentTypeConstant.SUBJECT_TOPICTYPE_24 == objectLevel) { | ||
| 884 | - // 话题专题 | ||
| 885 | - type = "talkTopic"; | ||
| 886 | - } else if (ContentTypeConstant.SUBJECT_TOPICTYPE_25 == objectLevel) { | ||
| 887 | - // 早晚报专题 | ||
| 888 | - type = "morningAndEveningNewsTopic"; | ||
| 889 | - } else if (ContentTypeConstant.SUBJECT_TOPICTYPE_26 == objectLevel) { | ||
| 890 | - type = "timeAxisTopic"; | 1013 | + |
| 1014 | + // 文章、音频、直播、 话题、早晚报、时间轴 | ||
| 1015 | + if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_21) { | ||
| 1016 | + specialType = SummaryTypeConstants.ARTICLE_TOPIC; | ||
| 1017 | + } else if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_22) { | ||
| 1018 | + specialType = SummaryTypeConstants.AUDIO_TOPIC; | ||
| 1019 | + } else if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_23) { | ||
| 1020 | + specialType = SummaryTypeConstants.LIVE_TOPIC; | ||
| 1021 | + } else if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_24) { | ||
| 1022 | + specialType = SummaryTypeConstants.TALK_TOPIC; | ||
| 1023 | + } else if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_25) { | ||
| 1024 | + specialType = SummaryTypeConstants.MORNING_AND_EVENING_NEWS_TOPIC; | ||
| 1025 | + } else if (objectLevel == ContentTypeConstant.SUBJECT_TOPICTYPE_26) { | ||
| 1026 | + specialType = SummaryTypeConstants.TIME_AXIS_TOPIC; | ||
| 891 | } | 1027 | } |
| 892 | - return type; | ||
| 893 | - } | ||
| 894 | - | ||
| 895 | - // /** | ||
| 896 | - // * 曝光或者点击 | ||
| 897 | - // * | ||
| 898 | - // * @param isClick true:点击;false:曝光 | ||
| 899 | - // */ | ||
| 900 | - // public void exporeOrClick(boolean isClick) { | ||
| 901 | - // | ||
| 902 | - // if (isClick) { | ||
| 903 | - // setAction(ActionConstants.DETAIL_PAGE_SHOW); | ||
| 904 | - // } else { | ||
| 905 | - // setAction(ActionConstants.SHOW); | ||
| 906 | - // } | ||
| 907 | - // //当前交互触点(或页面) | ||
| 908 | - // position = page_name + "_" + action; | ||
| 909 | - // } | ||
| 910 | - // | ||
| 911 | - // | ||
| 912 | - // public void interestCardAction(boolean isClose){ | ||
| 913 | - // if(isClose){ | ||
| 914 | - // setAction(ActionConstants.CLOSEINTERESTCARD); | ||
| 915 | - // }else { | ||
| 916 | - // setAction(ActionConstants.SELECTINTERESTCARD); | ||
| 917 | - // } | ||
| 918 | - // | ||
| 919 | - // position = page_name + "_" + action; | ||
| 920 | - // } | ||
| 921 | - // | ||
| 922 | - // /** | ||
| 923 | - // * 喜欢事件action | ||
| 924 | - // * | ||
| 925 | - // * @param isLike true:喜欢;false:不喜欢 | ||
| 926 | - // */ | ||
| 927 | - // public void likeAction(boolean isLike) { | ||
| 928 | - // if (isLike) { | ||
| 929 | - // setAction(ActionConstants.LIKE); | ||
| 930 | - // } else { | ||
| 931 | - // setAction(ActionConstants.DIS_LIKE); | ||
| 932 | - // } | ||
| 933 | - // //当前交互触点(或页面) | ||
| 934 | - // position = page_name + "_" + action; | ||
| 935 | - // } | ||
| 936 | - // | ||
| 937 | - // /** | ||
| 938 | - // * 收藏事件action | ||
| 939 | - // * | ||
| 940 | - // * @param isCollect true:收藏;false:取消 | ||
| 941 | - // */ | ||
| 942 | - // public void collectAction(boolean isCollect) { | ||
| 943 | - // if (isCollect) { | ||
| 944 | - // action = ActionConstants.COLLECT; | ||
| 945 | - // } else { | ||
| 946 | - // action = ActionConstants.UN_COLLECT; | ||
| 947 | - // } | ||
| 948 | - // position = page_name + "_" + action; | ||
| 949 | - // } | ||
| 950 | - // | ||
| 951 | - // /** | ||
| 952 | - // * 评论 action | ||
| 953 | - // */ | ||
| 954 | - // public void commentAction() { | ||
| 955 | - // action = ActionConstants.COMMENT; | ||
| 956 | - // position = page_name + "_" + action; | ||
| 957 | - // } | ||
| 958 | - // | ||
| 959 | - // /** | ||
| 960 | - // * 关注 action | ||
| 961 | - // */ | ||
| 962 | - // public void followAction(boolean isFollow) { | ||
| 963 | - // if (isFollow) { | ||
| 964 | - // action = ActionConstants.FOLLOW; | ||
| 965 | - // } else { | ||
| 966 | - // action = ActionConstants.UN_FOLLOW; | ||
| 967 | - // } | ||
| 968 | - // position = page_name + "_" + action; | ||
| 969 | - // } | ||
| 970 | - // | ||
| 971 | - // /** | ||
| 972 | - // * 分享action | ||
| 973 | - // */ | ||
| 974 | - // public void shareAction() { | ||
| 975 | - // action = ActionConstants.SHARE; | ||
| 976 | - // position = page_name + "_" + action; | ||
| 977 | - // } | ||
| 978 | - | ||
| 979 | - private static boolean isBlank(String value) { | ||
| 980 | - return null == value || 0 == value.length() || "".equals(value.trim()); | 1028 | + return specialType; |
| 1029 | + } | ||
| 1030 | + | ||
| 1031 | + | ||
| 1032 | + /** | ||
| 1033 | + * 曝光或者点击 | ||
| 1034 | + * | ||
| 1035 | + * @param isClick true:点击;false:曝光 | ||
| 1036 | + */ | ||
| 1037 | + public void exporeOrClick(boolean isClick) { | ||
| 1038 | + | ||
| 1039 | + if (isClick) { | ||
| 1040 | + setAction(ActionConstants.DETAIL_PAGE_SHOW); | ||
| 1041 | + } else { | ||
| 1042 | + setAction(ActionConstants.SHOW); | ||
| 1043 | + } | ||
| 1044 | + //当前交互触点(或页面) | ||
| 1045 | + position = page_name + "_" + action; | ||
| 1046 | + } | ||
| 1047 | + | ||
| 1048 | + | ||
| 1049 | + public void interestCardAction(boolean isClose) { | ||
| 1050 | + if (isClose) { | ||
| 1051 | + setAction(ActionConstants.CLOSEINTERESTCARD); | ||
| 1052 | + } else { | ||
| 1053 | + setAction(ActionConstants.SELECTINTERESTCARD); | ||
| 1054 | + } | ||
| 1055 | + | ||
| 1056 | + position = page_name + "_" + action; | ||
| 1057 | + } | ||
| 1058 | + | ||
| 1059 | + /** | ||
| 1060 | + * 喜欢事件action | ||
| 1061 | + * | ||
| 1062 | + * @param isLike true:喜欢;false:不喜欢 | ||
| 1063 | + */ | ||
| 1064 | + public void likeAction(boolean isLike) { | ||
| 1065 | + if (isLike) { | ||
| 1066 | + setAction(ActionConstants.LIKE); | ||
| 1067 | + } else { | ||
| 1068 | + setAction(ActionConstants.DIS_LIKE); | ||
| 1069 | + } | ||
| 1070 | + //当前交互触点(或页面) | ||
| 1071 | + position = page_name + "_" + action; | ||
| 1072 | + } | ||
| 1073 | + | ||
| 1074 | + /** | ||
| 1075 | + * 收藏事件action | ||
| 1076 | + * | ||
| 1077 | + * @param isCollect true:收藏;false:取消 | ||
| 1078 | + */ | ||
| 1079 | + public void collectAction(boolean isCollect) { | ||
| 1080 | + if (isCollect) { | ||
| 1081 | + action = ActionConstants.COLLECT; | ||
| 1082 | + } else { | ||
| 1083 | + action = ActionConstants.UN_COLLECT; | ||
| 1084 | + } | ||
| 1085 | + position = page_name + "_" + action; | ||
| 1086 | + } | ||
| 1087 | + | ||
| 1088 | + /** | ||
| 1089 | + * 评论 action | ||
| 1090 | + */ | ||
| 1091 | + public void commentAction() { | ||
| 1092 | + action = ActionConstants.COMMENT; | ||
| 1093 | + position = page_name + "_" + action; | ||
| 1094 | + } | ||
| 1095 | + | ||
| 1096 | + /** | ||
| 1097 | + * 关注 action | ||
| 1098 | + */ | ||
| 1099 | + public void followAction(boolean isFollow) { | ||
| 1100 | + if (isFollow) { | ||
| 1101 | + action = ActionConstants.FOLLOW; | ||
| 1102 | + } else { | ||
| 1103 | + action = ActionConstants.UN_FOLLOW; | ||
| 1104 | + } | ||
| 1105 | + position = page_name + "_" + action; | ||
| 1106 | + } | ||
| 1107 | + | ||
| 1108 | + /** | ||
| 1109 | + * 分享action | ||
| 1110 | + */ | ||
| 1111 | + public void shareAction() { | ||
| 1112 | + action = ActionConstants.SHARE; | ||
| 1113 | + position = page_name + "_" + action; | ||
| 981 | } | 1114 | } |
| 982 | } | 1115 | } |
| 1 | package com.wd.foundation.bean.custom.act; | 1 | package com.wd.foundation.bean.custom.act; |
| 2 | 2 | ||
| 3 | +import android.text.TextUtils; | ||
| 4 | + | ||
| 3 | import com.wd.foundation.bean.base.BaseBean; | 5 | import com.wd.foundation.bean.base.BaseBean; |
| 6 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 7 | + | ||
| 4 | 8 | ||
| 5 | /** | 9 | /** |
| 6 | * @Description: 基本活动信息类 | 10 | * @Description: 基本活动信息类 |
| @@ -18,6 +22,13 @@ public class BaseActivityBean extends BaseBean { | @@ -18,6 +22,13 @@ public class BaseActivityBean extends BaseBean { | ||
| 18 | 22 | ||
| 19 | /** | 23 | /** |
| 20 | * 活动类型 | 24 | * 活动类型 |
| 25 | + * collect 征集活动 | ||
| 26 | + * new_collect 征集活动 | ||
| 27 | + * raffle 抽奖活动 | ||
| 28 | + * vote 投票活动 | ||
| 29 | + * answer 答题活动 | ||
| 30 | + * top 榜单活动 | ||
| 31 | + * 后面有调整再说 | ||
| 21 | */ | 32 | */ |
| 22 | private String activityType; | 33 | private String activityType; |
| 23 | 34 | ||
| @@ -32,7 +43,7 @@ public class BaseActivityBean extends BaseBean { | @@ -32,7 +43,7 @@ public class BaseActivityBean extends BaseBean { | ||
| 32 | private String activityTitle; | 43 | private String activityTitle; |
| 33 | 44 | ||
| 34 | /** | 45 | /** |
| 35 | - * 活动开始时间戳 | 46 | + * 活动开始时间戳 |
| 36 | */ | 47 | */ |
| 37 | private long startTime; | 48 | private long startTime; |
| 38 | 49 | ||
| @@ -60,6 +71,50 @@ public class BaseActivityBean extends BaseBean { | @@ -60,6 +71,50 @@ public class BaseActivityBean extends BaseBean { | ||
| 60 | * 运营图片地址 | 71 | * 运营图片地址 |
| 61 | */ | 72 | */ |
| 62 | private String coverUrl; | 73 | private String coverUrl; |
| 74 | + /** | ||
| 75 | + * 标题前面的标签 | ||
| 76 | + */ | ||
| 77 | + public String localFieldActivityLabelName; | ||
| 78 | + /** | ||
| 79 | + * 标签渐变色左边颜色 | ||
| 80 | + */ | ||
| 81 | + public String localFieldBackgroundColor1; | ||
| 82 | + /** | ||
| 83 | + * 标签渐变色右边颜色 | ||
| 84 | + */ | ||
| 85 | + public String localFieldBackgroundColor2; | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 参加人数 | ||
| 89 | + */ | ||
| 90 | + private String person; | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * | ||
| 94 | + * @param activityType collect 征集活动 new_collect 征集活动 | ||
| 95 | + * raffle 抽奖活动 | ||
| 96 | + * vote 投票活动 | ||
| 97 | + * answer 答题活动 | ||
| 98 | + * top 榜单活动 | ||
| 99 | + * @return | ||
| 100 | + */ | ||
| 101 | + public int[] getActivityLabelNameColors(String activityType) { | ||
| 102 | + int[] colors; | ||
| 103 | + if(StringUtils.isEqual("raffle",activityType)){ | ||
| 104 | + //raffle-抽奖活动 | ||
| 105 | + colors = new int[]{0xFF79C888,0xFF51B189}; | ||
| 106 | + }else if(StringUtils.isEqual("answer",activityType)){ | ||
| 107 | + //answer-答题活动 | ||
| 108 | + colors = new int[]{0xFF4AB5F8,0xFF477AF0}; | ||
| 109 | + }else if(StringUtils.isEqual("vote",activityType)){ | ||
| 110 | + //vote-投票活动 | ||
| 111 | + colors = new int[]{0xFFF8AC4A,0xFFF07E47}; | ||
| 112 | + }else { | ||
| 113 | + //其他-征稿活动 | ||
| 114 | + colors = new int[]{0xFFFE6A00,0xFFFF2B00}; | ||
| 115 | + } | ||
| 116 | + return colors; | ||
| 117 | + } | ||
| 63 | 118 | ||
| 64 | public String getActivityId() { | 119 | public String getActivityId() { |
| 65 | return activityId; | 120 | return activityId; |
| @@ -143,18 +198,54 @@ public class BaseActivityBean extends BaseBean { | @@ -143,18 +198,54 @@ public class BaseActivityBean extends BaseBean { | ||
| 143 | 198 | ||
| 144 | /** | 199 | /** |
| 145 | * 检查活动状态 | 200 | * 检查活动状态 |
| 201 | + * | ||
| 146 | * @param serverTime | 202 | * @param serverTime |
| 147 | * @return 0:未开始;2:已结束;1:进行中 | 203 | * @return 0:未开始;2:已结束;1:进行中 |
| 148 | */ | 204 | */ |
| 149 | - public int checkActivityStatus(long serverTime){ | 205 | + public int checkActivityStatus(long serverTime) { |
| 150 | 206 | ||
| 151 | - if(serverTime < startTime){ | 207 | + if (serverTime < startTime) { |
| 152 | return 0; | 208 | return 0; |
| 153 | - }else if(serverTime > endTime){ | 209 | + } else if (serverTime > endTime) { |
| 154 | return 2; | 210 | return 2; |
| 155 | - }else { | 211 | + } else { |
| 156 | return 1; | 212 | return 1; |
| 157 | } | 213 | } |
| 158 | 214 | ||
| 159 | } | 215 | } |
| 216 | + | ||
| 217 | + /** | ||
| 218 | + * 转换活动类型 | ||
| 219 | + */ | ||
| 220 | + public void activityTypeToLabelName() { | ||
| 221 | + | ||
| 222 | + if (TextUtils.isEmpty(activityType)) { | ||
| 223 | + localFieldActivityLabelName = null; | ||
| 224 | + } else { | ||
| 225 | + | ||
| 226 | +// if ("collect".equals(activityType) || "new_collect".equals(activityType)) { | ||
| 227 | +// localFieldActivityLabelName = ResUtils.getString(R.string.activity_type_collect); | ||
| 228 | +// } else if ("raffle".equals(activityType)) { | ||
| 229 | +// localFieldActivityLabelName = ResUtils.getString(R.string.activity_type_choujiang); | ||
| 230 | +// } else if ("vote".equals(activityType)) { | ||
| 231 | +// localFieldActivityLabelName = ResUtils.getString(R.string.activity_type_vote); | ||
| 232 | +// } else if ("answer".equals(activityType)) { | ||
| 233 | +// localFieldActivityLabelName = ResUtils.getString(R.string.activity_type_dati); | ||
| 234 | +// } else if ("top".equals(activityType)) { | ||
| 235 | +// localFieldActivityLabelName = ResUtils.getString(R.string.activity_type_bang); | ||
| 236 | +// } else { | ||
| 237 | +// localFieldActivityLabelName = null; | ||
| 238 | +// } | ||
| 239 | + | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + public String getPerson() { | ||
| 245 | + return person; | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + public void setPerson(String person) { | ||
| 249 | + this.person = person; | ||
| 250 | + } | ||
| 160 | } | 251 | } |
| 1 | - | ||
| 2 | package com.wd.foundation.bean.custom.comp; | 1 | package com.wd.foundation.bean.custom.comp; |
| 3 | 2 | ||
| 4 | -import java.util.List; | ||
| 5 | 3 | ||
| 6 | import com.wd.foundation.bean.base.BaseBean; | 4 | import com.wd.foundation.bean.base.BaseBean; |
| 7 | import com.wd.foundation.bean.custom.content.ContentBean; | 5 | import com.wd.foundation.bean.custom.content.ContentBean; |
| 8 | 6 | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | /** | 9 | /** |
| 10 | * @Description: 组件多tab的业务数据 | 10 | * @Description: 组件多tab的业务数据 |
| 11 | * @Author: Li Yubing | 11 | * @Author: Li Yubing |
| @@ -19,6 +19,9 @@ public class TabContentBean extends BaseBean { | @@ -19,6 +19,9 @@ public class TabContentBean extends BaseBean { | ||
| 19 | 19 | ||
| 20 | private String tabName; | 20 | private String tabName; |
| 21 | 21 | ||
| 22 | + //类型:1金刚卡样式,2列表样式 | ||
| 23 | + public int tabStyle; | ||
| 24 | + | ||
| 22 | private List<ContentBean> operDataList; | 25 | private List<ContentBean> operDataList; |
| 23 | 26 | ||
| 24 | public int getTabId() { | 27 | public int getTabId() { |
| 1 | - | ||
| 2 | package com.wd.foundation.bean.custom.comp; | 1 | package com.wd.foundation.bean.custom.comp; |
| 3 | 2 | ||
| 4 | -import java.util.List; | ||
| 5 | - | 3 | +import com.wd.foundation.bean.analytics.SummaryTypeConstants; |
| 6 | import com.wd.foundation.bean.base.BaseBean; | 4 | import com.wd.foundation.bean.base.BaseBean; |
| 7 | import com.wd.foundation.bean.custom.content.ContentBean; | 5 | import com.wd.foundation.bean.custom.content.ContentBean; |
| 6 | +import com.wd.foundation.bean.custom.content.ContentTypeConstant; | ||
| 8 | import com.wd.foundation.bean.custom.vote.VoteBean; | 7 | import com.wd.foundation.bean.custom.vote.VoteBean; |
| 8 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 9 | + | ||
| 10 | +import java.util.List; | ||
| 9 | 11 | ||
| 10 | /** | 12 | /** |
| 11 | * 专题页面专题信息 | 13 | * 专题页面专题信息 |
| @@ -22,6 +24,11 @@ public class TopicInfoBean extends BaseBean { | @@ -22,6 +24,11 @@ public class TopicInfoBean extends BaseBean { | ||
| 22 | private String backgroundImgUrl; | 24 | private String backgroundImgUrl; |
| 23 | 25 | ||
| 24 | /** | 26 | /** |
| 27 | + * 背景颜色 | ||
| 28 | + */ | ||
| 29 | + private String backgroundColor; | ||
| 30 | + | ||
| 31 | + /** | ||
| 25 | * 分享标题 | 32 | * 分享标题 |
| 26 | */ | 33 | */ |
| 27 | private String shareTitle; | 34 | private String shareTitle; |
| @@ -59,7 +66,7 @@ public class TopicInfoBean extends BaseBean { | @@ -59,7 +66,7 @@ public class TopicInfoBean extends BaseBean { | ||
| 59 | /** | 66 | /** |
| 60 | * 迭代二:早晚报类型;1-早报;2-午报;3-晚报 | 67 | * 迭代二:早晚报类型;1-早报;2-午报;3-晚报 |
| 61 | */ | 68 | */ |
| 62 | - private int topicPattern; | 69 | + private int topicPattern; |
| 63 | 70 | ||
| 64 | /** | 71 | /** |
| 65 | * 专题标题 | 72 | * 专题标题 |
| @@ -76,6 +83,7 @@ public class TopicInfoBean extends BaseBean { | @@ -76,6 +83,7 @@ public class TopicInfoBean extends BaseBean { | ||
| 76 | */ | 83 | */ |
| 77 | private String shareOpen = "1"; | 84 | private String shareOpen = "1"; |
| 78 | 85 | ||
| 86 | + | ||
| 79 | /** | 87 | /** |
| 80 | * 评论开关0:关闭,1:开启 | 88 | * 评论开关0:关闭,1:开启 |
| 81 | */ | 89 | */ |
| @@ -87,7 +95,7 @@ public class TopicInfoBean extends BaseBean { | @@ -87,7 +95,7 @@ public class TopicInfoBean extends BaseBean { | ||
| 87 | private int commentShowFlag; | 95 | private int commentShowFlag; |
| 88 | 96 | ||
| 89 | /** | 97 | /** |
| 90 | - * 评论预显开关 0:关闭,1:开启 | 98 | + * 评论预显开关 0:关闭,1:开启 |
| 91 | */ | 99 | */ |
| 92 | private int commentPreviewFlag; | 100 | private int commentPreviewFlag; |
| 93 | 101 | ||
| @@ -123,22 +131,20 @@ public class TopicInfoBean extends BaseBean { | @@ -123,22 +131,20 @@ public class TopicInfoBean extends BaseBean { | ||
| 123 | 131 | ||
| 124 | /** | 132 | /** |
| 125 | * 播放量 | 133 | * 播放量 |
| 126 | - */ | ||
| 127 | - private String viewsCnt; | 134 | + * */ |
| 135 | + private String viewsCnt; | ||
| 128 | 136 | ||
| 129 | - public String linkUrl; | 137 | + public String linkUrl; |
| 130 | 138 | ||
| 131 | - private String titleName; | ||
| 132 | 139 | ||
| 140 | + private String titleName; | ||
| 133 | private String localPageId; | 141 | private String localPageId; |
| 134 | - | ||
| 135 | private String localPageName; | 142 | private String localPageName; |
| 136 | 143 | ||
| 137 | /** | 144 | /** |
| 138 | * 评论用 | 145 | * 评论用 |
| 139 | */ | 146 | */ |
| 140 | private String relObjectId; | 147 | private String relObjectId; |
| 141 | - | ||
| 142 | /** | 148 | /** |
| 143 | * 分享海报图片 | 149 | * 分享海报图片 |
| 144 | */ | 150 | */ |
| @@ -147,7 +153,6 @@ public class TopicInfoBean extends BaseBean { | @@ -147,7 +153,6 @@ public class TopicInfoBean extends BaseBean { | ||
| 147 | private String sharePosterOpen; | 153 | private String sharePosterOpen; |
| 148 | 154 | ||
| 149 | private int rmhPlatform = 0; | 155 | private int rmhPlatform = 0; |
| 150 | - | ||
| 151 | /** | 156 | /** |
| 152 | * 收藏状态 0否,1已收藏 | 157 | * 收藏状态 0否,1已收藏 |
| 153 | */ | 158 | */ |
| @@ -156,6 +161,16 @@ public class TopicInfoBean extends BaseBean { | @@ -156,6 +161,16 @@ public class TopicInfoBean extends BaseBean { | ||
| 156 | // 本地字段 --》分享页面需要展示的数据 | 161 | // 本地字段 --》分享页面需要展示的数据 |
| 157 | private List<ContentBean> shareContentList; | 162 | private List<ContentBean> shareContentList; |
| 158 | 163 | ||
| 164 | + /** | ||
| 165 | + * 游客评论开关:visitorComment 1:打开;0:关闭 | ||
| 166 | + */ | ||
| 167 | + private String visitorComment; | ||
| 168 | + | ||
| 169 | + /** | ||
| 170 | + * 是否使用CMS配置的整张图 1不使用? | ||
| 171 | + */ | ||
| 172 | + private int sharePosterStyle; | ||
| 173 | + | ||
| 159 | public String getViewsCnt() { | 174 | public String getViewsCnt() { |
| 160 | return viewsCnt; | 175 | return viewsCnt; |
| 161 | } | 176 | } |
| @@ -188,6 +203,7 @@ public class TopicInfoBean extends BaseBean { | @@ -188,6 +203,7 @@ public class TopicInfoBean extends BaseBean { | ||
| 188 | this.titleName = titleName; | 203 | this.titleName = titleName; |
| 189 | } | 204 | } |
| 190 | 205 | ||
| 206 | + | ||
| 191 | public String getShareTitle() { | 207 | public String getShareTitle() { |
| 192 | return shareTitle; | 208 | return shareTitle; |
| 193 | } | 209 | } |
| @@ -220,6 +236,7 @@ public class TopicInfoBean extends BaseBean { | @@ -220,6 +236,7 @@ public class TopicInfoBean extends BaseBean { | ||
| 220 | this.shareUrl = shareUrl; | 236 | this.shareUrl = shareUrl; |
| 221 | } | 237 | } |
| 222 | 238 | ||
| 239 | + | ||
| 223 | public String getSummary() { | 240 | public String getSummary() { |
| 224 | return summary; | 241 | return summary; |
| 225 | } | 242 | } |
| @@ -244,6 +261,15 @@ public class TopicInfoBean extends BaseBean { | @@ -244,6 +261,15 @@ public class TopicInfoBean extends BaseBean { | ||
| 244 | this.voteInfo = voteInfo; | 261 | this.voteInfo = voteInfo; |
| 245 | } | 262 | } |
| 246 | 263 | ||
| 264 | + | ||
| 265 | + public int getSharePosterStyle() { | ||
| 266 | + return sharePosterStyle; | ||
| 267 | + } | ||
| 268 | + | ||
| 269 | + public void setSharePosterStyle(int sharePosterStyle) { | ||
| 270 | + this.sharePosterStyle = sharePosterStyle; | ||
| 271 | + } | ||
| 272 | + | ||
| 247 | public String getLocalPageId() { | 273 | public String getLocalPageId() { |
| 248 | return localPageId; | 274 | return localPageId; |
| 249 | } | 275 | } |
| @@ -348,8 +374,8 @@ public class TopicInfoBean extends BaseBean { | @@ -348,8 +374,8 @@ public class TopicInfoBean extends BaseBean { | ||
| 348 | this.frontLinkObject = frontLinkObject; | 374 | this.frontLinkObject = frontLinkObject; |
| 349 | } | 375 | } |
| 350 | 376 | ||
| 351 | - public boolean isOpenHeadView() { | ||
| 352 | - return frontFlag == 1; | 377 | + public boolean isOpenHeadView(){ |
| 378 | + return frontFlag == 1; | ||
| 353 | } | 379 | } |
| 354 | 380 | ||
| 355 | public String getRelObjectId() { | 381 | public String getRelObjectId() { |
| @@ -400,6 +426,14 @@ public class TopicInfoBean extends BaseBean { | @@ -400,6 +426,14 @@ public class TopicInfoBean extends BaseBean { | ||
| 400 | this.backgroundImgUrl = backgroundImgUrl; | 426 | this.backgroundImgUrl = backgroundImgUrl; |
| 401 | } | 427 | } |
| 402 | 428 | ||
| 429 | + public String getBackgroundColor() { | ||
| 430 | + return backgroundColor; | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + public void setBackgroundColor(String backgroundColor) { | ||
| 434 | + this.backgroundColor = backgroundColor; | ||
| 435 | + } | ||
| 436 | + | ||
| 403 | public int getCollectStatus() { | 437 | public int getCollectStatus() { |
| 404 | return collectStatus; | 438 | return collectStatus; |
| 405 | } | 439 | } |
| @@ -407,4 +441,32 @@ public class TopicInfoBean extends BaseBean { | @@ -407,4 +441,32 @@ public class TopicInfoBean extends BaseBean { | ||
| 407 | public void setCollectStatus(int collectStatus) { | 441 | public void setCollectStatus(int collectStatus) { |
| 408 | this.collectStatus = collectStatus; | 442 | this.collectStatus = collectStatus; |
| 409 | } | 443 | } |
| 444 | + | ||
| 445 | + public int getVisitorComment() { | ||
| 446 | + return StringUtils.isEqual("1",visitorComment) ? 1 : 0; | ||
| 447 | + } | ||
| 448 | + | ||
| 449 | + public void setVisitorComment(String visitorComment) { | ||
| 450 | + this.visitorComment = visitorComment; | ||
| 451 | + } | ||
| 452 | + | ||
| 453 | + /** | ||
| 454 | + * //专题类型 21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | ||
| 455 | + * */ | ||
| 456 | + public String getTopicTypeWord(){ | ||
| 457 | + if(ContentTypeConstant.SUBJECT_TOPICTYPE_21 == topicType){ | ||
| 458 | + return SummaryTypeConstants.ARTICLE_TOPIC; | ||
| 459 | + }else if(ContentTypeConstant.SUBJECT_TOPICTYPE_22 == topicType){ | ||
| 460 | + return SummaryTypeConstants.AUDIO_TOPIC; | ||
| 461 | + }else if(ContentTypeConstant.SUBJECT_TOPICTYPE_23 == topicType){ | ||
| 462 | + return SummaryTypeConstants.LIVE_TOPIC; | ||
| 463 | + }else if(ContentTypeConstant.SUBJECT_TOPICTYPE_24 == topicType){ | ||
| 464 | + return SummaryTypeConstants.TALK_TOPIC; | ||
| 465 | + }else if(ContentTypeConstant.SUBJECT_TOPICTYPE_25 == topicType){ | ||
| 466 | + return SummaryTypeConstants.MORNING_AND_EVENING_NEWS_TOPIC; | ||
| 467 | + }else if(ContentTypeConstant.SUBJECT_TOPICTYPE_26 == topicType){ | ||
| 468 | + return SummaryTypeConstants.TIME_AXIS_TOPIC; | ||
| 469 | + } | ||
| 470 | + return ""; | ||
| 471 | + } | ||
| 410 | } | 472 | } |
| 1 | - | ||
| 2 | package com.wd.foundation.bean.response; | 1 | package com.wd.foundation.bean.response; |
| 3 | 2 | ||
| 4 | -import java.util.ArrayList; | ||
| 5 | -import java.util.List; | ||
| 6 | 3 | ||
| 7 | import android.text.TextUtils; | 4 | import android.text.TextUtils; |
| 8 | 5 | ||
| @@ -15,6 +12,10 @@ import com.wd.foundation.bean.mail.MliveBean; | @@ -15,6 +12,10 @@ import com.wd.foundation.bean.mail.MliveBean; | ||
| 15 | import com.wd.foundation.bean.mail.ShareInfo; | 12 | import com.wd.foundation.bean.mail.ShareInfo; |
| 16 | import com.wd.foundation.bean.mail.VliveBean; | 13 | import com.wd.foundation.bean.mail.VliveBean; |
| 17 | import com.wd.foundation.bean.pop.PopUpsBean; | 14 | import com.wd.foundation.bean.pop.PopUpsBean; |
| 15 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 16 | + | ||
| 17 | +import java.util.ArrayList; | ||
| 18 | +import java.util.List; | ||
| 18 | 19 | ||
| 19 | /** | 20 | /** |
| 20 | * 转化后的直播实体类 | 21 | * 转化后的直播实体类 |
| @@ -22,6 +23,8 @@ import com.wd.foundation.bean.pop.PopUpsBean; | @@ -22,6 +23,8 @@ import com.wd.foundation.bean.pop.PopUpsBean; | ||
| 22 | * @author wondertek | 23 | * @author wondertek |
| 23 | */ | 24 | */ |
| 24 | public class ConvertLiveBean extends BaseBean { | 25 | public class ConvertLiveBean extends BaseBean { |
| 26 | + | ||
| 27 | + | ||
| 25 | /** | 28 | /** |
| 26 | * 内容详情获取,内容详情没有就不传,服务端默认为0 | 29 | * 内容详情获取,内容详情没有就不传,服务端默认为0 |
| 27 | */ | 30 | */ |
| @@ -34,10 +37,20 @@ public class ConvertLiveBean extends BaseBean { | @@ -34,10 +37,20 @@ public class ConvertLiveBean extends BaseBean { | ||
| 34 | 37 | ||
| 35 | /** | 38 | /** |
| 36 | * 封面图 | 39 | * 封面图 |
| 37 | - */ | 40 | + * */ |
| 38 | public String previewPicUrl; | 41 | public String previewPicUrl; |
| 39 | 42 | ||
| 40 | /** | 43 | /** |
| 44 | + * 发布标识,0-cms;1-表示号主发布 2-普通用户 | ||
| 45 | + * 内容详情接口增加字段rmhPlatform,1=人民号发布,已部署。 | ||
| 46 | + * 为1时,需要单独请求,直播流地址接口 | ||
| 47 | + * /zh/c/vlive/pull-stream/{vLiveId} 普通直播获取流地址 | ||
| 48 | + * /zh/c/vlive/pull-stream-list/{liveId} 多路直播获取流地址 | ||
| 49 | + * 返回和视界一样 | ||
| 50 | + * */ | ||
| 51 | + public int rmhPlatform = -1; | ||
| 52 | + | ||
| 53 | + /** | ||
| 41 | * 直播id | 54 | * 直播id |
| 42 | */ | 55 | */ |
| 43 | private String liveId; | 56 | private String liveId; |
| @@ -61,7 +74,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -61,7 +74,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 61 | 74 | ||
| 62 | /** | 75 | /** |
| 63 | * 简介 | 76 | * 简介 |
| 64 | - */ | 77 | + * */ |
| 65 | public String newIntroduction; | 78 | public String newIntroduction; |
| 66 | 79 | ||
| 67 | /** | 80 | /** |
| @@ -94,17 +107,22 @@ public class ConvertLiveBean extends BaseBean { | @@ -94,17 +107,22 @@ public class ConvertLiveBean extends BaseBean { | ||
| 94 | */ | 107 | */ |
| 95 | public String startTime; | 108 | public String startTime; |
| 96 | 109 | ||
| 110 | + /** | ||
| 111 | + * 结束时间 2023-08-28 10:55:42 | ||
| 112 | + */ | ||
| 113 | + public String endTime; | ||
| 114 | + | ||
| 97 | private String mliveId; | 115 | private String mliveId; |
| 98 | 116 | ||
| 99 | private String roomId; | 117 | private String roomId; |
| 100 | 118 | ||
| 101 | /** | 119 | /** |
| 102 | - * 判断 确定1手机直播--竖屏 2推流直播--横屏 3拉流直播--横屏 4电商直播 (竖屏) 5 是播流直播 6 是多路直播 | 120 | + * 判断 确定1手机直播--竖屏 2推流直播--横屏 3拉流直播--横屏 4电商直播 (竖屏) 5 是播流直播 6 是多路直播 |
| 103 | */ | 121 | */ |
| 104 | private int tplId; | 122 | private int tplId; |
| 105 | 123 | ||
| 106 | /** | 124 | /** |
| 107 | - * 1、普通2、VR 为埋点做准备 | 125 | + * 1、普通2、VR 为埋点做准备 |
| 108 | */ | 126 | */ |
| 109 | private String liveStreamType = ""; | 127 | private String liveStreamType = ""; |
| 110 | 128 | ||
| @@ -116,7 +134,6 @@ public class ConvertLiveBean extends BaseBean { | @@ -116,7 +134,6 @@ public class ConvertLiveBean extends BaseBean { | ||
| 116 | /** | 134 | /** |
| 117 | * 直播 创建人id | 135 | * 直播 创建人id |
| 118 | */ | 136 | */ |
| 119 | - | ||
| 120 | private String createUserId; | 137 | private String createUserId; |
| 121 | 138 | ||
| 122 | /** | 139 | /** |
| @@ -135,7 +152,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -135,7 +152,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 135 | private List<PopUpsBean> popUps; | 152 | private List<PopUpsBean> popUps; |
| 136 | 153 | ||
| 137 | /** | 154 | /** |
| 138 | - * 是否有彩蛋 0-无 1-有 | 155 | + * 是否有彩蛋 0-无 1-有 |
| 139 | */ | 156 | */ |
| 140 | private String hasPopUp; | 157 | private String hasPopUp; |
| 141 | 158 | ||
| @@ -160,38 +177,33 @@ public class ConvertLiveBean extends BaseBean { | @@ -160,38 +177,33 @@ public class ConvertLiveBean extends BaseBean { | ||
| 160 | * 直播公告 | 177 | * 直播公告 |
| 161 | */ | 178 | */ |
| 162 | private String notice; | 179 | private String notice; |
| 163 | - | ||
| 164 | - // 是否开启评论 1是 0否 | 180 | + //是否开启评论 1是 0否 |
| 165 | private int openComment; | 181 | private int openComment; |
| 166 | - | ||
| 167 | - // 点赞样式 Love爱心型 thumb点赞手势 pray 祈福 buddha 佛手 | 182 | + //点赞样式 Love爱心型 thumb点赞手势 pray 祈福 buddha 佛手 |
| 168 | private String likesStyle; | 183 | private String likesStyle; |
| 169 | - | ||
| 170 | - // 是否开启点赞 1是 0否 | 184 | + //是否开启点赞 1是 0否 |
| 171 | private int likeEnable; | 185 | private int likeEnable; |
| 172 | - | ||
| 173 | - // 内容预评论显示开关;1显示 0隐藏 | 186 | + //内容预评论显示开关;1显示 0隐藏 |
| 174 | private int preCommentFlag; | 187 | private int preCommentFlag; |
| 175 | - | ||
| 176 | - // 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊 | 188 | + //直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊 |
| 177 | private int liveStyle; | 189 | private int liveStyle; |
| 178 | - | ||
| 179 | - // 背景样式 0-蓝色 1-红色 2-黑色 | 190 | + //背景样式 0-蓝色 1-红色 2-黑色 |
| 180 | private int backgroundStyle; | 191 | private int backgroundStyle; |
| 181 | - | ||
| 182 | // 直播类型 0-视频直播,1-文字直播 | 192 | // 直播类型 0-视频直播,1-文字直播 |
| 183 | private int liveWay; | 193 | private int liveWay; |
| 184 | - | ||
| 185 | - // 是否开启挂角 true:开启 false:关闭 | 194 | + //是否开启挂角 true:开启 false:关闭 |
| 186 | private boolean handAngleSwitch; | 195 | private boolean handAngleSwitch; |
| 187 | - | ||
| 188 | - // 挂角图片url | 196 | + //挂角图片url |
| 189 | private String handAngleImageUri; | 197 | private String handAngleImageUri; |
| 190 | - | ||
| 191 | - // 挂角链接 | 198 | + //挂角链接 |
| 192 | private String handAngleLink; | 199 | private String handAngleLink; |
| 193 | 200 | ||
| 194 | /** | 201 | /** |
| 202 | + * 直播点赞状态,true是点赞,false是未点赞 | ||
| 203 | + */ | ||
| 204 | + private boolean isLike; | ||
| 205 | + | ||
| 206 | + /** | ||
| 195 | * 稿件封面图地址【BFF聚合】 | 207 | * 稿件封面图地址【BFF聚合】 |
| 196 | */ | 208 | */ |
| 197 | private List<ManuscriptImageBean> fullColumnImgUrls; | 209 | private List<ManuscriptImageBean> fullColumnImgUrls; |
| @@ -204,30 +216,43 @@ public class ConvertLiveBean extends BaseBean { | @@ -204,30 +216,43 @@ public class ConvertLiveBean extends BaseBean { | ||
| 204 | private String TextLiveCover = ""; | 216 | private String TextLiveCover = ""; |
| 205 | 217 | ||
| 206 | /** | 218 | /** |
| 207 | - * 本地数据,人民号直播单个直播流地址 | 219 | + * 迁移老直播id |
| 208 | */ | 220 | */ |
| 209 | - private GetPullAddressBean getPullAddressBean; | 221 | + private String oldNewsId; |
| 210 | 222 | ||
| 211 | /** | 223 | /** |
| 212 | - * 本地数据,人民号直播多个直播流地址 | 224 | + * 新直播id |
| 213 | */ | 225 | */ |
| 226 | + private String newsId; | ||
| 227 | + | ||
| 228 | + | ||
| 229 | + /** | ||
| 230 | + * 本地数据,人民号直播单个直播流地址 | ||
| 231 | + * */ | ||
| 232 | + private GetPullAddressBean getPullAddressBean; | ||
| 233 | + /** | ||
| 234 | + * 本地数据,人民号直播多个直播流地址 | ||
| 235 | + * */ | ||
| 214 | private List<GetPullAddressBean> getPullAddressBeanList; | 236 | private List<GetPullAddressBean> getPullAddressBeanList; |
| 215 | 237 | ||
| 216 | /** | 238 | /** |
| 217 | * 直播背景图的 已经部署到dev了,客户端可以加下 | 239 | * 直播背景图的 已经部署到dev了,客户端可以加下 |
| 218 | - */ | 240 | + * */ |
| 219 | public LiveInfo.BackgroundBean background; | 241 | public LiveInfo.BackgroundBean background; |
| 220 | - | ||
| 221 | /** | 242 | /** |
| 222 | * 1 开启,2 关闭 | 243 | * 1 开启,2 关闭 |
| 223 | */ | 244 | */ |
| 224 | private int bestNoticer = 2; | 245 | private int bestNoticer = 2; |
| 225 | - | ||
| 226 | /** | 246 | /** |
| 227 | * 直播间,当前用户被禁言 | 247 | * 直播间,当前用户被禁言 |
| 228 | */ | 248 | */ |
| 229 | public boolean barrageEnable; | 249 | public boolean barrageEnable; |
| 230 | 250 | ||
| 251 | + /** | ||
| 252 | + * 游客评论开关:visitorComment 1:打开;0:关闭 | ||
| 253 | + */ | ||
| 254 | + private int visitorComment = 0; | ||
| 255 | + | ||
| 231 | private String fromPage; | 256 | private String fromPage; |
| 232 | 257 | ||
| 233 | public String getFromPage() { | 258 | public String getFromPage() { |
| @@ -238,8 +263,17 @@ public class ConvertLiveBean extends BaseBean { | @@ -238,8 +263,17 @@ public class ConvertLiveBean extends BaseBean { | ||
| 238 | this.fromPage = fromPage; | 263 | this.fromPage = fromPage; |
| 239 | } | 264 | } |
| 240 | 265 | ||
| 241 | - public boolean unBarrageAndCanComment() { | ||
| 242 | - return !barrageEnable && openComment == 1; | 266 | + public boolean unBarrageAndCanComment(){ |
| 267 | + //禁言 ,评论关闭,隐藏大家聊 都会不展示评论 | ||
| 268 | + return !barrageEnable && openComment == 1 && 2 != liveStyle; | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + public int getRmhPlatform() { | ||
| 272 | + return rmhPlatform; | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + public void setRmhPlatform(int rmhPlatform) { | ||
| 276 | + this.rmhPlatform = rmhPlatform; | ||
| 243 | } | 277 | } |
| 244 | 278 | ||
| 245 | public List<GetPullAddressBean> getGetPullAddressBeanList() { | 279 | public List<GetPullAddressBean> getGetPullAddressBeanList() { |
| @@ -286,7 +320,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -286,7 +320,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 286 | this.handAngleLink = handAngleLink; | 320 | this.handAngleLink = handAngleLink; |
| 287 | } | 321 | } |
| 288 | 322 | ||
| 289 | - // 处理获取封面地址 | 323 | + //处理获取封面地址 |
| 290 | public String getTextLiveCover() { | 324 | public String getTextLiveCover() { |
| 291 | return TextLiveCover; | 325 | return TextLiveCover; |
| 292 | } | 326 | } |
| @@ -305,10 +339,23 @@ public class ConvertLiveBean extends BaseBean { | @@ -305,10 +339,23 @@ public class ConvertLiveBean extends BaseBean { | ||
| 305 | 339 | ||
| 306 | public void setFullColumnImgUrls(List<ManuscriptImageBean> fullColumnImgUrls) { | 340 | public void setFullColumnImgUrls(List<ManuscriptImageBean> fullColumnImgUrls) { |
| 307 | for (ManuscriptImageBean manuscriptImageBean : fullColumnImgUrls) { | 341 | for (ManuscriptImageBean manuscriptImageBean : fullColumnImgUrls) { |
| 308 | - if (manuscriptImageBean.landscape == 1 && !TextUtils.isEmpty(manuscriptImageBean.url)) { | 342 | + if (manuscriptImageBean.landscape== 1 && !TextUtils.isEmpty(manuscriptImageBean.url)) { |
| 309 | TextLiveCover = manuscriptImageBean.url; | 343 | TextLiveCover = manuscriptImageBean.url; |
| 344 | + break; | ||
| 310 | } | 345 | } |
| 311 | } | 346 | } |
| 347 | + | ||
| 348 | + //如果没有横图,按顺序取第一张有图的地地址 | ||
| 349 | + if(TextUtils.isEmpty(TextLiveCover)){ | ||
| 350 | + for (ManuscriptImageBean manuscriptImageBean : fullColumnImgUrls) { | ||
| 351 | + if (!TextUtils.isEmpty(manuscriptImageBean.url)) { | ||
| 352 | + TextLiveCover = manuscriptImageBean.url; | ||
| 353 | + break; | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + //如果没有横图,取第0第图片 | ||
| 312 | this.fullColumnImgUrls = fullColumnImgUrls; | 359 | this.fullColumnImgUrls = fullColumnImgUrls; |
| 313 | } | 360 | } |
| 314 | 361 | ||
| @@ -392,6 +439,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -392,6 +439,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 392 | this.notice = notice; | 439 | this.notice = notice; |
| 393 | } | 440 | } |
| 394 | 441 | ||
| 442 | + | ||
| 395 | public String getLiveLandScape() { | 443 | public String getLiveLandScape() { |
| 396 | return liveLandScape; | 444 | return liveLandScape; |
| 397 | } | 445 | } |
| @@ -424,6 +472,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -424,6 +472,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 424 | this.rmhInfo = rmhInfo; | 472 | this.rmhInfo = rmhInfo; |
| 425 | } | 473 | } |
| 426 | 474 | ||
| 475 | + | ||
| 427 | public boolean isVrType() { | 476 | public boolean isVrType() { |
| 428 | return vrType; | 477 | return vrType; |
| 429 | } | 478 | } |
| @@ -522,10 +571,10 @@ public class ConvertLiveBean extends BaseBean { | @@ -522,10 +571,10 @@ public class ConvertLiveBean extends BaseBean { | ||
| 522 | } | 571 | } |
| 523 | 572 | ||
| 524 | public String getTitle() { | 573 | public String getTitle() { |
| 525 | - // if (title.length() > 15) { | ||
| 526 | - // title = title.substring(0, 14) + "..."; | ||
| 527 | - // return title; | ||
| 528 | - // } | 574 | +// if (title.length() > 15) { |
| 575 | +// title = title.substring(0, 14) + "..."; | ||
| 576 | +// return title; | ||
| 577 | +// } | ||
| 529 | return title; | 578 | return title; |
| 530 | } | 579 | } |
| 531 | 580 | ||
| @@ -557,6 +606,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -557,6 +606,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 557 | this.previewType = previewType; | 606 | this.previewType = previewType; |
| 558 | } | 607 | } |
| 559 | 608 | ||
| 609 | + | ||
| 560 | public String getPlanStartTime() { | 610 | public String getPlanStartTime() { |
| 561 | return planStartTime; | 611 | return planStartTime; |
| 562 | } | 612 | } |
| @@ -581,6 +631,14 @@ public class ConvertLiveBean extends BaseBean { | @@ -581,6 +631,14 @@ public class ConvertLiveBean extends BaseBean { | ||
| 581 | this.mliveId = mliveId; | 631 | this.mliveId = mliveId; |
| 582 | } | 632 | } |
| 583 | 633 | ||
| 634 | + public void setLiveIsLike(boolean like) { | ||
| 635 | + this.isLike = like; | ||
| 636 | + } | ||
| 637 | + | ||
| 638 | + public boolean getLiveIsLike() { | ||
| 639 | + return this.isLike; | ||
| 640 | + } | ||
| 641 | + | ||
| 584 | public String getRoomId() { | 642 | public String getRoomId() { |
| 585 | return roomId; | 643 | return roomId; |
| 586 | } | 644 | } |
| @@ -597,6 +655,31 @@ public class ConvertLiveBean extends BaseBean { | @@ -597,6 +655,31 @@ public class ConvertLiveBean extends BaseBean { | ||
| 597 | this.liveSourceList = liveSourceList; | 655 | this.liveSourceList = liveSourceList; |
| 598 | } | 656 | } |
| 599 | 657 | ||
| 658 | + public int getVisitorComment() { | ||
| 659 | + return visitorComment; | ||
| 660 | + } | ||
| 661 | + | ||
| 662 | + public void setVisitorComment(int visitorComment) { | ||
| 663 | + this.visitorComment = visitorComment; | ||
| 664 | + } | ||
| 665 | + | ||
| 666 | + public String getOldNewsId() { | ||
| 667 | + return oldNewsId; | ||
| 668 | + } | ||
| 669 | + | ||
| 670 | + public void setOldNewsId(String oldNewsId) { | ||
| 671 | + this.oldNewsId = oldNewsId; | ||
| 672 | + } | ||
| 673 | + | ||
| 674 | + public String getNewsId() { | ||
| 675 | + return newsId; | ||
| 676 | + } | ||
| 677 | + | ||
| 678 | + public void setNewsId(String newsId) { | ||
| 679 | + this.newsId = newsId; | ||
| 680 | + } | ||
| 681 | + | ||
| 682 | + | ||
| 600 | public ConvertLiveBean(String liveId) { | 683 | public ConvertLiveBean(String liveId) { |
| 601 | this.liveId = liveId; | 684 | this.liveId = liveId; |
| 602 | this.contentType = contentType; | 685 | this.contentType = contentType; |
| @@ -621,72 +704,80 @@ public class ConvertLiveBean extends BaseBean { | @@ -621,72 +704,80 @@ public class ConvertLiveBean extends BaseBean { | ||
| 621 | this.vrType = false; | 704 | this.vrType = false; |
| 622 | } | 705 | } |
| 623 | 706 | ||
| 624 | - public ConvertLiveBean(NewsDetailBean mContentBean, LiveInfo mOriginalLiveInfo, String relType, String relId, | ||
| 625 | - String coverUrl) { | 707 | + public ConvertLiveBean(NewsDetailBean mContentBean, LiveInfo mOriginalLiveInfo, String relType, String relId, String coverUrl) { |
| 626 | startTime = mOriginalLiveInfo.getStartTime(); | 708 | startTime = mOriginalLiveInfo.getStartTime(); |
| 709 | + endTime = mOriginalLiveInfo.getEndTime(); | ||
| 710 | + | ||
| 627 | background = mOriginalLiveInfo.getBackground(); | 711 | background = mOriginalLiveInfo.getBackground(); |
| 628 | - // 详情页原始数据 | 712 | + //详情页原始数据 |
| 629 | newsDetailBean = mContentBean; | 713 | newsDetailBean = mContentBean; |
| 630 | ShareInfo shareInfo = mContentBean.getShareInfo(); | 714 | ShareInfo shareInfo = mContentBean.getShareInfo(); |
| 631 | if (shareInfo != null) { | 715 | if (shareInfo != null) { |
| 632 | setShareInfo(shareInfo); | 716 | setShareInfo(shareInfo); |
| 633 | } | 717 | } |
| 718 | + //设置游客是否评论 | ||
| 719 | + setVisitorComment(mContentBean.getVisitorComment()); | ||
| 720 | + //设置迁移老直播id | ||
| 721 | + setOldNewsId(mContentBean.getOldNewsId()); | ||
| 722 | + //设置新直播id | ||
| 723 | + setNewsId(mContentBean.getNewsId()); | ||
| 724 | + | ||
| 634 | setLiveId(mContentBean.getNewsId()); | 725 | setLiveId(mContentBean.getNewsId()); |
| 635 | setContentType(mContentBean.getNewsType()); | 726 | setContentType(mContentBean.getNewsType()); |
| 636 | - // 详情标题 | 727 | + //详情标题 |
| 637 | setTitle(mContentBean.getNewsTitle()); | 728 | setTitle(mContentBean.getNewsTitle()); |
| 638 | setDescription(mContentBean.getNewsSummary()); | 729 | setDescription(mContentBean.getNewsSummary()); |
| 639 | - // 预约直播详情页简介 fixme 待设置简介 | 730 | + //预约直播详情页简介 fixme 待设置简介 |
| 640 | newIntroduction = mContentBean.getNewIntroduction(); | 731 | newIntroduction = mContentBean.getNewIntroduction(); |
| 641 | setRelType(relType); | 732 | setRelType(relType); |
| 642 | setContentRelId(relId); | 733 | setContentRelId(relId); |
| 643 | - // 兼容旧直播间没有这个字段 | ||
| 644 | - if (!isBlank(mOriginalLiveInfo.getTplId())) { | 734 | + //兼容旧直播间没有这个字段 |
| 735 | + if (!StringUtils.isBlank(mOriginalLiveInfo.getTplId())) { | ||
| 645 | setTplId(Integer.valueOf(mOriginalLiveInfo.getTplId())); | 736 | setTplId(Integer.valueOf(mOriginalLiveInfo.getTplId())); |
| 646 | } | 737 | } |
| 647 | - // 兼容旧直播间没有这个字段 | ||
| 648 | - if (!isBlank(mOriginalLiveInfo.getCreateUserId())) { | 738 | + //兼容旧直播间没有这个字段 |
| 739 | + if (!StringUtils.isBlank(mOriginalLiveInfo.getCreateUserId())) { | ||
| 649 | setCreateUserId(mOriginalLiveInfo.getCreateUserId()); | 740 | setCreateUserId(mOriginalLiveInfo.getCreateUserId()); |
| 650 | } | 741 | } |
| 651 | - // 兼容旧直播间没有这个字段 | ||
| 652 | - if (!isBlank(mOriginalLiveInfo.getCreateUserName())) { | 742 | + //兼容旧直播间没有这个字段 |
| 743 | + if (!StringUtils.isBlank(mOriginalLiveInfo.getCreateUserName())) { | ||
| 653 | setCreateUserName(mOriginalLiveInfo.getCreateUserName()); | 744 | setCreateUserName(mOriginalLiveInfo.getCreateUserName()); |
| 654 | } | 745 | } |
| 655 | - // 兼容旧直播间没有这个字段 | ||
| 656 | - if (!isBlank(mOriginalLiveInfo.getPadImageUri())) { | 746 | + //兼容旧直播间没有这个字段 |
| 747 | + if (!StringUtils.isBlank(mOriginalLiveInfo.getPadImageUri())) { | ||
| 657 | setPadImageUri(mOriginalLiveInfo.getPadImageUri()); | 748 | setPadImageUri(mOriginalLiveInfo.getPadImageUri()); |
| 658 | } | 749 | } |
| 659 | - // 兼容旧直播间没有这个字段 彩蛋信息 | ||
| 660 | - if (mContentBean.getPopUps() != null && mContentBean.getPopUps().size() > 0) { | 750 | + //兼容旧直播间没有这个字段 彩蛋信息 |
| 751 | + if (mContentBean.getPopUps() != null && mContentBean.getPopUps().size() >0) { | ||
| 661 | setPopUps(mContentBean.getPopUps()); | 752 | setPopUps(mContentBean.getPopUps()); |
| 662 | } | 753 | } |
| 663 | - // 兼容旧直播间没有这个字段 彩蛋 是否展示 | ||
| 664 | - if (!isBlank(mContentBean.getHasPopUp())) { | 754 | + //兼容旧直播间没有这个字段 彩蛋 是否展示 |
| 755 | + if (!StringUtils.isBlank(mContentBean.getHasPopUp())) { | ||
| 665 | setHasPopUp(mContentBean.getHasPopUp()); | 756 | setHasPopUp(mContentBean.getHasPopUp()); |
| 666 | } | 757 | } |
| 667 | - // 兼容旧直播间没有这个字段 房主信息 | 758 | + //兼容旧直播间没有这个字段 房主信息 |
| 668 | if (mContentBean.getRmhInfo() != null) { | 759 | if (mContentBean.getRmhInfo() != null) { |
| 669 | setRmhInfo(mContentBean.getRmhInfo()); | 760 | setRmhInfo(mContentBean.getRmhInfo()); |
| 670 | } | 761 | } |
| 671 | - // //兼容旧直播间没有这个字段 直播公告 | ||
| 672 | - // if (mContentBean.getLiveInfo() != null && mContentBean.getLiveInfo().getNotice() != null ) { | ||
| 673 | - //// setNotice("直播公告" + mContentBean.getLiveInfo().getNotice()); | ||
| 674 | - // } | ||
| 675 | - // 兼容旧直播间没有这个字段 直播样式 | 762 | +// //兼容旧直播间没有这个字段 直播公告 |
| 763 | +// if (mContentBean.getLiveInfo() != null && mContentBean.getLiveInfo().getNotice() != null ) { | ||
| 764 | +//// setNotice("直播公告" + mContentBean.getLiveInfo().getNotice()); | ||
| 765 | +// } | ||
| 766 | + //兼容旧直播间没有这个字段 直播样式 | ||
| 676 | setLiveStyle(mOriginalLiveInfo.getLiveStyle()); | 767 | setLiveStyle(mOriginalLiveInfo.getLiveStyle()); |
| 677 | - // 兼容旧直播间没有这个字段 直播类型 | 768 | + //兼容旧直播间没有这个字段 直播类型 |
| 678 | setLiveWay(mOriginalLiveInfo.getLiveWay()); | 769 | setLiveWay(mOriginalLiveInfo.getLiveWay()); |
| 679 | - // 兼容旧直播间没有这个字段 背景样式 | 770 | + //兼容旧直播间没有这个字段 背景样式 |
| 680 | setBackgroundStyle(mOriginalLiveInfo.getBackgroundStyle()); | 771 | setBackgroundStyle(mOriginalLiveInfo.getBackgroundStyle()); |
| 681 | setOpenComment(mOriginalLiveInfo.getOpenComment()); | 772 | setOpenComment(mOriginalLiveInfo.getOpenComment()); |
| 682 | setLikesStyle(mOriginalLiveInfo.getLikesStyle()); | 773 | setLikesStyle(mOriginalLiveInfo.getLikesStyle()); |
| 683 | setPreCommentFlag(mOriginalLiveInfo.getPreCommentFlag()); | 774 | setPreCommentFlag(mOriginalLiveInfo.getPreCommentFlag()); |
| 684 | setLikeEnable(mOriginalLiveInfo.getLikeEnable()); | 775 | setLikeEnable(mOriginalLiveInfo.getLikeEnable()); |
| 685 | - // 兼容旧直播间没有这个字段 文字直播用的封面地址 | 776 | + //兼容旧直播间没有这个字段 文字直播用的封面地址 |
| 686 | if (mContentBean.getFullColumnImgUrls() != null && mContentBean.getFullColumnImgUrls().size() > 0) { | 777 | if (mContentBean.getFullColumnImgUrls() != null && mContentBean.getFullColumnImgUrls().size() > 0) { |
| 687 | setFullColumnImgUrls(mContentBean.getFullColumnImgUrls()); | 778 | setFullColumnImgUrls(mContentBean.getFullColumnImgUrls()); |
| 688 | - } else { | ||
| 689 | - if (!TextUtils.isEmpty(coverUrl)) { | 779 | + }else{ |
| 780 | + if(!TextUtils.isEmpty(coverUrl)){ | ||
| 690 | List<ManuscriptImageBean> manuscriptImageBeans = new ArrayList<>(); | 781 | List<ManuscriptImageBean> manuscriptImageBeans = new ArrayList<>(); |
| 691 | ManuscriptImageBean manuscriptImageBean = new ManuscriptImageBean(); | 782 | ManuscriptImageBean manuscriptImageBean = new ManuscriptImageBean(); |
| 692 | manuscriptImageBean.landscape = 1; | 783 | manuscriptImageBean.landscape = 1; |
| @@ -695,7 +786,7 @@ public class ConvertLiveBean extends BaseBean { | @@ -695,7 +786,7 @@ public class ConvertLiveBean extends BaseBean { | ||
| 695 | setFullColumnImgUrls(manuscriptImageBeans); | 786 | setFullColumnImgUrls(manuscriptImageBeans); |
| 696 | } | 787 | } |
| 697 | } | 788 | } |
| 698 | - // 兼容旧直播间没有这个字段 直播 是否Vr 是否展示 | 789 | + //兼容旧直播间没有这个字段 直播 是否Vr 是否展示 |
| 699 | setVrType(mOriginalLiveInfo.getVrType() == 1); | 790 | setVrType(mOriginalLiveInfo.getVrType() == 1); |
| 700 | MliveBean mMliveBean = mOriginalLiveInfo.getMlive(); | 791 | MliveBean mMliveBean = mOriginalLiveInfo.getMlive(); |
| 701 | if (mMliveBean != null) { | 792 | if (mMliveBean != null) { |
| @@ -705,14 +796,13 @@ public class ConvertLiveBean extends BaseBean { | @@ -705,14 +796,13 @@ public class ConvertLiveBean extends BaseBean { | ||
| 705 | } | 796 | } |
| 706 | String liveStatus = getStringValue(mOriginalLiveInfo.getLiveState()); | 797 | String liveStatus = getStringValue(mOriginalLiveInfo.getLiveState()); |
| 707 | setStatus(liveStatus); | 798 | setStatus(liveStatus); |
| 708 | - // 兼容旧直播间没有这个字段 是否开启挂角 true:开启 false:关闭 | 799 | + //兼容旧直播间没有这个字段 是否开启挂角 true:开启 false:关闭 |
| 709 | setHandAngleSwitch(mOriginalLiveInfo.isHandAngleSwitch()); | 800 | setHandAngleSwitch(mOriginalLiveInfo.isHandAngleSwitch()); |
| 710 | - // 兼容旧直播间没有这个字段 挂角图片url | 801 | + //兼容旧直播间没有这个字段 挂角图片url |
| 711 | setHandAngleImageUri(mOriginalLiveInfo.getHandAngleImageUri()); | 802 | setHandAngleImageUri(mOriginalLiveInfo.getHandAngleImageUri()); |
| 712 | - // 兼容旧直播间没有这个字段 挂角链接 | 803 | + //兼容旧直播间没有这个字段 挂角链接 |
| 713 | setHandAngleLink(mOriginalLiveInfo.getHandAngleLink()); | 804 | setHandAngleLink(mOriginalLiveInfo.getHandAngleLink()); |
| 714 | } | 805 | } |
| 715 | - | ||
| 716 | /** | 806 | /** |
| 717 | * 获取字符串字段的值,已做非空判断 | 807 | * 获取字符串字段的值,已做非空判断 |
| 718 | * | 808 | * |
| @@ -726,12 +816,19 @@ public class ConvertLiveBean extends BaseBean { | @@ -726,12 +816,19 @@ public class ConvertLiveBean extends BaseBean { | ||
| 726 | return value; | 816 | return value; |
| 727 | } | 817 | } |
| 728 | } | 818 | } |
| 729 | - | ||
| 730 | /** | 819 | /** |
| 731 | * 判断字符串是否为空或者空字符串 如果字符串是空或空字符串则返回true,否则返回false。也可以使用Android自带的TextUtil | 820 | * 判断字符串是否为空或者空字符串 如果字符串是空或空字符串则返回true,否则返回false。也可以使用Android自带的TextUtil |
| 821 | + * | ||
| 822 | + * @param str | ||
| 823 | + * @return | ||
| 732 | */ | 824 | */ |
| 733 | - private static boolean isBlank(String value) { | ||
| 734 | - return null == value || 0 == value.length() || "".equals(value.trim()); | 825 | + public static boolean isBlank(String str) { |
| 826 | + if (str == null || "".equals(str)) { | ||
| 827 | + return true; | ||
| 828 | + } else { | ||
| 829 | + return false; | ||
| 830 | + } | ||
| 735 | } | 831 | } |
| 736 | 832 | ||
| 833 | + | ||
| 737 | } | 834 | } |
| 1 | - | ||
| 2 | package com.wd.foundation.bean.response; | 1 | package com.wd.foundation.bean.response; |
| 3 | 2 | ||
| 4 | -import java.util.ArrayList; | ||
| 5 | -import java.util.List; | ||
| 6 | 3 | ||
| 4 | +import android.content.pm.ActivityInfo; | ||
| 7 | import android.text.TextUtils; | 5 | import android.text.TextUtils; |
| 8 | 6 | ||
| 7 | + | ||
| 9 | import com.wd.foundation.bean.analytics.LiveTypeConstants; | 8 | import com.wd.foundation.bean.analytics.LiveTypeConstants; |
| 10 | import com.wd.foundation.bean.base.BaseBean; | 9 | import com.wd.foundation.bean.base.BaseBean; |
| 11 | import com.wd.foundation.bean.comment.DisplayWorkInfoBean; | 10 | import com.wd.foundation.bean.comment.DisplayWorkInfoBean; |
| @@ -20,6 +19,10 @@ import com.wd.foundation.bean.mail.ShareInfo; | @@ -20,6 +19,10 @@ import com.wd.foundation.bean.mail.ShareInfo; | ||
| 20 | import com.wd.foundation.bean.mail.VideoInfo; | 19 | import com.wd.foundation.bean.mail.VideoInfo; |
| 21 | import com.wd.foundation.bean.mail.VliveBean; | 20 | import com.wd.foundation.bean.mail.VliveBean; |
| 22 | import com.wd.foundation.bean.pop.PopUpsBean; | 21 | import com.wd.foundation.bean.pop.PopUpsBean; |
| 22 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 23 | + | ||
| 24 | +import java.util.ArrayList; | ||
| 25 | +import java.util.List; | ||
| 23 | 26 | ||
| 24 | /** | 27 | /** |
| 25 | * 新闻内容详情 | 28 | * 新闻内容详情 |
| @@ -63,13 +66,17 @@ public class NewsDetailBean extends BaseBean { | @@ -63,13 +66,17 @@ public class NewsDetailBean extends BaseBean { | ||
| 63 | * app样式 | 66 | * app样式 |
| 64 | */ | 67 | */ |
| 65 | private String appStyle; | 68 | private String appStyle; |
| 66 | - | ||
| 67 | /** | 69 | /** |
| 68 | - * 有的接口返回appstyle | 70 | + * 有的接口返回appstyle |
| 69 | */ | 71 | */ |
| 70 | private String appstyle; | 72 | private String appstyle; |
| 71 | 73 | ||
| 72 | /** | 74 | /** |
| 75 | + * 合集-稿件封面图地址 | ||
| 76 | + */ | ||
| 77 | + private String albumCoverUrl; | ||
| 78 | + | ||
| 79 | + /** | ||
| 73 | * 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 | 80 | * 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 |
| 74 | */ | 81 | */ |
| 75 | private String newsType; | 82 | private String newsType; |
| @@ -78,7 +85,6 @@ public class NewsDetailBean extends BaseBean { | @@ -78,7 +85,6 @@ public class NewsDetailBean extends BaseBean { | ||
| 78 | * 新闻摘要 | 85 | * 新闻摘要 |
| 79 | */ | 86 | */ |
| 80 | private String newsSummary; | 87 | private String newsSummary; |
| 81 | - | ||
| 82 | /** | 88 | /** |
| 83 | * 新闻来源 | 89 | * 新闻来源 |
| 84 | */ | 90 | */ |
| @@ -88,9 +94,6 @@ public class NewsDetailBean extends BaseBean { | @@ -88,9 +94,6 @@ public class NewsDetailBean extends BaseBean { | ||
| 88 | * 新闻来源 | 94 | * 新闻来源 |
| 89 | */ | 95 | */ |
| 90 | private String newsSource; | 96 | private String newsSource; |
| 91 | - | ||
| 92 | - private String newsTags; | ||
| 93 | - | ||
| 94 | /** | 97 | /** |
| 95 | * 图文内容富文本信息 | 98 | * 图文内容富文本信息 |
| 96 | */ | 99 | */ |
| @@ -112,7 +115,7 @@ public class NewsDetailBean extends BaseBean { | @@ -112,7 +115,7 @@ public class NewsDetailBean extends BaseBean { | ||
| 112 | private String audioUrl; | 115 | private String audioUrl; |
| 113 | 116 | ||
| 114 | /** | 117 | /** |
| 115 | - * 是否有彩蛋 0-无 1-有 | 118 | + * 是否有彩蛋 0-无 1-有 |
| 116 | */ | 119 | */ |
| 117 | private String hasPopUp; | 120 | private String hasPopUp; |
| 118 | 121 | ||
| @@ -130,6 +133,10 @@ public class NewsDetailBean extends BaseBean { | @@ -130,6 +133,10 @@ public class NewsDetailBean extends BaseBean { | ||
| 130 | * 分享海报图片 | 133 | * 分享海报图片 |
| 131 | */ | 134 | */ |
| 132 | private String posterUrl; | 135 | private String posterUrl; |
| 136 | + /** | ||
| 137 | + * 视频封面 | ||
| 138 | + */ | ||
| 139 | + private String coverUrl; | ||
| 133 | 140 | ||
| 134 | /** | 141 | /** |
| 135 | * 分享对象 | 142 | * 分享对象 |
| @@ -150,13 +157,11 @@ public class NewsDetailBean extends BaseBean { | @@ -150,13 +157,11 @@ public class NewsDetailBean extends BaseBean { | ||
| 150 | * 直播信息 | 157 | * 直播信息 |
| 151 | */ | 158 | */ |
| 152 | private LiveInfo liveInfo; | 159 | private LiveInfo liveInfo; |
| 153 | - | ||
| 154 | private SerialsInfo serials; | 160 | private SerialsInfo serials; |
| 155 | 161 | ||
| 156 | private PeopleMasterBean peopleAccountInfo; | 162 | private PeopleMasterBean peopleAccountInfo; |
| 157 | 163 | ||
| 158 | private int bottomMargin; | 164 | private int bottomMargin; |
| 159 | - | ||
| 160 | /** | 165 | /** |
| 161 | * 首帧图 | 166 | * 首帧图 |
| 162 | */ | 167 | */ |
| @@ -184,6 +189,18 @@ public class NewsDetailBean extends BaseBean { | @@ -184,6 +189,18 @@ public class NewsDetailBean extends BaseBean { | ||
| 184 | 189 | ||
| 185 | private String sceneId; | 190 | private String sceneId; |
| 186 | 191 | ||
| 192 | + private String subSceneId; | ||
| 193 | + | ||
| 194 | + /** | ||
| 195 | + * 试验id | ||
| 196 | + */ | ||
| 197 | + private String expIds; | ||
| 198 | + | ||
| 199 | + /** | ||
| 200 | + * 频道id;【取对应频道关系的,频道id】 | ||
| 201 | + */ | ||
| 202 | + private String channelId; | ||
| 203 | + | ||
| 187 | private PlayStateChangedListener mPlayStateChangedListener; | 204 | private PlayStateChangedListener mPlayStateChangedListener; |
| 188 | 205 | ||
| 189 | /** | 206 | /** |
| @@ -199,28 +216,30 @@ public class NewsDetailBean extends BaseBean { | @@ -199,28 +216,30 @@ public class NewsDetailBean extends BaseBean { | ||
| 199 | * openAudio:语音播报开关 0不播报 1播报 | 216 | * openAudio:语音播报开关 0不播报 1播报 |
| 200 | */ | 217 | */ |
| 201 | private int openLikes; | 218 | private int openLikes; |
| 202 | - | ||
| 203 | private int openComment; | 219 | private int openComment; |
| 204 | - | ||
| 205 | /** | 220 | /** |
| 206 | * 是否是重点稿件 1是 0否 | 221 | * 是否是重点稿件 1是 0否 |
| 207 | */ | 222 | */ |
| 208 | private String keyArticle; | 223 | private String keyArticle; |
| 209 | 224 | ||
| 210 | /** | 225 | /** |
| 226 | + * 是否领导人文章 0 否,1 是,不存在就传0 | ||
| 227 | + */ | ||
| 228 | + private String leaderArticle = "0"; | ||
| 229 | + | ||
| 230 | + /** | ||
| 211 | * 点赞样式 1:红心(点赞) 2:大拇指(祈福) 3:蜡烛(默哀) 4:置空 | 231 | * 点赞样式 1:红心(点赞) 2:大拇指(祈福) 3:蜡烛(默哀) 4:置空 |
| 212 | */ | 232 | */ |
| 213 | private int likesStyle; | 233 | private int likesStyle; |
| 214 | 234 | ||
| 215 | private int preCommentFlag; | 235 | private int preCommentFlag; |
| 216 | - | ||
| 217 | private int commentDisplay; | 236 | private int commentDisplay; |
| 218 | - | ||
| 219 | private int commentEntryFlag; | 237 | private int commentEntryFlag; |
| 220 | - | ||
| 221 | private int posterFlag; | 238 | private int posterFlag; |
| 222 | - | ||
| 223 | - private int menuShow; | 239 | + /** |
| 240 | + * 是否显示功能菜单 1显示 2隐藏 | ||
| 241 | + */ | ||
| 242 | + private int menuShow = 1; | ||
| 224 | 243 | ||
| 225 | /** | 244 | /** |
| 226 | * 【图文稿件】语音播报开关 0不播报 1播报 | 245 | * 【图文稿件】语音播报开关 0不播报 1播报 |
| @@ -258,6 +277,7 @@ public class NewsDetailBean extends BaseBean { | @@ -258,6 +277,7 @@ public class NewsDetailBean extends BaseBean { | ||
| 258 | // api/rmrb-interact/interact/zh/c/batchAttention/status | 277 | // api/rmrb-interact/interact/zh/c/batchAttention/status |
| 259 | private MasterFollowsStatusBean followsStatusBean; | 278 | private MasterFollowsStatusBean followsStatusBean; |
| 260 | 279 | ||
| 280 | + | ||
| 261 | /** | 281 | /** |
| 262 | * 音频地址 | 282 | * 音频地址 |
| 263 | */ | 283 | */ |
| @@ -271,7 +291,7 @@ public class NewsDetailBean extends BaseBean { | @@ -271,7 +291,7 @@ public class NewsDetailBean extends BaseBean { | ||
| 271 | /** | 291 | /** |
| 272 | * 直播简介取这个 | 292 | * 直播简介取这个 |
| 273 | */ | 293 | */ |
| 274 | - private String newIntroduction; | 294 | + private String newIntroduction; |
| 275 | 295 | ||
| 276 | /** | 296 | /** |
| 277 | * 发布标识,0-cms;1-表示号主发布 2-普通用户 | 297 | * 发布标识,0-cms;1-表示号主发布 2-普通用户 |
| @@ -280,26 +300,22 @@ public class NewsDetailBean extends BaseBean { | @@ -280,26 +300,22 @@ public class NewsDetailBean extends BaseBean { | ||
| 280 | * /zh/c/vlive/pull-stream/{vLiveId} 普通直播获取流地址 | 300 | * /zh/c/vlive/pull-stream/{vLiveId} 普通直播获取流地址 |
| 281 | * /zh/c/vlive/pull-stream-list/{liveId} 多路直播获取流地址 | 301 | * /zh/c/vlive/pull-stream-list/{liveId} 多路直播获取流地址 |
| 282 | * 返回和视界一样 | 302 | * 返回和视界一样 |
| 283 | - */ | ||
| 284 | - public int rmhPlatform; | 303 | + * */ |
| 304 | + public int rmhPlatform = 0; | ||
| 285 | 305 | ||
| 286 | private String readFlag; | 306 | private String readFlag; |
| 287 | - | ||
| 288 | /** | 307 | /** |
| 289 | * 页面名称 | 308 | * 页面名称 |
| 290 | */ | 309 | */ |
| 291 | private String pageName; | 310 | private String pageName; |
| 292 | - | ||
| 293 | /** | 311 | /** |
| 294 | * 专栏ID | 312 | * 专栏ID |
| 295 | */ | 313 | */ |
| 296 | private String specialColumnId; | 314 | private String specialColumnId; |
| 297 | - | ||
| 298 | /** | 315 | /** |
| 299 | * 是否详情页 | 316 | * 是否详情页 |
| 300 | */ | 317 | */ |
| 301 | private String isDetail = "1"; | 318 | private String isDetail = "1"; |
| 302 | - | ||
| 303 | /** | 319 | /** |
| 304 | * 1开启、2关闭最佳评论,默认关闭 | 320 | * 1开启、2关闭最佳评论,默认关闭 |
| 305 | */ | 321 | */ |
| @@ -307,10 +323,29 @@ public class NewsDetailBean extends BaseBean { | @@ -307,10 +323,29 @@ public class NewsDetailBean extends BaseBean { | ||
| 307 | 323 | ||
| 308 | // 关联活动对象 | 324 | // 关联活动对象 |
| 309 | private List<ActivityInfo> activityInfos; | 325 | private List<ActivityInfo> activityInfos; |
| 310 | - | ||
| 311 | - // 上个页面跳转来的 | 326 | + //上个页面跳转来的 |
| 312 | private String fromPage; | 327 | private String fromPage; |
| 313 | 328 | ||
| 329 | + /** | ||
| 330 | + * 相关推荐开关:1-开启,其他情况不显示推荐 | ||
| 331 | + */ | ||
| 332 | + private String recommendShow; | ||
| 333 | + | ||
| 334 | + /** | ||
| 335 | + * 浏览量 | ||
| 336 | + */ | ||
| 337 | + private String viewCount; | ||
| 338 | + | ||
| 339 | + /** | ||
| 340 | + * 游客评论开关:visitorComment 1:打开;0:关闭 | ||
| 341 | + */ | ||
| 342 | + private String visitorComment; | ||
| 343 | + | ||
| 344 | + /** | ||
| 345 | + * 迁移老直播id | ||
| 346 | + */ | ||
| 347 | + private String oldNewsId; | ||
| 348 | + | ||
| 314 | public String getNewIntroduction() { | 349 | public String getNewIntroduction() { |
| 315 | return newIntroduction; | 350 | return newIntroduction; |
| 316 | } | 351 | } |
| @@ -319,6 +354,8 @@ public class NewsDetailBean extends BaseBean { | @@ -319,6 +354,8 @@ public class NewsDetailBean extends BaseBean { | ||
| 319 | this.newIntroduction = newIntroduction; | 354 | this.newIntroduction = newIntroduction; |
| 320 | } | 355 | } |
| 321 | 356 | ||
| 357 | + | ||
| 358 | + | ||
| 322 | public String getNewsSourceName() { | 359 | public String getNewsSourceName() { |
| 323 | return newsSourceName; | 360 | return newsSourceName; |
| 324 | } | 361 | } |
| @@ -350,15 +387,6 @@ public class NewsDetailBean extends BaseBean { | @@ -350,15 +387,6 @@ public class NewsDetailBean extends BaseBean { | ||
| 350 | public void setDisplayWorkInfoBean(DisplayWorkInfoBean displayWorkInfoBean) { | 387 | public void setDisplayWorkInfoBean(DisplayWorkInfoBean displayWorkInfoBean) { |
| 351 | this.displayWorkInfoBean = displayWorkInfoBean; | 388 | this.displayWorkInfoBean = displayWorkInfoBean; |
| 352 | } | 389 | } |
| 353 | - | ||
| 354 | - public String getNewsTags() { | ||
| 355 | - return newsTags; | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - public void setNewsTags(String newsTags) { | ||
| 359 | - this.newsTags = newsTags; | ||
| 360 | - } | ||
| 361 | - | ||
| 362 | public String getTraceId() { | 390 | public String getTraceId() { |
| 363 | return traceId; | 391 | return traceId; |
| 364 | } | 392 | } |
| @@ -391,6 +419,14 @@ public class NewsDetailBean extends BaseBean { | @@ -391,6 +419,14 @@ public class NewsDetailBean extends BaseBean { | ||
| 391 | this.itemId = itemId; | 419 | this.itemId = itemId; |
| 392 | } | 420 | } |
| 393 | 421 | ||
| 422 | + public String getAlbumCoverUrl() { | ||
| 423 | + return albumCoverUrl; | ||
| 424 | + } | ||
| 425 | + | ||
| 426 | + public void setAlbumCoverUrl(String albumCoverUrl) { | ||
| 427 | + this.albumCoverUrl = albumCoverUrl; | ||
| 428 | + } | ||
| 429 | + | ||
| 394 | public String getSceneId() { | 430 | public String getSceneId() { |
| 395 | return sceneId; | 431 | return sceneId; |
| 396 | } | 432 | } |
| @@ -399,6 +435,30 @@ public class NewsDetailBean extends BaseBean { | @@ -399,6 +435,30 @@ public class NewsDetailBean extends BaseBean { | ||
| 399 | this.sceneId = sceneId; | 435 | this.sceneId = sceneId; |
| 400 | } | 436 | } |
| 401 | 437 | ||
| 438 | + public String getSubSceneId() { | ||
| 439 | + return subSceneId; | ||
| 440 | + } | ||
| 441 | + | ||
| 442 | + public void setSubSceneId(String subSceneId) { | ||
| 443 | + this.subSceneId = subSceneId; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + public String getExpIds() { | ||
| 447 | + return expIds; | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + public void setExpIds(String expIds) { | ||
| 451 | + this.expIds = expIds; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + public String getChannelId() { | ||
| 455 | + return channelId; | ||
| 456 | + } | ||
| 457 | + | ||
| 458 | + public void setChannelId(String channelId) { | ||
| 459 | + this.channelId = channelId; | ||
| 460 | + } | ||
| 461 | + | ||
| 402 | public InteractResponseDataBean getInteract() { | 462 | public InteractResponseDataBean getInteract() { |
| 403 | return interact; | 463 | return interact; |
| 404 | } | 464 | } |
| @@ -484,7 +544,7 @@ public class NewsDetailBean extends BaseBean { | @@ -484,7 +544,7 @@ public class NewsDetailBean extends BaseBean { | ||
| 484 | } | 544 | } |
| 485 | 545 | ||
| 486 | public String getAppStyle() { | 546 | public String getAppStyle() { |
| 487 | - if (isBlank(appStyle) && !isBlank(appstyle)) { | 547 | + if (StringUtils.isBlank(appStyle) && !StringUtils.isBlank(appstyle) ){ |
| 488 | return appstyle; | 548 | return appstyle; |
| 489 | } | 549 | } |
| 490 | return appStyle; | 550 | return appStyle; |
| @@ -728,8 +788,8 @@ public class NewsDetailBean extends BaseBean { | @@ -728,8 +788,8 @@ public class NewsDetailBean extends BaseBean { | ||
| 728 | return preCommentFlag; | 788 | return preCommentFlag; |
| 729 | } | 789 | } |
| 730 | 790 | ||
| 731 | - public boolean isShowComment() { | ||
| 732 | - return getPreCommentFlag() == 1; | 791 | + public boolean isShowComment(){ |
| 792 | + return getPreCommentFlag()==1; | ||
| 733 | } | 793 | } |
| 734 | 794 | ||
| 735 | public void setPreCommentFlag(int preCommentFlag) { | 795 | public void setPreCommentFlag(int preCommentFlag) { |
| @@ -800,23 +860,22 @@ public class NewsDetailBean extends BaseBean { | @@ -800,23 +860,22 @@ public class NewsDetailBean extends BaseBean { | ||
| 800 | * @return 视频地址 | 860 | * @return 视频地址 |
| 801 | */ | 861 | */ |
| 802 | public String getUrl() { | 862 | public String getUrl() { |
| 803 | - // 直播回放情况 拿数据 后期优化 | ||
| 804 | - if (liveInfo != null && liveInfo.getLiveState() != null && LiveTypeConstants.END.equals(liveInfo.getLiveState()) | ||
| 805 | - && liveInfo.getVlive() != null && liveInfo.getVlive().size() > 0) { | ||
| 806 | - VliveBean videoInfoList = liveInfo.getVlive().get(0); | ||
| 807 | - if (videoInfoList == null || TextUtils.isEmpty(videoInfoList.getReplayUri())) { | ||
| 808 | - return null; | 863 | + //直播回放情况 拿数据 后期优化 |
| 864 | + if (liveInfo != null && liveInfo.getLiveState() != null && LiveTypeConstants.END.equals(liveInfo.getLiveState()) && liveInfo.getVlive() != null && liveInfo.getVlive().size()>0){ | ||
| 865 | + VliveBean videoInfoList = liveInfo.getVlive().get(0); | ||
| 866 | + if (videoInfoList == null || TextUtils.isEmpty(videoInfoList.getReplayUri()) ) { | ||
| 867 | + return null; | ||
| 809 | } | 868 | } |
| 810 | return videoInfoList.getReplayUri(); | 869 | return videoInfoList.getReplayUri(); |
| 811 | } | 870 | } |
| 812 | 871 | ||
| 813 | List<VideoInfo> videoInfoList = getVideoInfo(); | 872 | List<VideoInfo> videoInfoList = getVideoInfo(); |
| 814 | if (videoInfoList == null || videoInfoList.size() == 0) { | 873 | if (videoInfoList == null || videoInfoList.size() == 0) { |
| 815 | - return null; | 874 | + return null; |
| 816 | } | 875 | } |
| 817 | VideoInfo videoInfo = videoInfoList.get(0); | 876 | VideoInfo videoInfo = videoInfoList.get(0); |
| 818 | if (videoInfo == null) { | 877 | if (videoInfo == null) { |
| 819 | - return null; | 878 | + return null; |
| 820 | } | 879 | } |
| 821 | return videoInfo.videoUrl; | 880 | return videoInfo.videoUrl; |
| 822 | } | 881 | } |
| @@ -893,7 +952,51 @@ public class NewsDetailBean extends BaseBean { | @@ -893,7 +952,51 @@ public class NewsDetailBean extends BaseBean { | ||
| 893 | this.fromPage = fromPage; | 952 | this.fromPage = fromPage; |
| 894 | } | 953 | } |
| 895 | 954 | ||
| 896 | - private static boolean isBlank(String value) { | ||
| 897 | - return null == value || 0 == value.length() || "".equals(value.trim()); | 955 | + public String getRecommendShow() { |
| 956 | + return recommendShow; | ||
| 957 | + } | ||
| 958 | + | ||
| 959 | + public void setRecommendShow(String recommendShow) { | ||
| 960 | + this.recommendShow = recommendShow; | ||
| 961 | + } | ||
| 962 | + | ||
| 963 | + public String getViewCount() { | ||
| 964 | + return viewCount; | ||
| 965 | + } | ||
| 966 | + | ||
| 967 | + public void setViewCount(String viewCount) { | ||
| 968 | + this.viewCount = viewCount; | ||
| 969 | + } | ||
| 970 | + | ||
| 971 | + public String getCoverUrl() { | ||
| 972 | + return coverUrl; | ||
| 973 | + } | ||
| 974 | + | ||
| 975 | + public void setCoverUrl(String coverUrl) { | ||
| 976 | + this.coverUrl = coverUrl; | ||
| 977 | + } | ||
| 978 | + | ||
| 979 | + public int getVisitorComment() { | ||
| 980 | + return StringUtils.isEqual("1",visitorComment) ? 1 : 0; | ||
| 981 | + } | ||
| 982 | + | ||
| 983 | + public void setVisitorComment(String visitorComment) { | ||
| 984 | + this.visitorComment = visitorComment; | ||
| 985 | + } | ||
| 986 | + | ||
| 987 | + public String getOldNewsId() { | ||
| 988 | + return oldNewsId; | ||
| 989 | + } | ||
| 990 | + | ||
| 991 | + public void setOldNewsId(String oldNewsId) { | ||
| 992 | + this.oldNewsId = oldNewsId; | ||
| 993 | + } | ||
| 994 | + | ||
| 995 | + public String getLeaderArticle() { | ||
| 996 | + return leaderArticle; | ||
| 997 | + } | ||
| 998 | + | ||
| 999 | + public void setLeaderArticle(String leaderArticle) { | ||
| 1000 | + this.leaderArticle = leaderArticle; | ||
| 898 | } | 1001 | } |
| 899 | } | 1002 | } |
| @@ -11,5 +11,33 @@ import okhttp3.Interceptor | @@ -11,5 +11,33 @@ import okhttp3.Interceptor | ||
| 11 | interface INetConfig : IProvider { | 11 | interface INetConfig : IProvider { |
| 12 | fun getBaseUrl(): String | 12 | fun getBaseUrl(): String |
| 13 | 13 | ||
| 14 | + fun getBaseUrlSitTag(): String | ||
| 15 | + | ||
| 16 | + fun getBaseUrlDevTag(): String | ||
| 17 | + | ||
| 18 | + fun getBaseUrlRelTag(): String | ||
| 19 | + | ||
| 20 | + fun getBaseUrlUatTag(): String | ||
| 21 | + | ||
| 22 | + fun getUrlTag(): String | ||
| 23 | + | ||
| 24 | + fun getEcommerceAddressTag(): String | ||
| 25 | + | ||
| 26 | + fun getEcommerceAddress(): String | ||
| 27 | + | ||
| 28 | + fun getMultiDomainBaseUrl(): String | ||
| 29 | + | ||
| 30 | + fun getHeaderParameter(): Map<String, String> | ||
| 31 | + | ||
| 32 | + fun getCacheFile(): String | ||
| 33 | + | ||
| 34 | + fun getReadTimeout(): Long | ||
| 35 | + | ||
| 36 | + fun getConnectTimeout(): Long | ||
| 37 | + | ||
| 38 | + fun getWriteTimeout(): Long | ||
| 39 | + | ||
| 40 | + fun getCacheTime(): Long | ||
| 41 | + | ||
| 14 | fun getInterceptors(): Array<Interceptor> | 42 | fun getInterceptors(): Array<Interceptor> |
| 15 | } | 43 | } |
| @@ -10,6 +10,8 @@ import com.wd.foundation.wdinterface.config.INetConfig; | @@ -10,6 +10,8 @@ import com.wd.foundation.wdinterface.config.INetConfig; | ||
| 10 | import com.wd.foundation.wdinterface.constant.InterfaceConstant; | 10 | import com.wd.foundation.wdinterface.constant.InterfaceConstant; |
| 11 | import com.wd.foundation.wdinterfaceimpl.interceptor.TokenInterceptor; | 11 | import com.wd.foundation.wdinterfaceimpl.interceptor.TokenInterceptor; |
| 12 | 12 | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 13 | import okhttp3.Interceptor; | 15 | import okhttp3.Interceptor; |
| 14 | 16 | ||
| 15 | /** | 17 | /** |
| @@ -19,7 +21,6 @@ import okhttp3.Interceptor; | @@ -19,7 +21,6 @@ import okhttp3.Interceptor; | ||
| 19 | */ | 21 | */ |
| 20 | @Route(path = InterfaceConstant.PATH_NET_CONFIG) | 22 | @Route(path = InterfaceConstant.PATH_NET_CONFIG) |
| 21 | public class NetConfig implements INetConfig { | 23 | public class NetConfig implements INetConfig { |
| 22 | - private static final String baseUrlRel = "https://pdapis.pdnews.cn/"; | ||
| 23 | 24 | ||
| 24 | @Override | 25 | @Override |
| 25 | public void init(Context context) { | 26 | public void init(Context context) { |
| @@ -29,7 +30,31 @@ public class NetConfig implements INetConfig { | @@ -29,7 +30,31 @@ public class NetConfig implements INetConfig { | ||
| 29 | @NonNull | 30 | @NonNull |
| 30 | @Override | 31 | @Override |
| 31 | public String getBaseUrl() { | 32 | public String getBaseUrl() { |
| 32 | - return baseUrlRel; | 33 | + return NetManager.getNetManager().getBaseUrl(); |
| 34 | + } | ||
| 35 | + | ||
| 36 | + @NonNull | ||
| 37 | + @Override | ||
| 38 | + public String getBaseUrlSitTag() { | ||
| 39 | + return NetManager.BASE_URL_SIT; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @NonNull | ||
| 43 | + @Override | ||
| 44 | + public String getBaseUrlDevTag() { | ||
| 45 | + return NetManager.BASE_URL_DEV; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @NonNull | ||
| 49 | + @Override | ||
| 50 | + public String getBaseUrlRelTag() { | ||
| 51 | + return NetManager.BASE_URL_REL; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @NonNull | ||
| 55 | + @Override | ||
| 56 | + public String getBaseUrlUatTag() { | ||
| 57 | + return NetManager.BASE_URL_UAT; | ||
| 33 | } | 58 | } |
| 34 | 59 | ||
| 35 | @NonNull | 60 | @NonNull |
| @@ -37,4 +62,75 @@ public class NetConfig implements INetConfig { | @@ -37,4 +62,75 @@ public class NetConfig implements INetConfig { | ||
| 37 | public Interceptor[] getInterceptors() { | 62 | public Interceptor[] getInterceptors() { |
| 38 | return new TokenInterceptor[]{new TokenInterceptor(RetrofitClient.getInterceptorHosts())}; | 63 | return new TokenInterceptor[]{new TokenInterceptor(RetrofitClient.getInterceptorHosts())}; |
| 39 | } | 64 | } |
| 65 | + | ||
| 66 | + @NonNull | ||
| 67 | + @Override | ||
| 68 | + public String getUrlTag() { | ||
| 69 | + return NetManager.getUrlTag(); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + @NonNull | ||
| 73 | + @Override | ||
| 74 | + public String getEcommerceAddressTag() { | ||
| 75 | + return NetManager.ECOMMERCE_ADDRESS_TAG; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + @NonNull | ||
| 79 | + @Override | ||
| 80 | + public String getEcommerceAddress() { | ||
| 81 | + return NetManager.getEcommerceAddress(); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + @NonNull | ||
| 85 | + @Override | ||
| 86 | + public String getMultiDomainBaseUrl() { | ||
| 87 | + String baseUrl = ""; | ||
| 88 | + String tag = getUrlTag(); | ||
| 89 | + if (NetManager.BASE_URL_DEV.equals(tag)){ | ||
| 90 | + baseUrl = NetManager.baseUrlSitDev; | ||
| 91 | + }else if (NetManager.BASE_URL_SIT.equals(tag)){ | ||
| 92 | + baseUrl = NetManager.baseUrlSit; | ||
| 93 | + }else if (NetManager.BASE_URL_UAT.equals(tag)){ | ||
| 94 | + baseUrl = NetManager.baseUrlUta; | ||
| 95 | + } else { | ||
| 96 | + baseUrl = NetManager.baseUrlRel; | ||
| 97 | + } | ||
| 98 | + return baseUrl; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @NonNull | ||
| 102 | + @Override | ||
| 103 | + public Map<String, String> getHeaderParameter() { | ||
| 104 | + return NetManager.getNetManager().getHeaderParameter(); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + @NonNull | ||
| 108 | + @Override | ||
| 109 | + public String getCacheFile() { | ||
| 110 | + return NetManager.getNetManager().builder.getCacheFile(); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + @NonNull | ||
| 114 | + @Override | ||
| 115 | + public long getReadTimeout() { | ||
| 116 | + return NetManager.getNetManager().builder.getReadTimeout(); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + @NonNull | ||
| 120 | + @Override | ||
| 121 | + public long getConnectTimeout() { | ||
| 122 | + return NetManager.getNetManager().builder.getConnectTimeout(); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + @NonNull | ||
| 126 | + @Override | ||
| 127 | + public long getWriteTimeout() { | ||
| 128 | + return NetManager.getNetManager().builder.getWriteTimeout(); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + @NonNull | ||
| 132 | + @Override | ||
| 133 | + public long getCacheTime() { | ||
| 134 | + return NetManager.getNetManager().builder.getCacheTime(); | ||
| 135 | + } | ||
| 40 | } | 136 | } |
| @@ -19,7 +19,6 @@ import com.wd.capability.network.constant.ParameterConstant; | @@ -19,7 +19,6 @@ import com.wd.capability.network.constant.ParameterConstant; | ||
| 19 | import com.wd.capability.network.interceptor.LoggingInterceptor; | 19 | import com.wd.capability.network.interceptor.LoggingInterceptor; |
| 20 | import com.wd.capability.network.refreshtoken.IRefreshTokenForJsCallBack; | 20 | import com.wd.capability.network.refreshtoken.IRefreshTokenForJsCallBack; |
| 21 | import com.wd.capability.network.response.BaseResponse; | 21 | import com.wd.capability.network.response.BaseResponse; |
| 22 | -import com.wd.foundation.wdinterfaceimpl.config.IRefreshToken; | ||
| 23 | import com.wd.foundation.wdkit.json.JsonParseUtil; | 22 | import com.wd.foundation.wdkit.json.JsonParseUtil; |
| 24 | import com.wd.foundation.wdkit.utils.DeviceUtil; | 23 | import com.wd.foundation.wdkit.utils.DeviceUtil; |
| 25 | import com.wd.foundation.wdkit.utils.SpUtils; | 24 | import com.wd.foundation.wdkit.utils.SpUtils; |
| 1 | +package com.wd.foundation.wdkit.utils; | ||
| 2 | + | ||
| 3 | +import android.text.TextUtils; | ||
| 4 | + | ||
| 5 | +import java.util.Calendar; | ||
| 6 | +import java.util.Locale; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Author LiuKun | ||
| 10 | + * date:2023/3/21 | ||
| 11 | + * desc:时间处理工具类 | ||
| 12 | + */ | ||
| 13 | +public class DateFormatHelper { | ||
| 14 | + private static long VALUE_MINUTE = 60 * 1000; | ||
| 15 | + | ||
| 16 | + private static long VALUE_HOUR = 60 * 60 * 1000; | ||
| 17 | + | ||
| 18 | + private static long VALUE_DAY = 24 * 60 * 60 * 1000; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 时间显示规则4 | ||
| 22 | + * 规则: 日期格式:月(英文缩写)日(数字),yyyy(如:Jun 15,2021) | ||
| 23 | + */ | ||
| 24 | + public static String formatGlobalRule$4(String timestamp) { | ||
| 25 | + | ||
| 26 | + long targetTime; | ||
| 27 | + | ||
| 28 | + if (TextUtils.isEmpty(timestamp)) { | ||
| 29 | + return ""; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + if (timestamp.length() == 10) { | ||
| 33 | + timestamp = timestamp + "000"; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + try { | ||
| 37 | + | ||
| 38 | + targetTime = Long.parseLong(timestamp); | ||
| 39 | + } catch (NumberFormatException e) { | ||
| 40 | + | ||
| 41 | + return timestamp; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + Calendar targetCalendar = Calendar.getInstance(); | ||
| 45 | + targetCalendar.setTimeInMillis(targetTime); | ||
| 46 | + | ||
| 47 | + int targetYear = targetCalendar.get(Calendar.YEAR); | ||
| 48 | + int targetDay = targetCalendar.get(Calendar.DAY_OF_MONTH); | ||
| 49 | + | ||
| 50 | + String realMonth = targetCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.ENGLISH); | ||
| 51 | + String realDay = targetDay < 10 ? ("0" + targetDay) : String.valueOf(targetDay); | ||
| 52 | + | ||
| 53 | + return realMonth + " " + realDay + ", " + targetYear; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 时间显示规则5 | ||
| 59 | + * 规则: | ||
| 60 | + * 时间格式:hh:mm(如:16:00) | ||
| 61 | + * 显示页面: | ||
| 62 | + * 1)财经飞播专题列表页——时间 | ||
| 63 | + */ | ||
| 64 | + public static String formatGlobalRule$5(String timestamp) { | ||
| 65 | + | ||
| 66 | + long targetTime; | ||
| 67 | + | ||
| 68 | + if (TextUtils.isEmpty(timestamp)) { | ||
| 69 | + return ""; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + if (timestamp.length() == 10) { | ||
| 73 | + timestamp = timestamp + "000"; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + try { | ||
| 77 | + | ||
| 78 | + targetTime = Long.parseLong(timestamp); | ||
| 79 | + } catch (NumberFormatException e) { | ||
| 80 | + | ||
| 81 | + return timestamp; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + return formatTime(targetTime, 4); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 同一天 | ||
| 89 | + * @param time1 | ||
| 90 | + * @param time2 | ||
| 91 | + * @return | ||
| 92 | + */ | ||
| 93 | + public static boolean isSameDay(long time1, long time2) { | ||
| 94 | + | ||
| 95 | + String sTime1 = String.valueOf(time1); | ||
| 96 | + | ||
| 97 | + if (sTime1.length() == 10) { | ||
| 98 | + time1 = time1 * 1000; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + String sTime2 = String.valueOf(time2); | ||
| 102 | + | ||
| 103 | + if (sTime2.length() == 10) { | ||
| 104 | + time2 = time2 * 1000; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + Calendar calendar = Calendar.getInstance(); | ||
| 109 | + | ||
| 110 | + calendar.setTimeInMillis(time1); | ||
| 111 | + | ||
| 112 | + int year1 = calendar.get(Calendar.YEAR); | ||
| 113 | + int month1 = calendar.get(Calendar.MONTH); | ||
| 114 | + int day1 = calendar.get(Calendar.DAY_OF_MONTH); | ||
| 115 | + | ||
| 116 | + calendar.setTimeInMillis(time2); | ||
| 117 | + | ||
| 118 | + int year2 = calendar.get(Calendar.YEAR); | ||
| 119 | + int month2 = calendar.get(Calendar.MONTH); | ||
| 120 | + int day2 = calendar.get(Calendar.DAY_OF_MONTH); | ||
| 121 | + | ||
| 122 | + if (year1 != year2) { | ||
| 123 | + return false; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + if (month1 != month2) { | ||
| 127 | + return false; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + return day1 == day2; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + /** | ||
| 134 | + * 同一年 | ||
| 135 | + * @param time1 | ||
| 136 | + * @param time2 | ||
| 137 | + * @return | ||
| 138 | + */ | ||
| 139 | + public static boolean isSameYear(long time1, long time2) { | ||
| 140 | + | ||
| 141 | + String sTime1 = String.valueOf(time1); | ||
| 142 | + | ||
| 143 | + if (sTime1.length() == 10) { | ||
| 144 | + time1 = time1 * 1000; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + String sTime2 = String.valueOf(time2); | ||
| 148 | + | ||
| 149 | + if (sTime2.length() == 10) { | ||
| 150 | + time2 = time2 * 1000; | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + | ||
| 154 | + Calendar calendar = Calendar.getInstance(); | ||
| 155 | + | ||
| 156 | + calendar.setTimeInMillis(time1); | ||
| 157 | + | ||
| 158 | + int year1 = calendar.get(Calendar.YEAR); | ||
| 159 | + | ||
| 160 | + calendar.setTimeInMillis(time2); | ||
| 161 | + | ||
| 162 | + int year2 = calendar.get(Calendar.YEAR); | ||
| 163 | + | ||
| 164 | + return year1 == year2; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + | ||
| 168 | + | ||
| 169 | + /** | ||
| 170 | + * timestamp | ||
| 171 | + * formatType 1 = yyyy-mm-dd; 2 = mm-dd ; 3 = yyyy-mm-dd hh:mm ; 4 = hh:mm | ||
| 172 | + */ | ||
| 173 | + private static String formatTime(long timestamp, int formatType) { | ||
| 174 | + | ||
| 175 | + Calendar calendar = Calendar.getInstance(); | ||
| 176 | + | ||
| 177 | + calendar.setTimeInMillis(timestamp); | ||
| 178 | + | ||
| 179 | + StringBuilder result = new StringBuilder(); | ||
| 180 | + | ||
| 181 | + int year = calendar.get(Calendar.YEAR); | ||
| 182 | + | ||
| 183 | + int month = calendar.get(Calendar.MONTH); | ||
| 184 | + | ||
| 185 | + int day = calendar.get(Calendar.DAY_OF_MONTH); | ||
| 186 | + | ||
| 187 | + int hour = calendar.get(Calendar.HOUR_OF_DAY); | ||
| 188 | + | ||
| 189 | + int minute = calendar.get(Calendar.MINUTE); | ||
| 190 | + | ||
| 191 | + month += 1; | ||
| 192 | + | ||
| 193 | + String realMonth = month < 10 ? ("0" + month) : String.valueOf(month); | ||
| 194 | + | ||
| 195 | + String realDay = day < 10 ? ("0" + day) : String.valueOf(day); | ||
| 196 | + | ||
| 197 | + String realHour = hour < 10 ? ("0" + hour) : String.valueOf(hour); | ||
| 198 | + | ||
| 199 | + String realMinute = minute < 10 ? ("0" + minute) : String.valueOf(minute); | ||
| 200 | + | ||
| 201 | + switch (formatType) { | ||
| 202 | + | ||
| 203 | + case 1: | ||
| 204 | + result.append(year); | ||
| 205 | + result.append("-"); | ||
| 206 | + result.append(realMonth); | ||
| 207 | + result.append("-"); | ||
| 208 | + result.append(realDay); | ||
| 209 | + break; | ||
| 210 | + | ||
| 211 | + case 2: | ||
| 212 | + result.append(realMonth); | ||
| 213 | + result.append("-"); | ||
| 214 | + result.append(realDay); | ||
| 215 | + break; | ||
| 216 | + | ||
| 217 | + case 3: | ||
| 218 | + | ||
| 219 | + result.append(year); | ||
| 220 | + result.append("-"); | ||
| 221 | + result.append(realMonth); | ||
| 222 | + result.append("-"); | ||
| 223 | + result.append(realDay); | ||
| 224 | + | ||
| 225 | + result.append("\t"); | ||
| 226 | + result.append(realHour); | ||
| 227 | + result.append(":"); | ||
| 228 | + result.append(realMinute); | ||
| 229 | + break; | ||
| 230 | + | ||
| 231 | + case 4: | ||
| 232 | + | ||
| 233 | + result.append(realHour); | ||
| 234 | + result.append(":"); | ||
| 235 | + result.append(realMinute); | ||
| 236 | + break; | ||
| 237 | + } | ||
| 238 | + return result.toString(); | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + public static String test(String timestamp) { | ||
| 242 | + | ||
| 243 | + long targetTime; | ||
| 244 | + | ||
| 245 | + if (TextUtils.isEmpty(timestamp)) { | ||
| 246 | + return ""; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + if (timestamp.length() == 10) { | ||
| 250 | + timestamp = timestamp + "000"; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + try { | ||
| 254 | + | ||
| 255 | + targetTime = Long.parseLong(timestamp); | ||
| 256 | + } catch (NumberFormatException e) { | ||
| 257 | + | ||
| 258 | + return timestamp; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + return formatTime(targetTime, 3); | ||
| 262 | + } | ||
| 263 | +} |
| @@ -296,4 +296,65 @@ public class ArrayUtils { | @@ -296,4 +296,65 @@ public class ArrayUtils { | ||
| 296 | return res; | 296 | return res; |
| 297 | } | 297 | } |
| 298 | } | 298 | } |
| 299 | + | ||
| 300 | + public static boolean isOutOffIndex(int position, List<?> list) { | ||
| 301 | + if (isEmpty(list)) { | ||
| 302 | + return true; | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + return position < 0 || position > (list.size() - 1); | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + public static boolean isLastIndex(int position, List<?> list) { | ||
| 309 | + if (isEmpty(list)) { | ||
| 310 | + return false; | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + if (isOutOffIndex(position, list)) { | ||
| 314 | + return false; | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + return position == (list.size() - 1); | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + @Nullable | ||
| 321 | + public static <T> T safeGet(int index, List<T> list) { | ||
| 322 | + if (isOutOffIndex(index, list)) { | ||
| 323 | + return null; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + return list.get(index); | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + @Nullable | ||
| 330 | + public static <T> T safeGetFirst(List<T> list) { | ||
| 331 | + if (isOutOffIndex(0, list)) { | ||
| 332 | + return null; | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + return safeGet(0, list); | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + @Nullable | ||
| 339 | + public static <T> T safeGetLast(List<T> list) { | ||
| 340 | + if (isEmpty(list)) { | ||
| 341 | + return null; | ||
| 342 | + } | ||
| 343 | + | ||
| 344 | + int index = list.size() - 1; | ||
| 345 | + | ||
| 346 | + if (isOutOffIndex(index, list)) { | ||
| 347 | + return null; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + return safeGet(index, list); | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + public static void safeRemove(int index, List<?> list) { | ||
| 354 | + if (isOutOffIndex(index, list)) { | ||
| 355 | + return; | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + list.remove(index); | ||
| 359 | + } | ||
| 299 | } | 360 | } |
| @@ -74,6 +74,10 @@ dependencies { | @@ -74,6 +74,10 @@ dependencies { | ||
| 74 | implementation rootProject.ext.dependencies['TagTextView'] | 74 | implementation rootProject.ext.dependencies['TagTextView'] |
| 75 | // RecyclerView多功能适配器 | 75 | // RecyclerView多功能适配器 |
| 76 | api rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"] | 76 | api rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"] |
| 77 | + | ||
| 78 | + implementation rootProject.ext.dependencies["banner"] | ||
| 79 | + | ||
| 80 | + api rootProject.ext.dependencies["fresco"] | ||
| 77 | } | 81 | } |
| 78 | 82 | ||
| 79 | uploadArchives { | 83 | uploadArchives { |
| 1 | +package com.wd.capability.layout.comp.layoutmanager.adapter; | ||
| 2 | + | ||
| 3 | +import android.view.View; | ||
| 4 | +import android.widget.ImageView; | ||
| 5 | +import android.widget.TextView; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.chad.library.adapter.base.BaseQuickAdapter; | ||
| 10 | +import com.chad.library.adapter.base.BaseViewHolder; | ||
| 11 | +import com.wd.capability.layout.R; | ||
| 12 | +import com.wd.capability.layout.uitls.FontSettingUtil; | ||
| 13 | +import com.wd.common.imageglide.ImageUtils; | ||
| 14 | +import com.wd.common.viewclick.BaseClickListener; | ||
| 15 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 内容适配器 | ||
| 19 | + */ | ||
| 20 | +public class CompSingleRowGoldenAdapter extends BaseQuickAdapter<ContentBean, BaseViewHolder> { | ||
| 21 | + | ||
| 22 | + private int size; | ||
| 23 | + | ||
| 24 | + private Back back; | ||
| 25 | + | ||
| 26 | + public CompSingleRowGoldenAdapter(int size) { | ||
| 27 | + super(R.layout.comp_single_row_golden_item_content); | ||
| 28 | + this.size = size; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public void setBack(Back back) { | ||
| 32 | + this.back = back; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + protected void convert(@NonNull BaseViewHolder baseViewHolder, ContentBean bean) { | ||
| 38 | + | ||
| 39 | + ImageView imageView = baseViewHolder.itemView.findViewById(R.id.imageView); | ||
| 40 | + TextView tvTitle = baseViewHolder.itemView.findViewById(R.id.tvTitle); | ||
| 41 | + //适老化文字大小设置 | ||
| 42 | + FontSettingUtil.setRowGoldenTextFontSize(tvTitle); | ||
| 43 | + ImageUtils.getInstance().loadImageSourceByNetStatus(imageView, bean.getCoverUrl(), R.drawable.rmrb_placeholder_compe_all); | ||
| 44 | + tvTitle.setText(bean.getNewsTitle()); | ||
| 45 | + baseViewHolder.itemView.setOnClickListener(new BaseClickListener() { | ||
| 46 | + @Override | ||
| 47 | + protected void onNoDoubleClick(View v) { | ||
| 48 | + if(back != null){ | ||
| 49 | + back.clickBack(bean,baseViewHolder.getBindingAdapterPosition()); | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + }); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public interface Back{ | ||
| 56 | + void clickBack(ContentBean bean,int position); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | +} |
wdlayout/src/main/java/com/wd/capability/layout/comp/layoutmanager/channel/CompActivity01.java
0 → 100644
| 1 | +package com.wd.capability.layout.comp.layoutmanager.channel; | ||
| 2 | + | ||
| 3 | +import android.annotation.SuppressLint; | ||
| 4 | +import android.graphics.drawable.GradientDrawable; | ||
| 5 | +import android.text.TextUtils; | ||
| 6 | +import android.view.View; | ||
| 7 | +import android.view.ViewGroup; | ||
| 8 | +import android.widget.ImageView; | ||
| 9 | +import android.widget.TextView; | ||
| 10 | + | ||
| 11 | +import androidx.core.content.ContextCompat; | ||
| 12 | + | ||
| 13 | +import com.view.text.config.TagConfig; | ||
| 14 | +import com.view.text.config.Type; | ||
| 15 | +import com.view.text.view.TagTextView; | ||
| 16 | +import com.wd.capability.layout.R; | ||
| 17 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 18 | +import com.wd.capability.layout.uitls.CompentLogicUtil; | ||
| 19 | +import com.wd.common.imageglide.ImageUtils; | ||
| 20 | +import com.wd.common.utils.ProcessUtils; | ||
| 21 | +import com.wd.common.viewclick.BaseClickListener; | ||
| 22 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 23 | +import com.wd.foundation.bean.custom.act.BaseActivityBean; | ||
| 24 | +import com.wd.foundation.wdkit.utils.NumberStrUtils; | ||
| 25 | +import com.wd.foundation.wdkit.utils.TimeUtil; | ||
| 26 | +import com.wd.foundation.wdkit.utils.UiUtils; | ||
| 27 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 28 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 29 | + | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * @Description: 活动卡 | ||
| 33 | + * @Author: liyub | ||
| 34 | + * @Email: liyubing@wondertek.com.cn | ||
| 35 | + * @CreateDate: 2023/11/15 | ||
| 36 | + * @UpdateRemark: 更新说明 | ||
| 37 | + * @Version: 1.0 | ||
| 38 | + */ | ||
| 39 | +public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + private ImageView imageView; | ||
| 43 | + private TagTextView tvTitle; | ||
| 44 | + private TextView tvData, tvLookDetail; | ||
| 45 | + | ||
| 46 | + private TextView participantsNumberTv; | ||
| 47 | + | ||
| 48 | + private View viewTag; | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public int getItemViewType() { | ||
| 53 | + return R.layout.comp_activity_01; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @Override | ||
| 57 | + public int getItemSpan() { | ||
| 58 | + return 1; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + @Override | ||
| 62 | + public void prepareItem(View itemView, int position) { | ||
| 63 | + | ||
| 64 | + setFirstItemBg(itemView, position); | ||
| 65 | + setCompItemMorePadding(itemView, position); | ||
| 66 | + | ||
| 67 | + imageView = itemView.findViewById(R.id.imageView); | ||
| 68 | + tvTitle = itemView.findViewById(R.id.tvTitle); | ||
| 69 | + tvData = itemView.findViewById(R.id.tvData); | ||
| 70 | + participantsNumberTv = itemView.findViewById(R.id.tv_participants_number); | ||
| 71 | + tvLookDetail = itemView.findViewById(R.id.tvLookDetail); | ||
| 72 | + viewTag = itemView.findViewById(R.id.viewTag); | ||
| 73 | + | ||
| 74 | + // 国殇 | ||
| 75 | + checkOpenGrayModel(itemView, position); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + @SuppressLint("StringFormatMatches") | ||
| 79 | + @Override | ||
| 80 | + public void bindItem(View itemView, int position, NavigationBeanNews data) { | ||
| 81 | + | ||
| 82 | + if (data != null && data.getSubList() != null && data.getSubList().size() > 0) { | ||
| 83 | + setLayoutManagerItemViewHeight(itemView, ViewGroup.LayoutParams.WRAP_CONTENT); | ||
| 84 | + | ||
| 85 | + contentBean = data.getSubList().get(0); | ||
| 86 | + | ||
| 87 | + BaseActivityBean activityBean = contentBean.itemActivity; | ||
| 88 | + | ||
| 89 | + // 加载图片 | ||
| 90 | + String url = activityBean.getCoverUrl(); | ||
| 91 | + ImageUtils.getInstance().loadImageSourceByNetStatus(imageView, url, R.drawable.rmrb_placeholder_compe_all); | ||
| 92 | + //设置已读 | ||
| 93 | + setReadState(tvTitle, contentBean,-1); | ||
| 94 | + //适老化文字大小设置 | ||
| 95 | + setTextFontSize(tvTitle); | ||
| 96 | + setTittleValue(activityBean.getActivityTitle(), tvTitle, contentBean.getKeyWord()); | ||
| 97 | + //设置默认数据 | ||
| 98 | + if(TextUtils.isEmpty(activityBean.localFieldActivityLabelName)){ | ||
| 99 | + activityBean.activityTypeToLabelName(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + //设置标题左边的标签 征集/抽奖/答题/投票 | ||
| 103 | + if(!TextUtils.isEmpty(activityBean.localFieldActivityLabelName)){ | ||
| 104 | + // 默认样式 | ||
| 105 | + String activityType = activityBean.getActivityType(); | ||
| 106 | + TagConfig tv1Config = new TagConfig(Type.TEXT); | ||
| 107 | + tv1Config.setText(activityBean.localFieldActivityLabelName); | ||
| 108 | + tv1Config.setTextSize(UiUtils.dp2pxF(CompentLogicUtil.setTextTagSize())); | ||
| 109 | + tv1Config.setTextColor(ContextCompat.getColor(tvTitle.getContext(), R.color.res_color_common_C8_keep)); | ||
| 110 | + tv1Config.setStartGradientBackgroundColor(activityBean.getActivityLabelNameColors(activityType)[0]); | ||
| 111 | + tv1Config.setEndGradientBackgroundColor(activityBean.getActivityLabelNameColors(activityType)[1]); | ||
| 112 | + tv1Config.setGradientOrientation(GradientDrawable.Orientation.LEFT_RIGHT); | ||
| 113 | +// //设置圆角 | ||
| 114 | + tv1Config.setRadius(ResUtils.getDimension(R.dimen.rmrb_dp2)); | ||
| 115 | +// //设置内边距 | ||
| 116 | + tv1Config.setLeftPadding((int) ResUtils.getDimension(R.dimen.rmrb_dp4)); | ||
| 117 | + tv1Config.setRightPadding((int) ResUtils.getDimension(R.dimen.rmrb_dp4)); | ||
| 118 | + tv1Config.setTopPadding((int) ResUtils.getDimension(R.dimen.rmrb_dp1)); | ||
| 119 | + tv1Config.setBottomPadding((int) ResUtils.getDimension(R.dimen.rmrb_dp1)); | ||
| 120 | + //设置外边距 | ||
| 121 | + tv1Config.setMarginRight((int) ResUtils.getDimension(R.dimen.rmrb_dp5)); | ||
| 122 | + tvTitle.addTag(tv1Config); | ||
| 123 | + } | ||
| 124 | + // 处理标签 | ||
| 125 | + CompentLogicUtil.handleActivityTagViewLogic(viewTag, contentBean); | ||
| 126 | + | ||
| 127 | + CompentLogicUtil.contentObjectTextMsg(tvLookDetail, contentBean); | ||
| 128 | + // 活动开始和结束日期 | ||
| 129 | + String commentTxt = tvData.getContext().getString(R.string.comp_activity_data); | ||
| 130 | + tvData.setText(String.format(commentTxt, TimeUtil.transFormTime9(activityBean.getStartTime()), TimeUtil.transFormTime9(activityBean.getEndTime()))); | ||
| 131 | + | ||
| 132 | + if(activityBean != null && StringUtils.isNotBlank(activityBean.getPerson())){ | ||
| 133 | + String person = NumberStrUtils.Companion.getINSTANCE(). | ||
| 134 | + handlerNumber(String.valueOf(activityBean.getPerson())); | ||
| 135 | + if(StringUtils.isEqual("0",person)){ | ||
| 136 | + participantsNumberTv.setVisibility(View.GONE); | ||
| 137 | + }else { | ||
| 138 | + participantsNumberTv.setVisibility(View.VISIBLE); | ||
| 139 | + participantsNumberTv.setText(person+"人参加"); | ||
| 140 | + } | ||
| 141 | + }else { | ||
| 142 | + participantsNumberTv.setVisibility(View.GONE); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + itemView.setOnClickListener(new BaseClickListener() { | ||
| 146 | + @Override | ||
| 147 | + protected void onNoDoubleClick(View v) { | ||
| 148 | + | ||
| 149 | + ProcessUtils.processPage(contentBean); | ||
| 150 | + //更新已读状态 | ||
| 151 | + updateReadState(tvTitle, contentBean); | ||
| 152 | + // 点击埋点 | ||
| 153 | + trackItemContent(true, contentBean, position, data.getLocalFiledType()); | ||
| 154 | + } | ||
| 155 | + }); | ||
| 156 | + | ||
| 157 | + | ||
| 158 | + // 曝光埋点 | ||
| 159 | + itemView.post(() -> | ||
| 160 | + | ||
| 161 | + { | ||
| 162 | + trackItemContent(false, contentBean, position, data.getLocalFiledType()); | ||
| 163 | + | ||
| 164 | + }); | ||
| 165 | + | ||
| 166 | + | ||
| 167 | + } else { | ||
| 168 | + setLayoutManagerItemViewHeight(itemView, 0); | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + | ||
| 173 | +} |
| 1 | +package com.wd.capability.layout.comp.layoutmanager.channel; | ||
| 2 | + | ||
| 3 | +import android.text.TextUtils; | ||
| 4 | +import android.view.View; | ||
| 5 | +import android.widget.ImageView; | ||
| 6 | +import android.widget.RelativeLayout; | ||
| 7 | +import android.widget.TextView; | ||
| 8 | + | ||
| 9 | +import androidx.core.content.ContextCompat; | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +import com.wd.capability.layout.R; | ||
| 13 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 14 | +import com.wd.capability.layout.uitls.PDUtils; | ||
| 15 | +import com.wd.common.imageglide.ImageUtils; | ||
| 16 | +import com.wd.common.utils.ProcessUtils; | ||
| 17 | +import com.wd.common.viewclick.BaseClickListener; | ||
| 18 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 19 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 20 | +import com.wd.foundation.wdkit.constant.Constants; | ||
| 21 | +import com.wd.foundation.wdkit.utils.FilletUtil; | ||
| 22 | +import com.wd.foundation.wdkit.utils.NumberStrUtils; | ||
| 23 | +import com.wd.foundation.wdkit.view.customtextview.StrokeWidthTextView; | ||
| 24 | +import com.wd.foundation.wdkitcore.tools.ArrayUtils; | ||
| 25 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 26 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 27 | + | ||
| 28 | +import java.util.List; | ||
| 29 | + | ||
| 30 | +/** | ||
| 31 | + * 搜索结果-更多人民号模块、搜索人民号 | ||
| 32 | + * | ||
| 33 | + * @version 1.0.0 | ||
| 34 | + * @description: | ||
| 35 | + * @author: wd | ||
| 36 | + * @date :2023/2/6 16:21 | ||
| 37 | + * 参照:{@link com.people.personalcenter.adapter CompSingleRowRecommendFollow | ||
| 38 | + * com.people.component.comp.layoutmanager.channel.CompSingleRowRecommendFollow} | ||
| 39 | + */ | ||
| 40 | +public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBeanNews> { | ||
| 41 | + private ImageView riv_author,ivtagsplitpoint,ivadd,ivvip,imgavatarframe; | ||
| 42 | + /** | ||
| 43 | + * 关注按钮文本 | ||
| 44 | + */ | ||
| 45 | + private StrokeWidthTextView btn_focus; | ||
| 46 | + private TextView tvTitle,tv_fans,tv_desc; | ||
| 47 | + private RelativeLayout rlcare; | ||
| 48 | + private View vline,vauthorheadframe; | ||
| 49 | + | ||
| 50 | + @Override | ||
| 51 | + public void prepareItem(View itemView, int position) { | ||
| 52 | + //荣誉头像框 | ||
| 53 | + imgavatarframe = itemView.findViewById(R.id.imgavatarframe); | ||
| 54 | + //用户头像边框 #000000 0.5 dp 5% | ||
| 55 | + vauthorheadframe = itemView.findViewById(R.id.vauthorheadframe); | ||
| 56 | + //用户头像 | ||
| 57 | + riv_author = itemView.findViewById(R.id.riv_author); | ||
| 58 | + //用户户V图标 | ||
| 59 | + ivvip = itemView.findViewById(R.id.ivvip); | ||
| 60 | + //用户名称 | ||
| 61 | + tvTitle = itemView.findViewById(R.id.tv_author); | ||
| 62 | + //粉丝数 | ||
| 63 | + tv_fans = itemView.findViewById(R.id.tv_fans); | ||
| 64 | + //粉丝数目和简介之间的分割线 | ||
| 65 | + ivtagsplitpoint = itemView.findViewById(R.id.ivtagsplitpoint); | ||
| 66 | + //用户简介 | ||
| 67 | + tv_desc = itemView.findViewById(R.id.tv_desc); | ||
| 68 | + //用户关注布局 | ||
| 69 | + rlcare = itemView.findViewById(R.id.rlcare); | ||
| 70 | + //用户关注+号 | ||
| 71 | + ivadd = itemView.findViewById(R.id.ivadd); | ||
| 72 | + //用户关注状态标签 已关注/关注 | ||
| 73 | + btn_focus = itemView.findViewById(R.id.btn_focus); | ||
| 74 | + //底线 | ||
| 75 | + vline = itemView.findViewById(R.id.vline); | ||
| 76 | + // 国殇 | ||
| 77 | + checkOpenGrayModel(itemView,position); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + @Override | ||
| 81 | + public void bindItem(View itemView, int position, NavigationBeanNews data) { | ||
| 82 | + if(data == null){ | ||
| 83 | + return; | ||
| 84 | + } | ||
| 85 | + List<ContentBean> subList = data.getSubList(); | ||
| 86 | + if(ArrayUtils.isEmpty(subList)){ | ||
| 87 | + return; | ||
| 88 | + } | ||
| 89 | + contentBean = subList.get(0); | ||
| 90 | + if(contentBean == null || contentBean.getRmhInfo() == null){ | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + //设置荣誉头像框 | ||
| 94 | + ImageUtils.getInstance().loadImage(imgavatarframe, contentBean.getRmhInfo().getHonoraryIcon(),-1); | ||
| 95 | + //设置头像 | ||
| 96 | + ImageUtils.getInstance().loadImageSourceByNetStatus(riv_author, | ||
| 97 | + contentBean.getRmhInfo().getRmhHeadUrl(), contentBean.getRmhInfo().isMaterUser() ? R.mipmap.icon_default_head_mater: R.mipmap.icon_default_head); | ||
| 98 | + //设置v标识 | ||
| 99 | + if(TextUtils.isEmpty(contentBean.getRmhInfo().getAuthIcon())){ | ||
| 100 | + ivvip.setVisibility(View.GONE); | ||
| 101 | + }else{ | ||
| 102 | + ImageUtils.getInstance().loadImageCircle(ivvip, | ||
| 103 | + contentBean.getRmhInfo().getAuthIcon(), -1); | ||
| 104 | + ivvip.setVisibility(View.VISIBLE); | ||
| 105 | + } | ||
| 106 | + String keyWord = StringUtils.isEqual(Constants.SEARCH_PEOPLE_ACCOUNT, | ||
| 107 | + contentBean.localFieldCommon) ? contentBean.getKeyWord() : ""; | ||
| 108 | + //设置用户昵称 | ||
| 109 | + setTittleValue(TextUtils.isEmpty(contentBean.getRmhInfo().getRmhName())?"": | ||
| 110 | + contentBean.getRmhInfo().getRmhName(),tvTitle, keyWord); | ||
| 111 | + int has = 0; | ||
| 112 | + //设置粉丝 | ||
| 113 | + if(TextUtils.isEmpty(contentBean.getRmhInfo().fansNum) || "0".equals(contentBean.getRmhInfo().fansNum)){ | ||
| 114 | + tv_fans.setText(""); | ||
| 115 | + }else{ | ||
| 116 | + has = has+1; | ||
| 117 | + tv_fans.setText("粉丝"+ NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.getRmhInfo().fansNum)); | ||
| 118 | + } | ||
| 119 | + //设置简介 | ||
| 120 | + if(TextUtils.isEmpty(contentBean.getRmhInfo().getRmhDesc())){ | ||
| 121 | + tv_desc.setText(""); | ||
| 122 | + }else{ | ||
| 123 | + has = has+1; | ||
| 124 | + tv_desc.setText(contentBean.getRmhInfo().getRmhDesc()); | ||
| 125 | + } | ||
| 126 | + //设置分割点 | ||
| 127 | + if(has == 2){ | ||
| 128 | + ivtagsplitpoint.setVisibility(View.VISIBLE); | ||
| 129 | + }else{ | ||
| 130 | + ivtagsplitpoint.setVisibility(View.GONE); | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + if (PDUtils.judgeIsSelf(contentBean.getRmhInfo().getUserId())){ | ||
| 134 | + rlcare.setVisibility(View.GONE); | ||
| 135 | + }else{ | ||
| 136 | + rlcare.setVisibility(View.VISIBLE); | ||
| 137 | + //设置关注状态 | ||
| 138 | + refreshCareState(contentBean.getRmhInfo().followStatus); | ||
| 139 | + } | ||
| 140 | + //点击关注/取消关注 | ||
| 141 | + rlcare.setOnClickListener(new BaseClickListener() { | ||
| 142 | + @Override | ||
| 143 | + protected void onNoDoubleClick(View v) { | ||
| 144 | + if(!PDUtils.isLogin()){ | ||
| 145 | + ProcessUtils.toOneKeyLoginActivity(); | ||
| 146 | + return; | ||
| 147 | + } | ||
| 148 | + if (PDUtils.judgeIsSelf(contentBean.getRmhInfo().getUserId())){ | ||
| 149 | + return; | ||
| 150 | + } | ||
| 151 | + int status = TextUtils.isEmpty(contentBean.getRmhInfo().followStatus)?0:Integer.parseInt(contentBean.getRmhInfo().followStatus); | ||
| 152 | +// CommonNetUtils.getInstance().operation(contentBean.getRmhInfo().getUserId(), | ||
| 153 | +// contentBean.getRmhInfo().getUserType(), | ||
| 154 | +// contentBean.getRmhInfo().getRmhId(), | ||
| 155 | +// status == 1 ?0:1, new BaseObserver<String>() { | ||
| 156 | +// @Override | ||
| 157 | +// protected void dealSpecialCode(int code, String message) { | ||
| 158 | +// | ||
| 159 | +// } | ||
| 160 | +// | ||
| 161 | +// @Override | ||
| 162 | +// protected void onSuccess(String s) { | ||
| 163 | +// if (status == 1) { | ||
| 164 | +// contentBean.getRmhInfo().followStatus = "0"; | ||
| 165 | +// }else{ | ||
| 166 | +// contentBean.getRmhInfo().followStatus = "1"; | ||
| 167 | +// } | ||
| 168 | +// refreshCareState(contentBean.getRmhInfo().followStatus); | ||
| 169 | +// if(status == 0){ | ||
| 170 | +// //执行任务:关注 | ||
| 171 | +// TaskManager.getInstance().executePointLevelOperate(TaskOperateTypeConstants.FOLLOW); | ||
| 172 | +// } | ||
| 173 | +// | ||
| 174 | +// EventMessage mEventMessage = new EventMessage(EventConstants.FRESH_FOLLOW_CREATOR_EVENT); | ||
| 175 | +// mEventMessage.putExtra(IntentConstants.USER_ID, contentBean.getRmhInfo().getUserId()); | ||
| 176 | +// mEventMessage.putExtra(IntentConstants.PARAM_CREATOR_ID, contentBean.getRmhInfo().getRmhId()); | ||
| 177 | +// mEventMessage.putExtra(IntentConstants.IS_FOLLOW, status == 1); | ||
| 178 | +// //全局刷新创作者关注状态 | ||
| 179 | +// LiveDataBus.getInstance().with(EventConstants.FRESH_FOLLOW_CREATOR_EVENT).postValue(mEventMessage); | ||
| 180 | +// } | ||
| 181 | +// }); | ||
| 182 | + } | ||
| 183 | + }); | ||
| 184 | + //跳转到号主页 | ||
| 185 | + itemView.setOnClickListener(new BaseClickListener() { | ||
| 186 | + @Override | ||
| 187 | + protected void onNoDoubleClick(View v) { | ||
| 188 | + //跳转个人中心页 | ||
| 189 | +// ProcessUtils.jumpToPersonalCenterActivity( | ||
| 190 | +// contentBean.getRmhInfo().getBanControl(), | ||
| 191 | +// contentBean.getRmhInfo().getCnMainControl(), | ||
| 192 | +// contentBean.getRmhInfo().getUserId(), | ||
| 193 | +// contentBean.getRmhInfo().getUserType(), | ||
| 194 | +// contentBean.getRmhInfo().getRmhId() | ||
| 195 | +// ); | ||
| 196 | + } | ||
| 197 | + }); | ||
| 198 | + | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + private void refreshCareState(String status) { | ||
| 202 | + int linesize = (int) rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp1); | ||
| 203 | + if ("1".equals(status)) { | ||
| 204 | + //已关注 | ||
| 205 | + rlcare.setPadding(0,0,0,0); | ||
| 206 | + rlcare.setBackground(ContextCompat.getDrawable(rlcare.getContext(), R.drawable.bg_follow_yes)); | ||
| 207 | + ivadd.setVisibility(View.GONE); | ||
| 208 | + btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C5)); | ||
| 209 | + btn_focus.setText(btn_focus.getContext().getResources().getString(R.string.res_followed)); | ||
| 210 | + }else{ | ||
| 211 | + rlcare.setPadding(0,0, (int) ResUtils.getDimension(R.dimen.rmrb_dp2),0); | ||
| 212 | + //未关注 | ||
| 213 | + rlcare.setBackground(FilletUtil.createRectangleDrawable(0x00000000, | ||
| 214 | + 0x1AED2800,linesize,rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp3))); | ||
| 215 | + ivadd.setVisibility(View.VISIBLE); | ||
| 216 | + btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C11)); | ||
| 217 | + btn_focus.setText(btn_focus.getContext().getResources().getString(R.string.res_follow)); | ||
| 218 | + } | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + @Override | ||
| 222 | + public int getItemViewType() { | ||
| 223 | + return R.layout.comp_single_row_allresultpeoplesaccount; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + @Override | ||
| 227 | + public int getItemSpan() { | ||
| 228 | + return 1; | ||
| 229 | + } | ||
| 230 | +} |
wdlayout/src/main/java/com/wd/capability/layout/comp/layoutmanager/channel/CompBanner01.java
0 → 100644
| 1 | +package com.wd.capability.layout.comp.layoutmanager.channel; | ||
| 2 | + | ||
| 3 | +import android.text.TextUtils; | ||
| 4 | +import android.view.View; | ||
| 5 | +import android.view.ViewGroup; | ||
| 6 | +import android.widget.CheckBox; | ||
| 7 | +import android.widget.ImageView; | ||
| 8 | +import android.widget.RelativeLayout; | ||
| 9 | + | ||
| 10 | +import com.wd.capability.layout.R; | ||
| 11 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 12 | +import com.wd.capability.layout.ui.widget.TagStokeWidthTextView; | ||
| 13 | +import com.wd.capability.layout.uitls.CompentLogicUtil; | ||
| 14 | +import com.wd.common.imageglide.ImageUtils; | ||
| 15 | +import com.wd.common.utils.ProcessUtils; | ||
| 16 | +import com.wd.common.viewclick.BaseClickListener; | ||
| 17 | +import com.wd.common.widget.RoundRectImageView; | ||
| 18 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 19 | +import com.wd.foundation.bean.custom.content.ContentTypeConstant; | ||
| 20 | +import com.wd.foundation.bean.custom.content.ManuscriptImageBean; | ||
| 21 | +import com.wd.foundation.wdkit.constant.Constants; | ||
| 22 | +import com.wd.foundation.wdkit.utils.DeviceUtil; | ||
| 23 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 24 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * 头图卡 | ||
| 28 | + * | ||
| 29 | + * @version 1.0.0 | ||
| 30 | + * @description: | ||
| 31 | + * @author: liyubing | ||
| 32 | + * @date :2023/2/6 16:21 | ||
| 33 | + */ | ||
| 34 | +public class CompBanner01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 35 | + private static final String TAG = "CompBanner01"; | ||
| 36 | + | ||
| 37 | + private CheckBox cbSelect; | ||
| 38 | + private RoundRectImageView imageView; | ||
| 39 | + | ||
| 40 | + private View flImage; | ||
| 41 | + private TagStokeWidthTextView tvTitle; | ||
| 42 | + // 标题 | ||
| 43 | + private boolean haveTitle = true; | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + @Override | ||
| 47 | + public int getItemViewType() { | ||
| 48 | + return R.layout.comp_banner_01; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public int getItemSpan() { | ||
| 53 | + return 1; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @Override | ||
| 57 | + public void prepareItem(View itemView, int position) { | ||
| 58 | + setFirstItemBg(itemView, position); | ||
| 59 | + | ||
| 60 | + View rlImage = itemView.findViewById(R.id.rlImage); | ||
| 61 | + if (position == 0 && isInChannelFlag()) { | ||
| 62 | + int top = (int) ResUtils.getDimension(R.dimen.rmrb_dp10); | ||
| 63 | + rlImage.setPadding(0, top, 0, 0); | ||
| 64 | + } else { | ||
| 65 | + int top = (int) ResUtils.getDimension(R.dimen.rmrb_dp14); | ||
| 66 | + rlImage.setPadding(0, top, 0, 0); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + imageView = itemView.findViewById(R.id.imageView); | ||
| 70 | + tvTitle = itemView.findViewById(R.id.tvTitle); | ||
| 71 | + flImage = itemView.findViewById(R.id.flImage); | ||
| 72 | + imageView.setRadius((int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp4)); | ||
| 73 | + cbSelect = initEdit(itemView); | ||
| 74 | + //适老化设置文字大小 | ||
| 75 | + setTextFontSize(tvTitle); | ||
| 76 | + checkOpenGrayModel(itemView, position); | ||
| 77 | + // 处理底线 | ||
| 78 | + ImageView bottomLine = itemView.findViewById(R.id.bottomLine); | ||
| 79 | + bottomLine(bottomLine); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Override | ||
| 83 | + public void bindItem(View itemView, int position, NavigationBeanNews data) { | ||
| 84 | + if (data != null && data.getSubList() != null && data.getSubList().size() > 0) { | ||
| 85 | + setLayoutManagerItemViewHeight(itemView, ViewGroup.LayoutParams.WRAP_CONTENT); | ||
| 86 | + contentBean = data.getSubList().get(0); | ||
| 87 | + | ||
| 88 | + if (section != null) { | ||
| 89 | + compStyle = section.getCompBean().getCompStyle(); | ||
| 90 | + } else { | ||
| 91 | + compStyle = contentBean.getAppStyle(); | ||
| 92 | + } | ||
| 93 | + itemViewRecordPublish(itemView); | ||
| 94 | + String title = contentBean.getNewsTitle(); | ||
| 95 | + // 检测稿件头图卡的标题,是否需要显示 | ||
| 96 | + if (String.valueOf(ContentTypeConstant.MANUSCRIPT_STYLE_FIVE).equals(compStyle)) { | ||
| 97 | + haveTitle = !TextUtils.isEmpty(title); | ||
| 98 | + } else { | ||
| 99 | + haveTitle = section.getCompBean().showTitleView(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + // 绘制图片 | ||
| 103 | + int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 104 | + float imageW = screenWith - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp32); | ||
| 105 | + float imageH = contentBean.getCalHeightByW(imageW); | ||
| 106 | + // 没有高度 设置默认高度 | ||
| 107 | + if (imageH == 0) { | ||
| 108 | + imageH = imageW * 9 / 16; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + RelativeLayout.LayoutParams imageViewLp = (RelativeLayout.LayoutParams) imageView.getLayoutParams(); | ||
| 112 | + imageViewLp.width = (int) imageW; | ||
| 113 | + imageViewLp.height = (int) imageH; | ||
| 114 | + imageView.setLayoutParams(imageViewLp); | ||
| 115 | + | ||
| 116 | + RelativeLayout.LayoutParams flImageLp = (RelativeLayout.LayoutParams) flImage.getLayoutParams(); | ||
| 117 | + flImageLp.width = (int) imageW; | ||
| 118 | + flImageLp.height = (int) imageH; | ||
| 119 | + flImage.setLayoutParams(flImageLp); | ||
| 120 | + | ||
| 121 | + | ||
| 122 | + String url = contentBean.getCoverUrl(); | ||
| 123 | + if (TextUtils.isEmpty(url) && contentBean.getManuscriptImageUrl() != null) { | ||
| 124 | + ManuscriptImageBean manuscriptImageBean = contentBean.getManuscriptImageUrl(); | ||
| 125 | + url = manuscriptImageBean.url; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + int placeHolder = R.drawable.rmrb_placeholder_compe_all; | ||
| 129 | + | ||
| 130 | + | ||
| 131 | + ImageUtils.getInstance().loadImageSourceByNetStatus(imageView, url, placeHolder); | ||
| 132 | + if (haveTitle) { | ||
| 133 | + boolean showTitleView = contentBean.showTitleContent(); | ||
| 134 | + if (showTitleView) { | ||
| 135 | + tvTitle.setVisibility(View.VISIBLE); | ||
| 136 | + //设置已读 | ||
| 137 | + setTittleValue(title, tvTitle, contentBean.getKeyWord()); | ||
| 138 | + //增加角标 | ||
| 139 | + CompentLogicUtil.showLabel(tvTitle, contentBean, true); | ||
| 140 | + } else { | ||
| 141 | + tvTitle.setVisibility(View.GONE); | ||
| 142 | + } | ||
| 143 | + } else { | ||
| 144 | + tvTitle.setVisibility(View.GONE); | ||
| 145 | + //21:文章专题,23:直播专题,24:话题专题,26时间轴专题 请求接口缓存 给H5使用 | ||
| 146 | + CompentLogicUtil.requestH5TopicCache(contentBean); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + itemView.setOnClickListener(new BaseClickListener() { | ||
| 150 | + @Override | ||
| 151 | + protected void onNoDoubleClick(View v) { | ||
| 152 | + if (cbSelect != null && Constants.isEdit) { | ||
| 153 | + boolean checked = cbSelect.isChecked(); | ||
| 154 | + cbSelect.setChecked(!checked); | ||
| 155 | + } else { | ||
| 156 | + ProcessUtils.processPage(contentBean); | ||
| 157 | + // 点击埋点 | ||
| 158 | + trackItemContent(true, contentBean, position, data.getLocalFiledType()); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + } | ||
| 162 | + }); | ||
| 163 | + // 收藏列表中用到,是否处于编辑模式 | ||
| 164 | + setEditState(cbSelect, contentBean); | ||
| 165 | + | ||
| 166 | + // 曝光埋点 | ||
| 167 | + itemView.post(() -> { | ||
| 168 | + trackItemContent(false, contentBean, position, data.getLocalFiledType()); | ||
| 169 | + | ||
| 170 | + }); | ||
| 171 | + } else { | ||
| 172 | + setLayoutManagerItemViewHeight(itemView, 0); | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | +} |
wdlayout/src/main/java/com/wd/capability/layout/comp/layoutmanager/channel/CompBanner02.java
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.capability.layout.comp.layoutmanager.channel; | ||
| 6 | + | ||
| 7 | +import android.view.LayoutInflater; | ||
| 8 | +import android.view.View; | ||
| 9 | +import android.view.ViewGroup; | ||
| 10 | +import android.widget.FrameLayout; | ||
| 11 | +import android.widget.ImageView; | ||
| 12 | +import android.widget.RelativeLayout; | ||
| 13 | + | ||
| 14 | +import androidx.annotation.NonNull; | ||
| 15 | +import androidx.core.content.ContextCompat; | ||
| 16 | +import androidx.recyclerview.widget.LinearLayoutManager; | ||
| 17 | +import androidx.recyclerview.widget.RecyclerView; | ||
| 18 | +import androidx.viewpager2.widget.ViewPager2; | ||
| 19 | + | ||
| 20 | +import com.chad.library.adapter.base.BaseQuickAdapter; | ||
| 21 | +import com.chad.library.adapter.base.BaseViewHolder; | ||
| 22 | +import com.wd.base.log.Logger; | ||
| 23 | +import com.wd.capability.layout.R; | ||
| 24 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 25 | +import com.wd.capability.layout.ui.widget.AnimIndicator; | ||
| 26 | +import com.wd.capability.layout.ui.widget.CompBanner; | ||
| 27 | +import com.wd.capability.layout.ui.widget.ParallelogramView; | ||
| 28 | +import com.wd.capability.layout.ui.widget.TagStokeWidthTextView; | ||
| 29 | +import com.wd.capability.layout.uitls.CompentLogicUtil; | ||
| 30 | +import com.wd.common.imageglide.ImageUtils; | ||
| 31 | +import com.wd.common.utils.ProcessUtils; | ||
| 32 | +import com.wd.common.viewclick.BaseClickListener; | ||
| 33 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 34 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 35 | +import com.wd.foundation.bean.response.MasterObjectData; | ||
| 36 | +import com.wd.foundation.wdkit.utils.DeviceUtil; | ||
| 37 | +import com.wd.foundation.wdkit.utils.TextViewUtils; | ||
| 38 | +import com.wd.foundation.wdkit.utils.ViewUtils; | ||
| 39 | +import com.wd.foundation.wdkit.view.RoundCornerImageView; | ||
| 40 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 41 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 42 | +import com.youth.banner.adapter.BannerAdapter; | ||
| 43 | + | ||
| 44 | +import java.util.List; | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * 轮播卡 | ||
| 48 | + * | ||
| 49 | + * @version 1.0.0 | ||
| 50 | + * @description: | ||
| 51 | + * @author: liyubing | ||
| 52 | + * @date :2023/2/6 16:48 | ||
| 53 | + */ | ||
| 54 | +public class CompBanner02 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 55 | + private static final String TAG = "CompBanner02"; | ||
| 56 | + | ||
| 57 | + private static final long PLAY_DELAY_TIME = 3000; | ||
| 58 | + /** | ||
| 59 | + * banner滑动需要时间 | ||
| 60 | + */ | ||
| 61 | + private static final int PLAY_SCROLL_TIME = 300; | ||
| 62 | + private CompBanner banner; | ||
| 63 | + | ||
| 64 | + private InnerBannerAdapter innerAdapter; | ||
| 65 | + | ||
| 66 | + // 指示器 | ||
| 67 | + private RecyclerView indicatorRv; | ||
| 68 | +// private MagicIndicator magicIndicator; | ||
| 69 | + | ||
| 70 | + private OnPageChangeCallback onPageChangeCallback; | ||
| 71 | + | ||
| 72 | + private IndicatorAdapter indicatorAdapter; | ||
| 73 | + | ||
| 74 | + // 选择的内容对象 | ||
| 75 | + private ContentBean selectContentBean; | ||
| 76 | + | ||
| 77 | + private float imageW; | ||
| 78 | + | ||
| 79 | + private float imageH; | ||
| 80 | + | ||
| 81 | + private float indicatorW; | ||
| 82 | + | ||
| 83 | + private int choosePosition = 0; | ||
| 84 | + /** | ||
| 85 | + * 逆向滚动 | ||
| 86 | + */ | ||
| 87 | + private int isReserve = -1; | ||
| 88 | + /** | ||
| 89 | + * 默认滑动偏移量 | ||
| 90 | + */ | ||
| 91 | + private int lastValue = -1; | ||
| 92 | + /** | ||
| 93 | + * 数据大小 | ||
| 94 | + */ | ||
| 95 | + private int size; | ||
| 96 | + /** | ||
| 97 | + * banner选择的下标 | ||
| 98 | + */ | ||
| 99 | + private int bannerIndex; | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 是否执行了pause方法 | ||
| 103 | + */ | ||
| 104 | + boolean isPause = false; | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 自动播放(默认开启) | ||
| 108 | + */ | ||
| 109 | + private boolean autoplay = true; | ||
| 110 | + | ||
| 111 | + @Override | ||
| 112 | + public int getItemViewType() { | ||
| 113 | + return R.layout.comp_banner_02; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @Override | ||
| 117 | + public int getItemSpan() { | ||
| 118 | + return 1; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + @Override | ||
| 122 | + public void prepareItem(View itemView, int position) { | ||
| 123 | + setFirstItemBg(itemView, position); | ||
| 124 | + setCompItemTopPadding(itemView, position); | ||
| 125 | + banner = itemView.findViewById(R.id.banner); | ||
| 126 | + indicatorRv = itemView.findViewById(R.id.indicatorRv); | ||
| 127 | + //indicatorRv.setNestedScrollingEnabled(false); | ||
| 128 | + // magicIndicator = itemView.findViewById(R.id.newIndicatorRv); | ||
| 129 | + | ||
| 130 | + int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 131 | + imageW = screenWith - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp32); | ||
| 132 | + imageH = imageW * 9 / 16; | ||
| 133 | + | ||
| 134 | + indicatorW = imageW; | ||
| 135 | + indicatorRv.getLayoutParams().width = (int) indicatorW; | ||
| 136 | + | ||
| 137 | + banner.getLayoutParams().height = (int) imageH; | ||
| 138 | + | ||
| 139 | + View flFrament = itemView.findViewById(R.id.flFrament); | ||
| 140 | + flFrament.getLayoutParams().height = (int) imageH; | ||
| 141 | + | ||
| 142 | + checkOpenGrayModel(itemView, position); | ||
| 143 | + | ||
| 144 | + // 处理底线 | ||
| 145 | + ImageView bottomLine = itemView.findViewById(R.id.bottomLine); | ||
| 146 | + bottomLine(bottomLine); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + @Override | ||
| 150 | + public void bindItem(View itemView, int position, NavigationBeanNews data) { | ||
| 151 | + Logger.t(TAG).d("bindItem position:" + position + " banner:" + banner); | ||
| 152 | + if (data == null) { | ||
| 153 | + setLayoutManagerItemViewHeight(itemView, 0); | ||
| 154 | + return; | ||
| 155 | + } | ||
| 156 | + List<ContentBean> dataBeanList = data.getSubList(); | ||
| 157 | + if (dataBeanList == null) { | ||
| 158 | + setLayoutManagerItemViewHeight(itemView, 0); | ||
| 159 | + return; | ||
| 160 | + } | ||
| 161 | + size = dataBeanList.size(); | ||
| 162 | + if (size == 0) { | ||
| 163 | + setLayoutManagerItemViewHeight(itemView, 0); | ||
| 164 | + return; | ||
| 165 | + } | ||
| 166 | + setLayoutManagerItemViewHeight(itemView, ViewGroup.LayoutParams.WRAP_CONTENT); | ||
| 167 | + | ||
| 168 | + if (size > 1) { | ||
| 169 | + banner.getViewPager2().setUserInputEnabled(true); | ||
| 170 | + } else { | ||
| 171 | + banner.getViewPager2().setUserInputEnabled(false); | ||
| 172 | + } | ||
| 173 | + // 上下滑动列表会重复调用bind,避免重复创建adapter | ||
| 174 | + // if (innerAdapter == null) { | ||
| 175 | + | ||
| 176 | + MasterObjectData masterObjectData = data.getMasterExtraData(); | ||
| 177 | + if(masterObjectData != null){ | ||
| 178 | + if( masterObjectData.containsKey("autoplay")){ | ||
| 179 | + autoplay = masterObjectData.getInt("autoplay") == 1; | ||
| 180 | + }else { | ||
| 181 | + autoplay = true; | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + }else { | ||
| 185 | + autoplay = true; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + | ||
| 189 | + innerAdapter = new InnerBannerAdapter(dataBeanList, data.getLocalFiledType()); | ||
| 190 | + // 默认3000ms循环播放 | ||
| 191 | + banner.setAdapter(innerAdapter) | ||
| 192 | + .setLoopTime(PLAY_DELAY_TIME) | ||
| 193 | + .setScrollTime(PLAY_SCROLL_TIME) | ||
| 194 | + .isAutoLoop(autoplay) | ||
| 195 | +// .setIndicator(new RectangleIndicator(banner.getContext())) | ||
| 196 | +// .setIndicatorWidth(UiUtils.dp2px(3), UiUtils.dp2px(10)) | ||
| 197 | +// .setIndicatorNormalColor(0x80B71D26) | ||
| 198 | +// .setIndicatorSelectedColor(0xB71D26) | ||
| 199 | +// .setIndicatorSpace(UiUtils.dp2px(4)) | ||
| 200 | + .addBannerLifecycleObserver(mFragment); | ||
| 201 | + setBannerPageChangeListener(); | ||
| 202 | + | ||
| 203 | + if (size > 1) { | ||
| 204 | + // 指示器 | ||
| 205 | + indicatorAdapter = new IndicatorAdapter(size); | ||
| 206 | + indicatorRv.setLayoutManager(new LinearLayoutManager(indicatorRv.getContext(), LinearLayoutManager.HORIZONTAL, false)); | ||
| 207 | + indicatorRv.setAdapter(indicatorAdapter); | ||
| 208 | + indicatorAdapter.addData(dataBeanList); | ||
| 209 | +// magicIndicator.setVisibility(View.VISIBLE); | ||
| 210 | +// CommonNavigator commonNavigator = new CommonNavigator(banner.getContext()); | ||
| 211 | +// commonNavigator.setAdjustMode(true); | ||
| 212 | +// commonNavigator.setAdapter(new CommonNavigatorAdapter() { | ||
| 213 | +// | ||
| 214 | +// @Override | ||
| 215 | +// public int getCount() { | ||
| 216 | +// return size; | ||
| 217 | +// } | ||
| 218 | +// | ||
| 219 | +// @Override | ||
| 220 | +// public IPagerTitleView getTitleView(Context context, int index) { | ||
| 221 | +// BannerTitleView clipPagerTitleView = new BannerTitleView(context); | ||
| 222 | +// if (index > 9) { | ||
| 223 | +// clipPagerTitleView.setText((index + 1) + ""); | ||
| 224 | +// } else { | ||
| 225 | +// clipPagerTitleView.setText("0" + (index + 1)); | ||
| 226 | +// } | ||
| 227 | +// clipPagerTitleView.setTextColor(AppContext.getContext().getResources().getColor(R.color.res_color_common_C4)); | ||
| 228 | +// clipPagerTitleView.setClipColor(Color.WHITE); | ||
| 229 | +// return clipPagerTitleView; | ||
| 230 | +// } | ||
| 231 | +// | ||
| 232 | +// @Override | ||
| 233 | +// public IPagerIndicator getIndicator(Context context) { | ||
| 234 | +// return null; | ||
| 235 | +// } | ||
| 236 | +// }); | ||
| 237 | +// magicIndicator.setNavigator(commonNavigator); | ||
| 238 | + } else { | ||
| 239 | + // magicIndicator.setVisibility(View.GONE); | ||
| 240 | + } | ||
| 241 | +// } else { | ||
| 242 | +//// onPause(); | ||
| 243 | +// innerAdapter.notifyDataSetChanged(); | ||
| 244 | +// | ||
| 245 | +// } | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + /** | ||
| 249 | + * 处理banner滑动动画 | ||
| 250 | + */ | ||
| 251 | + private void setBannerPageChangeListener() { | ||
| 252 | + if (onPageChangeCallback == null) { | ||
| 253 | + onPageChangeCallback = new OnPageChangeCallback(); | ||
| 254 | + } | ||
| 255 | + banner.getViewPager2().registerOnPageChangeCallback(onPageChangeCallback); | ||
| 256 | + | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | +// @Override | ||
| 260 | +// public void OnBannerClick(ContentBean data, int position) { | ||
| 261 | +// | ||
| 262 | +// } | ||
| 263 | + | ||
| 264 | + | ||
| 265 | + @Override | ||
| 266 | + public void onPause() { | ||
| 267 | + super.onPause(); | ||
| 268 | + Logger.t(TAG).d("onPause"); | ||
| 269 | + if (banner != null && autoplay) { | ||
| 270 | + banner.stop().isAutoLoop(false); | ||
| 271 | + isPause = true; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + @Override | ||
| 277 | + public void onResume() { | ||
| 278 | + super.onResume(); | ||
| 279 | + Logger.t(TAG).d("onResume"); | ||
| 280 | + | ||
| 281 | + if(autoplay){ | ||
| 282 | + banner.isAutoLoop(true).start(); | ||
| 283 | + if (isPause){ | ||
| 284 | + if (bannerIndex == size){ | ||
| 285 | + banner.setCurrentItem(1); | ||
| 286 | + }else{ | ||
| 287 | + banner.setCurrentItem(bannerIndex+1); | ||
| 288 | + } | ||
| 289 | + } | ||
| 290 | + isPause = false; | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + } | ||
| 294 | + | ||
| 295 | + @Override | ||
| 296 | + public void onVisible() { | ||
| 297 | + super.onVisible(); | ||
| 298 | + Logger.t(TAG).d("onVisible"); | ||
| 299 | + if(autoplay){ | ||
| 300 | + banner.isAutoLoop(true).start(); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + @Override | ||
| 306 | + public void onInvisible() { | ||
| 307 | + super.onInvisible(); | ||
| 308 | + Logger.t(TAG).d("onInvisible"); | ||
| 309 | + if (banner != null && autoplay) { | ||
| 310 | + banner.stop().isAutoLoop(false); | ||
| 311 | + } | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + /** | ||
| 315 | + * 自定义布局 | ||
| 316 | + * | ||
| 317 | + * @author zhangbo | ||
| 318 | + * @version [V1.0.0, 2022/3/23] | ||
| 319 | + * @since V1.0.0 | ||
| 320 | + */ | ||
| 321 | + private class InnerBannerAdapter extends BannerAdapter<ContentBean, InnerBannerAdapter.BannerViewHolder> { | ||
| 322 | + | ||
| 323 | + | ||
| 324 | + private String type; | ||
| 325 | + | ||
| 326 | + private int size; | ||
| 327 | + | ||
| 328 | + private InnerBannerAdapter(List<ContentBean> data, String type) { | ||
| 329 | + super(data); | ||
| 330 | + this.size = data.size(); | ||
| 331 | + this.type = type; | ||
| 332 | + // int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + @Override | ||
| 336 | + public BannerViewHolder onCreateHolder(ViewGroup parent, int viewType) { | ||
| 337 | + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.comp_banner_02_adpter_item, parent, false); | ||
| 338 | + return new BannerViewHolder(view); | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + @Override | ||
| 342 | + public void onBindView(BannerViewHolder holder, ContentBean data, int position, int size) { | ||
| 343 | + | ||
| 344 | + if (data == null) { | ||
| 345 | + return; | ||
| 346 | + } | ||
| 347 | + | ||
| 348 | +// int goalH = data.getCalHeightByW(imageW); | ||
| 349 | +// if (goalH != 0) { | ||
| 350 | +// FrameLayout.LayoutParams imageViewLp = (FrameLayout.LayoutParams) holder.imageView.getLayoutParams(); | ||
| 351 | +// imageViewLp.height = goalH; | ||
| 352 | +// holder.imageView.setLayoutParams(imageViewLp); | ||
| 353 | +// } | ||
| 354 | + | ||
| 355 | + | ||
| 356 | + String url = data.getCoverUrl(); | ||
| 357 | +// if (goalH > 0) { | ||
| 358 | + //ImageUtils.getInstance().loadImage(holder.imageView, url, R.drawable.rmrb_placeholder_w16h9); | ||
| 359 | + //ImageUtils.getInstance().loadAngleImage(holder.imageView, url, R.drawable.rmrb_placeholder_w16h9, 4); | ||
| 360 | + ImageUtils.getInstance().loadImageSourceByNetStatus(holder.imageView, url, R.drawable.rmrb_placeholder_compe_all); | ||
| 361 | +// } else { | ||
| 362 | +// ImageUtils.getInstance().loadImageSource(holder.imageView, url, new LoadImageCallback() { | ||
| 363 | +// @Override | ||
| 364 | +// public void callbackBitmap(Bitmap bitmap) { | ||
| 365 | +// int with = bitmap.getWidth(); | ||
| 366 | +// int height = bitmap.getHeight(); | ||
| 367 | +// } | ||
| 368 | +// }); | ||
| 369 | +// } | ||
| 370 | + | ||
| 371 | + FrameLayout.LayoutParams imageViewLp = (FrameLayout.LayoutParams) holder.imageView.getLayoutParams(); | ||
| 372 | +// imageViewLp.width = (int) imageW; | ||
| 373 | + imageViewLp.height = (int) imageH; | ||
| 374 | + holder.imageView.setLayoutParams(imageViewLp); | ||
| 375 | + | ||
| 376 | + TextViewUtils.setText(holder.titleView, data.getNewsTitle()); | ||
| 377 | + //适老化文字大小设置 | ||
| 378 | + setTextFontSize(holder.titleView); | ||
| 379 | + | ||
| 380 | + // 处理频道和发布日期 | ||
| 381 | +// CompentLogicUtil.handlerFromDataInfor(holder.llFromm, data); | ||
| 382 | + | ||
| 383 | + data.isSupportThemeColor = false; | ||
| 384 | + //增加角标 | ||
| 385 | + CompentLogicUtil.showLabel(holder.titleView, data, true); | ||
| 386 | + // 加标签 | ||
| 387 | + CompentLogicUtil.handleBannerTagViewLogic(holder.viewTag, data); | ||
| 388 | + // 曝光埋点 | ||
| 389 | + holder.itemView.post(() -> { | ||
| 390 | + trackItemContent(false, data, position, innerAdapter.type); | ||
| 391 | + | ||
| 392 | + }); | ||
| 393 | + | ||
| 394 | + holder.itemView.setOnClickListener(new BaseClickListener() { | ||
| 395 | + @Override | ||
| 396 | + protected void onNoDoubleClick(View v) { | ||
| 397 | + if (data != null) { | ||
| 398 | + // 业务内部跳转 | ||
| 399 | + selectContentBean = data; | ||
| 400 | + ProcessUtils.processPage(data); | ||
| 401 | + //更新已读状态 | ||
| 402 | + if (data.getCompAdvBean() != null) { | ||
| 403 | + //只有广告需要处理 | ||
| 404 | + updateReadState(holder.titleView, data); | ||
| 405 | + } | ||
| 406 | + | ||
| 407 | + // 点击埋点 | ||
| 408 | + trackItemContent(true, data, position, innerAdapter.type); | ||
| 409 | + } else { | ||
| 410 | + Logger.t(TAG).e("OnBannerClick data is null"); | ||
| 411 | + // 数据为空,也抛出去统一处理 | ||
| 412 | + } | ||
| 413 | + } | ||
| 414 | + }); | ||
| 415 | + //设置已读 | ||
| 416 | + if (data.getCompAdvBean() != null) { | ||
| 417 | + //只有广告需要处理 | ||
| 418 | + setReadState(holder.titleView, data, R.color.white); | ||
| 419 | + } else { | ||
| 420 | + holder.titleView.setTextColor(ContextCompat.getColor(holder.titleView.getContext(), R.color.white)); | ||
| 421 | + } | ||
| 422 | + } | ||
| 423 | + | ||
| 424 | + /** | ||
| 425 | + * 自定义布局holder | ||
| 426 | + * | ||
| 427 | + * @author zhangbo | ||
| 428 | + * @version [V1.0.0, 2022/3/23] | ||
| 429 | + * @since V1.0.0 | ||
| 430 | + */ | ||
| 431 | + private class BannerViewHolder extends RecyclerView.ViewHolder { | ||
| 432 | + | ||
| 433 | + RoundCornerImageView imageView; | ||
| 434 | + | ||
| 435 | + FrameLayout flImage; | ||
| 436 | + | ||
| 437 | + TagStokeWidthTextView titleView; | ||
| 438 | + | ||
| 439 | + View viewTag; | ||
| 440 | + | ||
| 441 | + | ||
| 442 | + BannerViewHolder(@NonNull View view) { | ||
| 443 | + super(view); | ||
| 444 | + initView(view); | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + private void initView(View view) { | ||
| 448 | + flImage = ViewUtils.findViewById(view, R.id.flImage); | ||
| 449 | + imageView = ViewUtils.findViewById(view, R.id.imageView); | ||
| 450 | + titleView = ViewUtils.findViewById(view, R.id.tvTitle); | ||
| 451 | +// llFromm = ViewUtils.findViewById(view, R.id.llFromm); | ||
| 452 | + viewTag = ViewUtils.findViewById(view, R.id.viewTag); | ||
| 453 | + | ||
| 454 | +// int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 455 | +// float imageW = screenWith - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp32); | ||
| 456 | + | ||
| 457 | + RelativeLayout.LayoutParams flImageLp = (RelativeLayout.LayoutParams) flImage.getLayoutParams(); | ||
| 458 | + flImageLp.height = (int) imageH; | ||
| 459 | +// flImageLp.width = (int) imageW; | ||
| 460 | + flImage.setLayoutParams(flImageLp); | ||
| 461 | + | ||
| 462 | +// RecyclerView.LayoutParams rlParentItemLp = (RecyclerView.LayoutParams) rlParentItem.getLayoutParams(); | ||
| 463 | +// rlParentItemLp.width = (int) imageW; | ||
| 464 | + | ||
| 465 | + RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) titleView.getLayoutParams(); | ||
| 466 | +// lp.width = (int) imageW; | ||
| 467 | + lp.height = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp94); | ||
| 468 | + int paddLr = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp12); | ||
| 469 | + if (size > 1) { | ||
| 470 | + titleView.setPadding(paddLr, 0, paddLr, (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp26)); | ||
| 471 | + } else { | ||
| 472 | + titleView.setPadding(paddLr, 0, paddLr, paddLr); | ||
| 473 | + } | ||
| 474 | + } | ||
| 475 | + } | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + class OnPageChangeCallback extends ViewPager2.OnPageChangeCallback { | ||
| 479 | + | ||
| 480 | + @Override | ||
| 481 | + public void onPageSelected(int position) { | ||
| 482 | + super.onPageSelected(position); | ||
| 483 | + Logger.t(TAG).d("onPageSelected position:" + position); | ||
| 484 | + //magicIndicator.onPageSelected(position - 1); | ||
| 485 | + bannerIndex = position; | ||
| 486 | + if (indicatorAdapter != null) { | ||
| 487 | + indicatorAdapter.setCurrentIndex(position - 1); | ||
| 488 | + } | ||
| 489 | + } | ||
| 490 | + | ||
| 491 | + @Override | ||
| 492 | + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | ||
| 493 | + // magicIndicator.onPageScrolled(position - 1, positionOffset, positionOffsetPixels); | ||
| 494 | + //判断当前是正向滚动还是逆向滚动 | ||
| 495 | + if (positionOffsetPixels != 0) { | ||
| 496 | + if (lastValue > positionOffsetPixels) { | ||
| 497 | + //右滑 | ||
| 498 | + isReserve = 0; | ||
| 499 | + } else if (lastValue < positionOffsetPixels) { | ||
| 500 | + //左滑 | ||
| 501 | + isReserve = 1; | ||
| 502 | + } | ||
| 503 | + } | ||
| 504 | + lastValue = positionOffsetPixels; | ||
| 505 | + } | ||
| 506 | + | ||
| 507 | + @Override | ||
| 508 | + public void onPageScrollStateChanged(int state) { | ||
| 509 | + // magicIndicator.onPageScrollStateChanged(state); | ||
| 510 | + } | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + /** | ||
| 514 | + * 指示器适配器 | ||
| 515 | + */ | ||
| 516 | + private class IndicatorAdapter extends BaseQuickAdapter<ContentBean, BaseViewHolder> { | ||
| 517 | + | ||
| 518 | + | ||
| 519 | + private int position = 0; | ||
| 520 | + | ||
| 521 | + int itemWith = 0; | ||
| 522 | + int size = 0; | ||
| 523 | + | ||
| 524 | + public IndicatorAdapter(int size) { | ||
| 525 | + super(R.layout.comp_banner_02_adpter_line_num_indicator); | ||
| 526 | +// float screenWith = DeviceUtil.getDeviceWidth() - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp28) * 2; | ||
| 527 | + itemWith = (int) ((indicatorW - ResUtils.getDimension(R.dimen.rmrb_dp20)) / size); | ||
| 528 | + this.size = size; | ||
| 529 | + } | ||
| 530 | + | ||
| 531 | + | ||
| 532 | + @Override | ||
| 533 | + protected void convert(@NonNull BaseViewHolder baseViewHolder, ContentBean bean) { | ||
| 534 | + | ||
| 535 | + RelativeLayout llParent = baseViewHolder.itemView.findViewById(R.id.llParent); | ||
| 536 | + ViewGroup.LayoutParams llParentLp = llParent.getLayoutParams(); | ||
| 537 | + llParentLp.width = itemWith; | ||
| 538 | + | ||
| 539 | + int layoutPosition = baseViewHolder.getLayoutPosition(); | ||
| 540 | + | ||
| 541 | + AnimIndicator animIndicator = llParent.findViewById(R.id.animIndicator); | ||
| 542 | + animIndicator.setAutoLoop(autoplay); | ||
| 543 | + ParallelogramView ivLine = llParent.findViewById(R.id.ivLine); | ||
| 544 | + //当从数据的最后一条轮到第一条时,banner的轮播时间loopTime需要减去滑动时间scrollTime,不然就会出现动效未加载完,但是已经滑到下一个的情况 | ||
| 545 | + if (position == 0) { | ||
| 546 | + if (choosePosition == size - 1 && isReserve == 1) { | ||
| 547 | + animIndicator.setAnimTime(PLAY_DELAY_TIME - PLAY_SCROLL_TIME); | ||
| 548 | + } else { | ||
| 549 | + animIndicator.setAnimTime(PLAY_DELAY_TIME); | ||
| 550 | + } | ||
| 551 | + } else if (position == size - 1) { | ||
| 552 | + if (choosePosition == 0 && isReserve == 0) { | ||
| 553 | + animIndicator.setAnimTime(PLAY_DELAY_TIME - PLAY_SCROLL_TIME); | ||
| 554 | + } else { | ||
| 555 | + animIndicator.setAnimTime(PLAY_DELAY_TIME); | ||
| 556 | + } | ||
| 557 | + } else { | ||
| 558 | + animIndicator.setAnimTime(PLAY_DELAY_TIME); | ||
| 559 | + } | ||
| 560 | + if (position == layoutPosition) { | ||
| 561 | + String text = ""; | ||
| 562 | + if (layoutPosition >= 9) { | ||
| 563 | + text = (layoutPosition + 1) + ""; | ||
| 564 | + } else { | ||
| 565 | + text = ("0" + (layoutPosition + 1)); | ||
| 566 | + } | ||
| 567 | + animIndicator.setTvNum(text, itemWith); | ||
| 568 | + animIndicator.setVisibility(View.VISIBLE); | ||
| 569 | + animIndicator.startOrStopRunning(true); | ||
| 570 | + ivLine.setVisibility(View.GONE); | ||
| 571 | + choosePosition = position; | ||
| 572 | + } else { | ||
| 573 | + animIndicator.setAllInVisible(); | ||
| 574 | + animIndicator.startOrStopRunning(false); | ||
| 575 | + ivLine.setVisibility(View.VISIBLE); | ||
| 576 | + } | ||
| 577 | + } | ||
| 578 | + | ||
| 579 | + | ||
| 580 | + public void setCurrentIndex(int position) { | ||
| 581 | + if (position >= 0) { | ||
| 582 | + this.position = position; | ||
| 583 | + notifyDataSetChanged(); | ||
| 584 | + } | ||
| 585 | + } | ||
| 586 | + | ||
| 587 | + } | ||
| 588 | + | ||
| 589 | + | ||
| 590 | +} |
-
Please register or login to post a comment