Compare commits
165 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dba41c22f | ||
|
|
7c44f09803 | ||
|
|
0b89ac21e8 | ||
|
|
238181deca | ||
|
|
56ae033523 | ||
|
|
f772a64507 | ||
|
|
8c75317ddc | ||
|
|
256c19a09e | ||
|
|
82c1d15ca5 | ||
|
|
aff5a178a0 | ||
|
|
04b1764f7b | ||
|
|
076f7130c8 | ||
|
|
b7842d5ac9 | ||
|
|
eb5aebda51 | ||
|
|
6990bd13ed | ||
|
|
c18af48fbb | ||
|
|
68e6f5df1b | ||
|
|
dc46ffc5b6 | ||
|
|
c58a5a9a55 | ||
|
|
e2ee742091 | ||
|
|
bcc86a899c | ||
|
|
b60031d2d0 | ||
|
|
54aa5fee67 | ||
|
|
816fd21fbc | ||
|
|
92e6b563e4 | ||
|
|
d7bc2615d6 | ||
|
|
21473b1d69 | ||
|
|
9bdee649d8 | ||
|
|
f1a8cd3a68 | ||
|
|
a39005b1a9 | ||
|
|
ec1197e5da | ||
|
|
45372f37b8 | ||
|
|
df93b9495a | ||
|
|
86d730cdf1 | ||
|
|
f356446c03 | ||
|
|
bf7bc6b786 | ||
|
|
6a3c15e3e7 | ||
|
|
07d3b190e2 | ||
|
|
27b316d39b | ||
|
|
f928fcd4bc | ||
|
|
adcafc7e16 | ||
|
|
b191dfb1be | ||
|
|
192b0cb417 | ||
|
|
a2435cbe95 | ||
|
|
8925d478da | ||
|
|
926de0463c | ||
|
|
993b09b853 | ||
|
|
e6c8495158 | ||
|
|
e15953dc64 | ||
|
|
4ff529ace9 | ||
|
|
530622c72c | ||
|
|
7f38739ddc | ||
|
|
bc549d52f6 | ||
|
|
14f0de093e | ||
|
|
51457738d2 | ||
|
|
d8a0427791 | ||
|
|
8abf92d42c | ||
|
|
fc2d700a31 | ||
|
|
867029fa3a | ||
|
|
52e199b901 | ||
|
|
c5d537fb4d | ||
|
|
e081f1e058 | ||
|
|
7bedf93dd5 | ||
|
|
000929fd02 | ||
|
|
3e5ba2ba19 | ||
|
|
a25ce2034f | ||
|
|
1625135d0c | ||
|
|
add3589683 | ||
|
|
45a5d6ad61 | ||
|
|
7b62409bf1 | ||
|
|
45ad8a9810 | ||
|
|
a788c347de | ||
|
|
c3d4cb8d62 | ||
|
|
916a1447f0 | ||
|
|
b2ee091c03 | ||
|
|
cf169e9a4e | ||
|
|
ea0ff70595 | ||
|
|
ce37918745 | ||
|
|
260b615d2b | ||
|
|
45566001a7 | ||
|
|
12482b6624 | ||
|
|
2d7684a5c8 | ||
|
|
c1d6b67322 | ||
|
|
69c0d5f28a | ||
|
|
d541a4d506 | ||
|
|
4b46c72f5a | ||
|
|
e191fb82a3 | ||
|
|
32ebfa719d | ||
|
|
c94f549531 | ||
|
|
6d98afa319 | ||
| 20ccb37ccf | |||
|
|
79fa6be313 | ||
|
|
210e755fed | ||
| a6faf12ff6 | |||
|
|
e2148c3f31 | ||
|
|
869ca75464 | ||
|
|
ce48a7dcf0 | ||
|
|
866024ae95 | ||
| b40abb9bc0 | |||
|
|
37217e529e | ||
|
|
eedbbb5304 | ||
| 4b3b47b65f | |||
| c015459cf1 | |||
| 326ced4646 | |||
| 18970c22cf | |||
| 00db8a00c7 | |||
|
|
0756dd9560 | ||
| f3195bbcf8 | |||
| 4e4b5f90bb | |||
| 3150489384 | |||
| 9ff382e35b | |||
| bcd8f7af52 | |||
| 3595b89672 | |||
| 6e8842d30d | |||
| 7b5cd9b797 | |||
| 9ec241f2a3 | |||
| a876018b0a | |||
| ea397af123 | |||
| a475e5dc2f | |||
| 54258c3f13 | |||
| d383a08013 | |||
|
|
fed6289f67 | ||
|
|
9b301eba25 | ||
| d1edf6bdd8 | |||
|
|
7ca8694aed | ||
|
|
406c67bf3a | ||
|
|
d643df72bc | ||
| a3dacf1f59 | |||
| 37605f46b7 | |||
|
|
a4895df622 | ||
| fc63cbbf50 | |||
| b7ba717cb9 | |||
| 0c5ef0befe | |||
|
|
84d4423069 | ||
|
|
0721ff4f37 | ||
| a5b0ee757c | |||
|
|
82fd35305a | ||
| e89e82483b | |||
| 57bda40a82 | |||
|
|
93aa8e55e5 | ||
| 2e907bc1ed | |||
| 8d984951c3 | |||
|
|
dd6600a89e | ||
|
|
233469c7e4 | ||
| 357ece2ebe | |||
|
|
72e9633045 | ||
|
|
7a31ca52da | ||
|
|
33930f3e32 | ||
| 8e19ddcc99 | |||
|
|
1a58311e26 | ||
| 9360e5438c | |||
| fa8d8a7421 | |||
|
|
bebf0820ca | ||
| e1f4e8dde4 | |||
| 2b59b1b4fe | |||
| cee1476ab1 | |||
| 20a6bae5ff | |||
| b6732adfd2 | |||
| bec031688e | |||
| 7f11195ede | |||
| d4ff9c3072 | |||
| 0a442e7df9 | |||
| 52f1a78e36 | |||
|
|
6bcaf2ba9c | ||
|
|
3de972d12c |
@@ -1,96 +1,96 @@
|
||||
<resources>
|
||||
|
||||
<string name="camera_dialog_title">警告</string>
|
||||
<string name="sorry_no_permission">抱歉,你所使用的证书权限或SDK不包括该功能。</string>
|
||||
<string name="camera_dialog_message">相机权限被禁用或者相机被别的应用占用!</string>
|
||||
<string name="camera_dialog_open">重试</string>
|
||||
<string name="sorry_no_permission">抱歉,你所使用的證書權限或SDK不包括該功能。</string>
|
||||
<string name="camera_dialog_message">相機權限被禁用或者相機被別的應用佔用!</string>
|
||||
<string name="camera_dialog_open">重試</string>
|
||||
<string name="camera_dialog_back">退出</string>
|
||||
|
||||
<string name="fu_base_debug">Resolution:\n\t%dX%d\nFPS: %d\nRender time:\n\t%dms</string>
|
||||
<string name="save_photo_success">保存照片成功!</string>
|
||||
<string name="save_video_success">保存视频成功!</string>
|
||||
<string name="save_video_failed">保存视频失败!</string>
|
||||
<string name="save_video_too_short">视频太短啦!</string>
|
||||
<string name="save_video_wait">视频处理中请稍等</string>
|
||||
<string name="fu_base_is_tracking_text">未检测到人脸</string>
|
||||
<string name="fu_base_incomplete_face_text">人脸不全</string>
|
||||
<string name="fu_base_input_type_single">单输入</string>
|
||||
<string name="fu_base_input_type_double">双输入</string>
|
||||
<string name="save_video_success">保存視頻成功!</string>
|
||||
<string name="save_video_failed">保存視頻失敗!</string>
|
||||
<string name="save_video_too_short">視頻太短啦!</string>
|
||||
<string name="save_video_wait">視頻處理中請稍等</string>
|
||||
<string name="fu_base_is_tracking_text">未檢測到人臉</string>
|
||||
<string name="fu_base_incomplete_face_text">人臉不全</string>
|
||||
<string name="fu_base_input_type_single">單輸入</string>
|
||||
<string name="fu_base_input_type_double">雙輸入</string>
|
||||
|
||||
<string name="beauty_box_heavy_blur_fine">磨皮</string>
|
||||
<string name="beauty_box_color_level">美白</string>
|
||||
<string name="beauty_box_red_level">红润</string>
|
||||
<string name="beauty_box_sharpen">锐化</string>
|
||||
<string name="beauty_box_red_level">紅潤</string>
|
||||
<string name="beauty_box_sharpen">銳化</string>
|
||||
<string name="beauty_box_eye_bright">亮眼</string>
|
||||
<string name="beauty_box_tooth_whiten">美牙</string>
|
||||
<string name="beauty_box_eye_enlarge">大眼</string>
|
||||
<string name="beauty_box_eye_circle">圆眼</string>
|
||||
<string name="beauty_box_eye_circle">圓眼</string>
|
||||
<string name="beauty_box_cheek_natural">自然</string>
|
||||
<string name="beauty_box_cheek_goddess">女神</string>
|
||||
<string name="beauty_box_cheek_long_face">长脸</string>
|
||||
<string name="beauty_box_cheek_round_face">圆脸</string>
|
||||
<string name="beauty_box_cheek_thinning">瘦脸</string>
|
||||
<string name="beauty_box_cheek_v">V脸</string>
|
||||
<string name="beauty_box_cheek_narrow">窄脸</string>
|
||||
<string name="beauty_box_cheek_short">短脸</string>
|
||||
<string name="beauty_box_cheek_small">小脸</string>
|
||||
<string name="beauty_box_cheek_long_face">長臉</string>
|
||||
<string name="beauty_box_cheek_round_face">圓臉</string>
|
||||
<string name="beauty_box_cheek_thinning">瘦臉</string>
|
||||
<string name="beauty_box_cheek_v">V臉</string>
|
||||
<string name="beauty_box_cheek_narrow">窄臉</string>
|
||||
<string name="beauty_box_cheek_short">短臉</string>
|
||||
<string name="beauty_box_cheek_small">小臉</string>
|
||||
<string name="beauty_box_intensity_chin">下巴</string>
|
||||
<string name="beauty_box_intensity_forehead">额头</string>
|
||||
<string name="beauty_box_intensity_forehead">額頭</string>
|
||||
<string name="beauty_box_intensity_nose">瘦鼻</string>
|
||||
<string name="beauty_box_intensity_mouth">嘴型</string>
|
||||
<string name="beauty_box_cheekbones">瘦颧骨</string>
|
||||
<string name="beauty_box_lower_jaw">瘦下颌骨</string>
|
||||
<string name="beauty_radio_skin_beauty">美肤</string>
|
||||
<string name="beauty_box_cheekbones">瘦顴骨</string>
|
||||
<string name="beauty_box_lower_jaw">瘦下頜骨</string>
|
||||
<string name="beauty_radio_skin_beauty">美膚</string>
|
||||
<string name="beauty_radio_face_shape">美型</string>
|
||||
<string name="beauty_radio_filter">滤镜</string>
|
||||
<string name="beauty_radio_style">风格推荐</string>
|
||||
<string name="beauty_radio_filter">濾鏡</string>
|
||||
<string name="beauty_radio_style">風格推薦</string>
|
||||
<string name="beauty_micro_pouch">去黑眼圈</string>
|
||||
<string name="beauty_micro_nasolabial">去法令纹</string>
|
||||
<string name="beauty_micro_nasolabial">去法令紋</string>
|
||||
<string name="beauty_micro_smile">微笑嘴角</string>
|
||||
<string name="beauty_brow_height">眉毛上下</string>
|
||||
<string name="beauty_brow_space">眉间距</string>
|
||||
<string name="beauty_micro_canthus">开眼角</string>
|
||||
<string name="beauty_micro_philtrum">缩人中</string>
|
||||
<string name="beauty_micro_long_nose">长鼻</string>
|
||||
<string name="beauty_brow_space">眉間距</string>
|
||||
<string name="beauty_micro_canthus">開眼角</string>
|
||||
<string name="beauty_micro_philtrum">縮人中</string>
|
||||
<string name="beauty_micro_long_nose">長鼻</string>
|
||||
<string name="beauty_micro_eye_space">眼距</string>
|
||||
<string name="beauty_micro_eye_rotate">眼睛角度</string>
|
||||
|
||||
<string name="makeup_radio_lipstick">口红</string>
|
||||
<string name="makeup_radio_blusher">腮红</string>
|
||||
<string name="makeup_radio_lipstick">口紅</string>
|
||||
<string name="makeup_radio_blusher">腮紅</string>
|
||||
<string name="makeup_radio_eyebrow">眉毛</string>
|
||||
<string name="makeup_radio_eye_shadow">眼影</string>
|
||||
<string name="makeup_radio_eye_liner">眼线</string>
|
||||
<string name="makeup_radio_eye_liner">眼線</string>
|
||||
<string name="makeup_radio_eyelash">睫毛</string>
|
||||
<string name="makeup_radio_contact_lens">美瞳</string>
|
||||
<string name="makeup_radio_foundation">粉底</string>
|
||||
<string name="makeup_radio_highlight">高光</string>
|
||||
<string name="makeup_radio_shadow">阴影</string>
|
||||
<string name="makeup_radio_remove">卸妆</string>
|
||||
<string name="makeup_customize">自定义</string>
|
||||
<string name="makeup_radio_shadow">陰影</string>
|
||||
<string name="makeup_radio_remove">卸妝</string>
|
||||
<string name="makeup_customize">自定義</string>
|
||||
<string name="makeup_peach_blossom">桃花</string>
|
||||
<string name="makeup_boyfriend">男友</string>
|
||||
<string name="makeup_clear">清透</string>
|
||||
<string name="makeup_grapefruit">西柚</string>
|
||||
<string name="select_data_photo">选择图片</string>
|
||||
<string name="select_data_video">选择视频</string>
|
||||
<string name="select_data_title">请从相册中选择图片或视频</string>
|
||||
<string name="image_file_does_not_exist">所选图片文件不存在。</string>
|
||||
<string name="video_file_does_not_exist">所选视频文件不存在。</string>
|
||||
<string name="select_data_photo">選擇圖片</string>
|
||||
<string name="select_data_video">選擇視頻</string>
|
||||
<string name="select_data_title">請從相冊中選擇圖片或視頻</string>
|
||||
<string name="image_file_does_not_exist">所選圖片文件不存在。</string>
|
||||
<string name="video_file_does_not_exist">所選視頻文件不存在。</string>
|
||||
|
||||
<string name="future_warrior">张嘴试试</string>
|
||||
<string name="jet_mask">鼓腮帮子</string>
|
||||
<string name="sdx2">皱眉试试</string>
|
||||
<string name="future_warrior">張嘴試試</string>
|
||||
<string name="jet_mask">鼓腮幫子</string>
|
||||
<string name="sdx2">皺眉試試</string>
|
||||
<string name="luhantongkuan_ztt_fu">眨一眨眼</string>
|
||||
<string name="qingqing_ztt_fu">嘟嘴试试</string>
|
||||
<string name="xiaobianzi_zh_fu">微笑触发</string>
|
||||
<string name="xiaoxueshen_ztt_fu">吹气触发</string>
|
||||
<string name="hez_ztt_fu">张嘴试试</string>
|
||||
<string name="qingqing_ztt_fu">嘟嘴試試</string>
|
||||
<string name="xiaobianzi_zh_fu">微笑觸發</string>
|
||||
<string name="xiaoxueshen_ztt_fu">吹氣觸發</string>
|
||||
<string name="hez_ztt_fu">張嘴試試</string>
|
||||
<string name="push_hand">推出手掌</string>
|
||||
<string name="fu_lm_koreaheart">单手手指比心</string>
|
||||
<string name="ssd_thread_six">比个六</string>
|
||||
<string name="ssd_thread_cute">双拳靠近脸颊卖萌</string>
|
||||
<string name="fu_lm_koreaheart">單手手指比心</string>
|
||||
<string name="ssd_thread_six">比個六</string>
|
||||
<string name="ssd_thread_cute">雙拳靠近臉頰賣萌</string>
|
||||
|
||||
<string name="origin">原图</string>
|
||||
<string name="origin">原圖</string>
|
||||
<string name="bailiang_1">白亮 1</string>
|
||||
<string name="bailiang_2">白亮 2</string>
|
||||
<string name="bailiang_3">白亮 3</string>
|
||||
@@ -109,23 +109,23 @@
|
||||
<string name="xiaoqingxin_3">小清新 3</string>
|
||||
<string name="xiaoqingxin_4">小清新 4</string>
|
||||
<string name="xiaoqingxin_6">小清新 6</string>
|
||||
<string name="lengsediao_1">冷色调 1</string>
|
||||
<string name="lengsediao_2">冷色调 2</string>
|
||||
<string name="lengsediao_3">冷色调 3</string>
|
||||
<string name="lengsediao_4">冷色调 4</string>
|
||||
<string name="lengsediao_7">冷色调 7</string>
|
||||
<string name="lengsediao_8">冷色调 8</string>
|
||||
<string name="lengsediao_11">冷色调 11</string>
|
||||
<string name="nuansediao_1">暖色调 1</string>
|
||||
<string name="nuansediao_2">暖色调 2</string>
|
||||
<string name="gexing_1">个性 1</string>
|
||||
<string name="gexing_2">个性 2</string>
|
||||
<string name="gexing_3">个性 3</string>
|
||||
<string name="gexing_4">个性 4</string>
|
||||
<string name="gexing_5">个性 5</string>
|
||||
<string name="gexing_7">个性 7</string>
|
||||
<string name="gexing_10">个性 10</string>
|
||||
<string name="gexing_11">个性 11</string>
|
||||
<string name="lengsediao_1">冷色調 1</string>
|
||||
<string name="lengsediao_2">冷色調 2</string>
|
||||
<string name="lengsediao_3">冷色調 3</string>
|
||||
<string name="lengsediao_4">冷色調 4</string>
|
||||
<string name="lengsediao_7">冷色調 7</string>
|
||||
<string name="lengsediao_8">冷色調 8</string>
|
||||
<string name="lengsediao_11">冷色調 11</string>
|
||||
<string name="nuansediao_1">暖色調 1</string>
|
||||
<string name="nuansediao_2">暖色調 2</string>
|
||||
<string name="gexing_1">個性 1</string>
|
||||
<string name="gexing_2">個性 2</string>
|
||||
<string name="gexing_3">個性 3</string>
|
||||
<string name="gexing_4">個性 4</string>
|
||||
<string name="gexing_5">個性 5</string>
|
||||
<string name="gexing_7">個性 7</string>
|
||||
<string name="gexing_10">個性 10</string>
|
||||
<string name="gexing_11">個性 11</string>
|
||||
<string name="heibai_1">黑白 1</string>
|
||||
<string name="heibai_2">黑白 2</string>
|
||||
<string name="heibai_3">黑白 3</string>
|
||||
@@ -138,14 +138,14 @@
|
||||
<string name="ziran_6">自然 6</string>
|
||||
<string name="ziran_7">自然 7</string>
|
||||
<string name="ziran_8">自然 8</string>
|
||||
<string name="zhiganhui_1">质感灰 1</string>
|
||||
<string name="zhiganhui_2">质感灰 2</string>
|
||||
<string name="zhiganhui_3">质感灰 3</string>
|
||||
<string name="zhiganhui_4">质感灰 4</string>
|
||||
<string name="zhiganhui_5">质感灰 5</string>
|
||||
<string name="zhiganhui_6">质感灰 6</string>
|
||||
<string name="zhiganhui_7">质感灰 7</string>
|
||||
<string name="zhiganhui_8">质感灰 8</string>
|
||||
<string name="zhiganhui_1">質感灰 1</string>
|
||||
<string name="zhiganhui_2">質感灰 2</string>
|
||||
<string name="zhiganhui_3">質感灰 3</string>
|
||||
<string name="zhiganhui_4">質感灰 4</string>
|
||||
<string name="zhiganhui_5">質感灰 5</string>
|
||||
<string name="zhiganhui_6">質感灰 6</string>
|
||||
<string name="zhiganhui_7">質感灰 7</string>
|
||||
<string name="zhiganhui_8">質感灰 8</string>
|
||||
<string name="mitao_1">蜜桃 1</string>
|
||||
<string name="mitao_2">蜜桃 2</string>
|
||||
<string name="mitao_3">蜜桃 3</string>
|
||||
@@ -155,85 +155,85 @@
|
||||
<string name="mitao_7">蜜桃 7</string>
|
||||
<string name="mitao_8">蜜桃 8</string>
|
||||
|
||||
<string name="beauty_face_style_none">无</string>
|
||||
<string name="beauty_face_style_1">风格 1</string>
|
||||
<string name="beauty_face_style_2">风格 2</string>
|
||||
<string name="beauty_face_style_3">风格 3</string>
|
||||
<string name="beauty_face_style_4">风格 4</string>
|
||||
<string name="beauty_face_style_5">风格 5</string>
|
||||
<string name="beauty_face_style_6">风格 6</string>
|
||||
<string name="beauty_face_style_7">风格 7</string>
|
||||
<string name="beauty_face_style_toast">使用%s先取消“风格推荐”</string>
|
||||
<string name="beauty_face_style_none">無</string>
|
||||
<string name="beauty_face_style_1">風格 1</string>
|
||||
<string name="beauty_face_style_2">風格 2</string>
|
||||
<string name="beauty_face_style_3">風格 3</string>
|
||||
<string name="beauty_face_style_4">風格 4</string>
|
||||
<string name="beauty_face_style_5">風格 5</string>
|
||||
<string name="beauty_face_style_6">風格 6</string>
|
||||
<string name="beauty_face_style_7">風格 7</string>
|
||||
<string name="beauty_face_style_toast">使用%s先取消“風格推薦”</string>
|
||||
|
||||
<string name="poster_take_photo">对准线框 正脸拍摄</string>
|
||||
<string name="poster_change_face_error">替换失败</string>
|
||||
<string name="poster_template_face_none">未识别模板的人脸,请重新选择模板</string>
|
||||
<string name="dialog_no_track_face">未检测到人脸,请重新拍摄</string>
|
||||
<string name="dialog_no_incomplete_face">人脸不全,请重新拍摄</string>
|
||||
<string name="dialog_face_rotation_not_valid">人脸偏转角度过大,请正脸拍摄。</string>
|
||||
<string name="poster_take_photo">對準線框 正臉拍攝</string>
|
||||
<string name="poster_change_face_error">替換失敗</string>
|
||||
<string name="poster_template_face_none">未識別模板的人臉,請重新選擇模板</string>
|
||||
<string name="dialog_no_track_face">未檢測到人臉,請重新拍攝</string>
|
||||
<string name="dialog_no_incomplete_face">人臉不全,請重新拍攝</string>
|
||||
<string name="dialog_face_rotation_not_valid">人臉偏轉角度過大,請正臉拍攝。</string>
|
||||
<string name="dialog_got">知道啦</string>
|
||||
<string name="tip_dual_face">检测到多人,请选择一人进行换脸</string>
|
||||
<string name="tip_dual_face">檢測到多人,請選擇一人進行換臉</string>
|
||||
|
||||
<string name="animoji_filter">Animoji</string>
|
||||
<string name="cartoon_filter">动漫滤镜</string>
|
||||
<string name="cartoon_filter">動漫濾鏡</string>
|
||||
|
||||
<string name="delete_avatar_model">删除模型</string>
|
||||
<string name="delete_avatar_model">刪除模型</string>
|
||||
<string name="new_avatar_model">新建模型</string>
|
||||
<string name="edit_avatar_model">编辑模型</string>
|
||||
<string name="edit_avatar_model">編輯模型</string>
|
||||
|
||||
<string name="avatar_face_hair">发型</string>
|
||||
<string name="avatar_face_face">脸型</string>
|
||||
<string name="avatar_face_hair">髮型</string>
|
||||
<string name="avatar_face_face">臉型</string>
|
||||
<string name="avatar_face_eye">眼睛</string>
|
||||
<string name="avatar_face_lip">嘴唇</string>
|
||||
<string name="avatar_face_nose">鼻子</string>
|
||||
|
||||
<string name="avatar_face_length">脸型长度</string>
|
||||
<string name="avatar_face_width">脸颊宽度</string>
|
||||
<string name="avatar_chin_width">下颚宽度</string>
|
||||
<string name="avatar_face_length">臉型長度</string>
|
||||
<string name="avatar_face_width">臉頰寬度</string>
|
||||
<string name="avatar_chin_width">下顎寬度</string>
|
||||
<string name="avatar_chin_height">下巴高低</string>
|
||||
<string name="avatar_eye_position">眼睛位置</string>
|
||||
<string name="avatar_eye_corner_height">眼角高度</string>
|
||||
<string name="avatar_eye_height">眼睛高低</string>
|
||||
<string name="avatar_eye_width">眼睛宽窄</string>
|
||||
<string name="avatar_eye_width">眼睛寬窄</string>
|
||||
<string name="avatar_nose_position">鼻子位置</string>
|
||||
<string name="avatar_nose_width">鼻翼宽窄</string>
|
||||
<string name="avatar_nose_height">鼻头高低</string>
|
||||
<string name="avatar_nose_width">鼻翼寬窄</string>
|
||||
<string name="avatar_nose_height">鼻頭高低</string>
|
||||
<string name="avatar_mouth_position">嘴部位置</string>
|
||||
<string name="avatar_up_lip_thickness">上唇厚度</string>
|
||||
<string name="avatar_down_lip_thickness">下唇厚度</string>
|
||||
<string name="avatar_lip_width">嘴唇宽度</string>
|
||||
<string name="model_empty_tip">你还没有创建过模型哦</string>
|
||||
<string name="dialog_reset_avatar_model">是否将所有参数恢复到默认值?</string>
|
||||
<string name="avatar_face_customize">自定义</string>
|
||||
<string name="avatar_lip_width">嘴唇寬度</string>
|
||||
<string name="model_empty_tip">你還沒有創建過模型哦</string>
|
||||
<string name="dialog_reset_avatar_model">是否將所有參數恢復到默認值?</string>
|
||||
<string name="avatar_face_customize">自定義</string>
|
||||
<string name="avatar_save_succeed">保存成功</string>
|
||||
|
||||
<string name="live_photo_back_not_save">返回后当前操作将不会被保存哦</string>
|
||||
<string name="live_photo_btn_delete">删除</string>
|
||||
<string name="live_photo_back_not_save">返回后當前操作將不會被保存哦</string>
|
||||
<string name="live_photo_btn_delete">刪除</string>
|
||||
<string name="live_photo_btn_cancel">取消</string>
|
||||
<string name="live_photo_btn_delete_">删除(%d)</string>
|
||||
<string name="live_photo_delete_effect">删除道具</string>
|
||||
<string name="live_photo__delete_all">全选</string>
|
||||
<string name="live_photo_empty_list_tip">你还没有创建过道具哦</string>
|
||||
<string name="confirm">确定</string>
|
||||
<string name="live_photo_btn_delete_">刪除(%d)</string>
|
||||
<string name="live_photo_delete_effect">刪除道具</string>
|
||||
<string name="live_photo__delete_all">全選</string>
|
||||
<string name="live_photo_empty_list_tip">你還沒有創建過道具哦</string>
|
||||
<string name="confirm">確定</string>
|
||||
<string name="cancel">取消</string>
|
||||
<string name="dialog_confirm_delete">确定删除所选中的道具?</string>
|
||||
<string name="toast_delete_succeed">删除成功</string>
|
||||
<string name="toast_delete_failed">删除失败</string>
|
||||
<string name="dialog_confirm_delete">確定刪除所選中的道具?</string>
|
||||
<string name="toast_delete_succeed">刪除成功</string>
|
||||
<string name="toast_delete_failed">刪除失敗</string>
|
||||
<string name="live_photo_save_succeed">道具保存成功</string>
|
||||
<string name="recover">恢复</string>
|
||||
<string name="recover">恢復</string>
|
||||
|
||||
<string name="makeup_lip_fog">雾面</string>
|
||||
<string name="makeup_lip_moist1">润泽Ⅰ</string>
|
||||
<string name="makeup_lip_moist2">润泽Ⅱ</string>
|
||||
<string name="makeup_lip_fog">霧面</string>
|
||||
<string name="makeup_lip_moist1">潤澤Ⅰ</string>
|
||||
<string name="makeup_lip_moist2">潤澤Ⅱ</string>
|
||||
<string name="makeup_lip_pearl">珠光</string>
|
||||
<string name="makeup_lip_bitelip">咬唇</string>
|
||||
<string name="makeup_blusher_apple">苹果肌</string>
|
||||
<string name="makeup_blusher_apple">蘋果肌</string>
|
||||
<string name="makeup_blusher_fan">扇形</string>
|
||||
<string name="makeup_blusher_eye_corner">眼角</string>
|
||||
<string name="makeup_blusher_slight_drunk">微醺</string>
|
||||
<string name="makeup_highlight_one">高光 I</string>
|
||||
<string name="makeup_highlight_two">高光 II</string>
|
||||
<string name="makeup_shadow_one">阴影 I</string>
|
||||
<string name="makeup_shadow_one">陰影 I</string>
|
||||
<string name="makeup_pupil_1">蜜糖</string>
|
||||
<string name="makeup_pupil_2">奶茶</string>
|
||||
<string name="makeup_pupil_3">水波</string>
|
||||
@@ -241,106 +241,106 @@
|
||||
<string name="makeup_pupil_5">孔雀</string>
|
||||
<string name="makeup_pupil_6">星河</string>
|
||||
<string name="makeup_pupil_7">落目</string>
|
||||
<string name="makeup_pupil_8">极光</string>
|
||||
<string name="makeup_eyebrow_willow">柳叶眉</string>
|
||||
<string name="makeup_pupil_8">極光</string>
|
||||
<string name="makeup_eyebrow_willow">柳恭弘=叶 恭弘眉</string>
|
||||
<string name="makeup_eyebrow_wild">野生眉</string>
|
||||
<string name="makeup_eyebrow_classical">古典眉</string>
|
||||
<string name="makeup_eyebrow_standard">标准眉</string>
|
||||
<string name="makeup_eye_shadow_single">单色眼影</string>
|
||||
<string name="makeup_eye_shadow_double1">双色眼影 I</string>
|
||||
<string name="makeup_eye_shadow_double2">双色眼影 II</string>
|
||||
<string name="makeup_eye_shadow_double3">双色眼影 III</string>
|
||||
<string name="makeup_eyebrow_standard">標準眉</string>
|
||||
<string name="makeup_eye_shadow_single">單色眼影</string>
|
||||
<string name="makeup_eye_shadow_double1">雙色眼影 I</string>
|
||||
<string name="makeup_eye_shadow_double2">雙色眼影 II</string>
|
||||
<string name="makeup_eye_shadow_double3">雙色眼影 III</string>
|
||||
<string name="makeup_eye_shadow_triple1">三色眼影 I</string>
|
||||
<string name="makeup_eye_shadow_triple2">三色眼影 II</string>
|
||||
<string name="makeup_eyelash_natural1">自然型 I</string>
|
||||
<string name="makeup_eyelash_natural2">自然型 II</string>
|
||||
<string name="makeup_eyelash_thick1">浓密型 I</string>
|
||||
<string name="makeup_eyelash_thick2">浓密型 II</string>
|
||||
<string name="makeup_eyelash_exaggerate1">夸张型 I</string>
|
||||
<string name="makeup_eyelash_exaggerate2">夸张型 II</string>
|
||||
<string name="makeup_eye_linear_cat">猫眼</string>
|
||||
<string name="makeup_eyelash_thick1">濃密型 I</string>
|
||||
<string name="makeup_eyelash_thick2">濃密型 II</string>
|
||||
<string name="makeup_eyelash_exaggerate1">誇張型 I</string>
|
||||
<string name="makeup_eyelash_exaggerate2">誇張型 II</string>
|
||||
<string name="makeup_eye_linear_cat">貓眼</string>
|
||||
<string name="makeup_eye_linear_drooping">下垂眼</string>
|
||||
<string name="makeup_eye_linear_pull_open">拉开眼距</string>
|
||||
<string name="makeup_eye_linear_pull_open">拉開眼距</string>
|
||||
<string name="makeup_eye_linear_pull_close">拉近眼距</string>
|
||||
<string name="makeup_eye_linear_long">长眼</string>
|
||||
<string name="makeup_eye_linear_circular">圆眼</string>
|
||||
<string name="makeup_eye_linear_long">長眼</string>
|
||||
<string name="makeup_eye_linear_circular">圓眼</string>
|
||||
|
||||
<string name="makeup_combination_diadiatu">嗲嗲兔</string>
|
||||
<string name="makeup_combination_dongling">冻龄</string>
|
||||
<string name="makeup_combination_guofeng">国风</string>
|
||||
<string name="makeup_combination_dongling">凍齡</string>
|
||||
<string name="makeup_combination_guofeng">國風</string>
|
||||
<string name="makeup_combination_hunxie">混血</string>
|
||||
<string name="makeup_combination_sexy">性感</string>
|
||||
<string name="makeup_combination_sweet">甜美</string>
|
||||
<string name="makeup_combination_neighbor">邻家</string>
|
||||
<string name="makeup_combination_occident">欧美</string>
|
||||
<string name="makeup_combination_charming">妩媚</string>
|
||||
<string name="makeup_combination_jianling">减龄</string>
|
||||
<string name="makeup_combination_neighbor">鄰家</string>
|
||||
<string name="makeup_combination_occident">歐美</string>
|
||||
<string name="makeup_combination_charming">嫵媚</string>
|
||||
<string name="makeup_combination_jianling">減齡</string>
|
||||
<string name="makeup_combination_nuandong">暖冬</string>
|
||||
<string name="makeup_combination_hongfeng">红枫</string>
|
||||
<string name="makeup_combination_hongfeng">紅楓</string>
|
||||
<string name="makeup_combination_shaonv">少女</string>
|
||||
<string name="makeup_combination_ziyun">紫韵</string>
|
||||
<string name="makeup_combination_yanshimao">厌世猫</string>
|
||||
<string name="makeup_combination_renyu">人鱼</string>
|
||||
<string name="makeup_combination_ziyun">紫韻</string>
|
||||
<string name="makeup_combination_yanshimao">厭世貓</string>
|
||||
<string name="makeup_combination_renyu">人魚</string>
|
||||
<string name="makeup_combination_chuqiu">初秋</string>
|
||||
<string name="makeup_combination_qianzhihe">千纸鹤</string>
|
||||
<string name="makeup_combination_qianzhihe">千紙鶴</string>
|
||||
<string name="makeup_combination_chaomo">超模</string>
|
||||
<string name="makeup_combination_chuju">雏菊</string>
|
||||
<string name="makeup_combination_gangfeng">港风</string>
|
||||
<string name="makeup_combination_chuju">雛菊</string>
|
||||
<string name="makeup_combination_gangfeng">港風</string>
|
||||
<string name="makeup_combination_rose">Rose</string>
|
||||
|
||||
<string name="slimming">瘦身</string>
|
||||
<string name="long_legs">长腿</string>
|
||||
<string name="thin_waist">细腰</string>
|
||||
<string name="long_legs">長腿</string>
|
||||
<string name="thin_waist">細腰</string>
|
||||
<string name="beautify_shoulder">美肩</string>
|
||||
<string name="beautify_hip_slim">美臀</string>
|
||||
<string name="beautify_head_slim">小头</string>
|
||||
<string name="beautify_head_slim">小頭</string>
|
||||
<string name="beautify_leg_thin_slim">瘦腿</string>
|
||||
<string name="toast_not_detect_body">未检测到人体</string>
|
||||
<string name="pta_human_full_body">全身驱动</string>
|
||||
<string name="pta_human_half_body">半身驱动</string>
|
||||
<string name="toast_not_detect_body">未檢測到人體</string>
|
||||
<string name="pta_human_full_body">全身驅動</string>
|
||||
<string name="pta_human_half_body">半身驅動</string>
|
||||
|
||||
|
||||
<string name="select_data_photo_or_video">载入图片或视频</string>
|
||||
<string name="toast_not_detect_gesture">未检测到手势</string>
|
||||
<string name="select_data_photo_or_video">載入圖片或視頻</string>
|
||||
<string name="toast_not_detect_gesture">未檢測到手勢</string>
|
||||
|
||||
<string name="bg_seg_green_graphic">抠像</string>
|
||||
<string name="bg_seg_green_graphic">摳像</string>
|
||||
<string name="bg_seg_green_background">背景</string>
|
||||
<string name="bg_seg_green_key_color">关键颜色</string>
|
||||
<string name="bg_seg_green_key_color">關鍵顏色</string>
|
||||
<string name="bg_seg_green_similarity">相似度</string>
|
||||
<string name="bg_seg_green_smooth">平滑</string>
|
||||
<string name="bg_seg_green_alpha">祛色度</string>
|
||||
<string name="bg_seg_green_safe_area">安全区域</string>
|
||||
<string name="bg_seg_green_safe_area">安全區域</string>
|
||||
<string name="bg_seg_green_science">科技</string>
|
||||
<string name="bg_seg_green_beach">沙滩</string>
|
||||
<string name="bg_seg_green_beach">沙灘</string>
|
||||
<string name="bg_seg_green_classroom">教室</string>
|
||||
<string name="bg_seg_green_forest">森林</string>
|
||||
<string name="bg_seg_green_ink">水墨画</string>
|
||||
<string name="dialog_guide_bg_seg_green">请使用纯色背景拍摄,推荐绿色幕布效果最佳</string>
|
||||
<string name="bg_seg_green_ink">水墨畫</string>
|
||||
<string name="dialog_guide_bg_seg_green">請使用純色背景拍攝,推薦綠色幕布效果最佳</string>
|
||||
<string name="dialog_i_know">我知道了</string>
|
||||
|
||||
<string name="download_error">下载失败</string>
|
||||
<string name="download_error">下載失敗</string>
|
||||
<string name="back">返回</string>
|
||||
|
||||
<string name="safe_area_tips">白色区域为安全区域,不参与绿幕抠像</string>
|
||||
<string name="safe_area_tips">白色區域為安全區域,不參与綠幕摳像</string>
|
||||
|
||||
<string name="brow_height_tips">眉毛上下功能仅支持在高端机上使用</string>
|
||||
<string name="brow_space_tips">眉间距功能仅支持在高端机上使用</string>
|
||||
<string name="brow_height_tips">眉毛上下功能僅支持在高端機上使用</string>
|
||||
<string name="brow_space_tips">眉間距功能僅支持在高端機上使用</string>
|
||||
|
||||
|
||||
<string name="home_function_name_beauty">美颜</string>
|
||||
<string name="home_function_name_makeup">美妆</string>
|
||||
<string name="home_function_name_sticker">贴纸</string>
|
||||
<string name="home_function_name_beauty_body">美体</string>
|
||||
<string name="home_function_name_beauty">美顏</string>
|
||||
<string name="home_function_name_makeup">美妝</string>
|
||||
<string name="home_function_name_sticker">貼紙</string>
|
||||
<string name="home_function_name_beauty_body">美體</string>
|
||||
|
||||
<string name="toast_not_detect_face">未检测到人脸</string>
|
||||
<string name="toast_not_detect_face_or_body">未检测到人脸或人体</string>
|
||||
<string name="toast_not_detect_face">未檢測到人臉</string>
|
||||
<string name="toast_not_detect_face_or_body">未檢測到人臉或人體</string>
|
||||
|
||||
<string name="makeup_combination_naicha">奶茶</string>
|
||||
<string name="makeup_combination_dousha">豆沙</string>
|
||||
<string name="makeup_combination_chaoa">超A</string>
|
||||
<string name="home_function_name_big_head">搞笑大头</string>
|
||||
<string name="home_function_name_big_head">搞笑大頭</string>
|
||||
<string name="home_function_name_animoji">Animoji</string>
|
||||
<string name="home_function_name_fine_sticker">精品贴纸</string>
|
||||
<string name="home_function_name_fine_sticker">精品貼紙</string>
|
||||
<string name="dialog_reset">重置</string>
|
||||
<string name="menu_diy">自定義</string>
|
||||
|
||||
|
||||
@@ -16,33 +16,33 @@
|
||||
<string name="fu_base_input_type_single">SingleInput</string>
|
||||
<string name="fu_base_input_type_double">DualInput</string>
|
||||
|
||||
<string name="beauty_box_heavy_blur_fine">Fine smooth</string>
|
||||
<string name="beauty_box_color_level">Whiten</string>
|
||||
<string name="beauty_box_red_level">Ruddy</string>
|
||||
<string name="beauty_box_heavy_blur_fine">Buffing</string>
|
||||
<string name="beauty_box_color_level">Skin Tone</string>
|
||||
<string name="beauty_box_red_level">Rosy</string>
|
||||
<string name="beauty_box_sharpen">Sharpen</string>
|
||||
<string name="beauty_box_eye_bright">Eye brighten</string>
|
||||
<string name="beauty_box_tooth_whiten">Tooth whiten</string>
|
||||
<string name="beauty_box_eye_enlarge">Eye enlarge</string>
|
||||
<string name="beauty_box_eye_circle">Eye round</string>
|
||||
<string name="beauty_box_cheek_natural">Natural</string>
|
||||
<string name="beauty_box_eye_bright">Brighen</string>
|
||||
<string name="beauty_box_tooth_whiten">Whiten</string>
|
||||
<string name="beauty_box_eye_enlarge">Enlarge</string>
|
||||
<string name="beauty_box_eye_circle">Round</string>
|
||||
<string name="beauty_box_cheek_natural">Origin</string>
|
||||
<string name="beauty_box_cheek_goddess">Goddess</string>
|
||||
<string name="beauty_box_cheek_long_face">Long face</string>
|
||||
<string name="beauty_box_cheek_round_face">Round face</string>
|
||||
<string name="beauty_box_cheekbones">Cheekbone</string>
|
||||
<string name="beauty_box_lower_jaw">Jawbone</string>
|
||||
<string name="beauty_box_cheek_thinning">Cheek thin</string>
|
||||
<string name="beauty_box_cheek_v">V face</string>
|
||||
<string name="beauty_box_cheek_narrow">CheekNarrow</string>
|
||||
<string name="beauty_box_cheek_short">Cheek short</string>
|
||||
<string name="beauty_box_cheek_small">Cheek small</string>
|
||||
<string name="beauty_box_intensity_chin">Chin</string>
|
||||
<string name="beauty_box_intensity_forehead">Forehead</string>
|
||||
<string name="beauty_box_intensity_nose">Nose</string>
|
||||
<string name="beauty_box_intensity_mouth">Mouth</string>
|
||||
<string name="beauty_radio_skin_beauty">Skin</string>
|
||||
<string name="beauty_radio_face_shape">Reshape</string>
|
||||
<string name="beauty_box_cheekbones">Cheek</string>
|
||||
<string name="beauty_box_lower_jaw">Jaw</string>
|
||||
<string name="beauty_box_cheek_thinning">Lower Width</string>
|
||||
<string name="beauty_box_cheek_v">V Shape</string>
|
||||
<string name="beauty_box_cheek_narrow">Upper Width</string>
|
||||
<string name="beauty_box_cheek_short">Short Face</string>
|
||||
<string name="beauty_box_cheek_small">Size Face</string>
|
||||
<string name="beauty_box_intensity_chin">Chin Length</string>
|
||||
<string name="beauty_box_intensity_forehead">Hairline</string>
|
||||
<string name="beauty_box_intensity_nose">Nose Size</string>
|
||||
<string name="beauty_box_intensity_mouth">Mouth Size</string>
|
||||
<string name="beauty_radio_skin_beauty">Skincare</string>
|
||||
<string name="beauty_radio_face_shape">Beauty type</string>
|
||||
<string name="beauty_radio_filter">Filter</string>
|
||||
<string name="beauty_radio_style">Presets</string>
|
||||
<string name="beauty_radio_style">Style recommend</string>
|
||||
<string name="makeup_radio_lipstick">Lipstick</string>
|
||||
<string name="makeup_radio_blusher">Blush</string>
|
||||
<string name="makeup_radio_eyebrow">Eyebrow</string>
|
||||
@@ -59,16 +59,16 @@
|
||||
<string name="makeup_boyfriend">Boyfriend</string>
|
||||
<string name="makeup_clear">Clear</string>
|
||||
<string name="makeup_grapefruit">Grapefruit</string>
|
||||
<string name="beauty_micro_pouch">Circle</string>
|
||||
<string name="beauty_micro_nasolabial">Wrinkles</string>
|
||||
<string name="beauty_micro_pouch">Dark Circles</string>
|
||||
<string name="beauty_micro_nasolabial">Laugh Line</string>
|
||||
<string name="beauty_micro_smile">Smile</string>
|
||||
<string name="beauty_brow_height">Brow height</string>
|
||||
<string name="beauty_brow_space">Brow space</string>
|
||||
<string name="beauty_micro_canthus">Canthus</string>
|
||||
<string name="beauty_micro_philtrum">Philtrum</string>
|
||||
<string name="beauty_micro_long_nose">Length</string>
|
||||
<string name="beauty_micro_eye_space">Eye distance</string>
|
||||
<string name="beauty_micro_eye_rotate">Slant</string>
|
||||
<string name="beauty_brow_height">Brow Position</string>
|
||||
<string name="beauty_brow_space">Brow Distance</string>
|
||||
<string name="beauty_micro_canthus">Inner Corner</string>
|
||||
<string name="beauty_micro_philtrum">Mouth Position</string>
|
||||
<string name="beauty_micro_long_nose">Nose Lift</string>
|
||||
<string name="beauty_micro_eye_space">Eye Distance</string>
|
||||
<string name="beauty_micro_eye_rotate">Eye Upturn</string>
|
||||
<string name="beauty_face_style_none">None</string>
|
||||
<string name="beauty_face_style_1">Style 1</string>
|
||||
<string name="beauty_face_style_2">Style 2</string>
|
||||
@@ -77,7 +77,7 @@
|
||||
<string name="beauty_face_style_5">Style 5</string>
|
||||
<string name="beauty_face_style_6">Style 6</string>
|
||||
<string name="beauty_face_style_7">Style 7</string>
|
||||
<string name="beauty_face_style_toast">To use %s, cancel \'Presets\' first.</string>
|
||||
<string name="beauty_face_style_toast">To use %s, cancel \'Style recommend\' first.</string>
|
||||
|
||||
<string name="select_data_photo">Photo</string>
|
||||
<string name="select_data_video">Video</string>
|
||||
|
||||
@@ -34,14 +34,14 @@ public class ShareBuilder {
|
||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||
anchorId,
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
) ;
|
||||
CommonAppConfig.IS_GOOGLE_PLAY
|
||||
);
|
||||
}
|
||||
|
||||
public static String createInviteLink(String shareUid) {
|
||||
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
CommonAppConfig.IS_GOOGLE_PLAY
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
link.setText(url.substring(0, 40));
|
||||
info.setText(R.string.dialog_invite_info);
|
||||
info.setText(mContext.getString(R.string.dialog_invite_info));
|
||||
avatar.setImageResource(R.mipmap.ic_launcher);
|
||||
//title.setTextColor(getContext().getResources().getColorStateList(R.drawable.bg_invite_title));
|
||||
title.setText(R.string.dialog_invite_title);
|
||||
@@ -152,7 +152,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
public InvitePopDialog setUrl(String data) {
|
||||
this.url = data + "&isGoogle=" + (CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0");
|
||||
this.url = data + "&isGoogle=" + CommonAppConfig.IS_GOOGLE_PLAY;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -64,7 +64,7 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
public SharePopDialog setShareLink(String link) {
|
||||
this.shareLink = link;
|
||||
this.shareLink = link + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
url = shareLink;
|
||||
}
|
||||
}
|
||||
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
link.setText(url);
|
||||
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
||||
ImgLoader.display(getContext(), anchorAvatar, avatar);
|
||||
@@ -139,7 +140,7 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||
}
|
||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text",info.getText().toString()+"\n"+url);
|
||||
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||
}
|
||||
|
||||
@@ -26,21 +26,21 @@
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"30086000612391734",
|
||||
"product_id":"99536292102564216",
|
||||
"client_id":"964994320723627840",
|
||||
"client_secret":"6D5FE29D85B967D3A66BDCD473641E4C7B5524F7F4935CA0EF4A842730C3402D",
|
||||
"project_id":"99536292102564216",
|
||||
"app_id":"106936673",
|
||||
"api_key":"DAEDADYGta/0O4ZSdrnug52NgC67/w/RIyTq9A8LyAY0+mp6g6XeJDbxugpluFPLAhaqjaMs5c0PLnRx14UzWbPPADgi1EqihbWLoA==",
|
||||
"cp_id":"30852000032486141",
|
||||
"product_id":"388421841221767494",
|
||||
"client_id":"1283893262452580800",
|
||||
"client_secret":"17BC070420691D35650C694230D6348075CB549F7BBA94EDD49FA9E61A9E5434",
|
||||
"project_id":"388421841221767494",
|
||||
"app_id":"109612651",
|
||||
"api_key":"DAEDAAlBbTFuTuyQWQsyYBZLuyjALH9Y9BNFkVZl1GhI0tRaa6HF1LgzXWy2MZiSFrmpbn1aAvcvzP6aKZtR6MVikS8V4SbBlYUPfQ==",
|
||||
"package_name":"com.pdlive.shayu"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"106936673",
|
||||
"client_id":"109612651",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"106936673",
|
||||
"app_id":"109612651",
|
||||
"package_name":"com.pdlive.shayu"
|
||||
},
|
||||
"service":{
|
||||
@@ -53,6 +53,10 @@
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"edukit":{
|
||||
"edu_url":"edukit.cloud.huawei.com.cn",
|
||||
"dh_url":"edukit.cloud.huawei.com.cn"
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
@@ -77,15 +81,15 @@
|
||||
{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"client":{
|
||||
"app_id":"106936673"
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"app_id":"106936673"
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"106936673"
|
||||
"client_id":"109612651"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -130,39 +130,36 @@ android {
|
||||
}
|
||||
variant.mergeAssetsProvider.configure {
|
||||
doLast {
|
||||
delete(fileTree(dir: outputDir, includes: [
|
||||
'model/ai_bgseg_green.bundle',
|
||||
'model/ai_face_processor.bundle',
|
||||
//'model/ai_face_processor_lite.bundle',
|
||||
'model/ai_hairseg.bundle',
|
||||
'model/ai_hand_processor.bundle',
|
||||
'model/ai_human_processor.bundle',
|
||||
'model/ai_human_processor_gpu.bundle',
|
||||
'model/ai_human_processor_mb_fast.bundle',
|
||||
'graphics/body_slim.bundle',
|
||||
'graphics/controller_cpp.bundle',
|
||||
//'graphics/face_beautification.bundle',
|
||||
'graphics/face_makeup.bundle',
|
||||
'graphics/fuzzytoonfilter.bundle',
|
||||
'graphics/fxaa.bundle',
|
||||
'graphics/tongue.bundle',
|
||||
//旧美颜
|
||||
'model-all.zip',
|
||||
'filterData.zip',
|
||||
'KSYResource/*',
|
||||
'Resources/*',
|
||||
'Asset/*',
|
||||
'image_effect_shaders/*',
|
||||
'internal/*'
|
||||
//美颜基础组件
|
||||
delete(fileTree(dir: outputDir, includes: ['model/ai_bgseg_green.bundle',
|
||||
'model/ai_face_processor.bundle',
|
||||
//'model/ai_face_processor_lite.bundle',
|
||||
'model/ai_hairseg.bundle',
|
||||
'model/ai_hand_processor.bundle',
|
||||
'model/ai_human_processor.bundle',
|
||||
'model/ai_human_processor_gpu.bundle',
|
||||
'model/ai_human_processor_mb_fast.bundle',
|
||||
'graphics/body_slim.bundle',
|
||||
'graphics/controller_cpp.bundle',
|
||||
//'graphics/face_beautification.bundle',
|
||||
'graphics/face_makeup.bundle',
|
||||
'graphics/fuzzytoonfilter.bundle',
|
||||
'graphics/fxaa.bundle',
|
||||
'graphics/tongue.bundle',
|
||||
//旧美颜
|
||||
'model-all.zip',
|
||||
'filterData.zip',
|
||||
'KSYResource/*',
|
||||
'Resources/*',
|
||||
'Asset/*',
|
||||
'image_effect_shaders/*',
|
||||
'internal/*'
|
||||
//美颜基础组件
|
||||
|
||||
]))
|
||||
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
delete(fileTree(dir: outputDir, includes: [
|
||||
'model/ai_face_processor_lite.bundle',
|
||||
'graphics/face_beautification.bundle'
|
||||
]))
|
||||
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor_lite.bundle',
|
||||
'graphics/face_beautification.bundle']))
|
||||
} else {
|
||||
println "不删除bundle"
|
||||
}
|
||||
@@ -170,8 +167,10 @@ android {
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "link"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay) {
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
||||
isGoogle = "Google"
|
||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||
isGoogle = "Huawei"
|
||||
}
|
||||
def isPlugin = "all"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
@@ -231,7 +230,6 @@ android {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@@ -266,8 +264,8 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
//implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||
//implementation 'com.google.firebase:firebase-crashlytics'
|
||||
|
||||
//直播
|
||||
api project(':main')
|
||||
|
||||
58
app/proguard-rules.pro
vendored
58
app/proguard-rules.pro
vendored
@@ -235,4 +235,60 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
}
|
||||
-keep class com.faceunity.wrapper.faceunity$LoadConfig*{
|
||||
private static boolean sLoadedLibrary;
|
||||
}
|
||||
}
|
||||
-keep class com.umeng.** {*;}
|
||||
|
||||
-keep class org.repackage.** {*;}
|
||||
|
||||
-keep class com.uyumao.** { *; }
|
||||
|
||||
-keepclassmembers class * {
|
||||
public <init> (org.json.JSONObject);
|
||||
}
|
||||
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
#----svga
|
||||
-keep class com.opensource.svgaplayer.**{
|
||||
public <methods>;
|
||||
public static <fields>;
|
||||
}
|
||||
# json序列化的混淆
|
||||
-keep class tech.sud.mgp.hello.ui.scenes.ticket.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.game.req.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.game.resp.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.login.req.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.login.resp.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.main.req.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.main.resp.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.main.config.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.room.req.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.room.resp.** {*;}
|
||||
-keep class tech.sud.mgp.hello.service.room.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.main.home.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.scenes.base.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.scenes.common.cmd.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.scenes.custom.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.scenes.orderentertainment.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
||||
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
||||
|
||||
-keep class com.yunbao.common.sud.** {*;}
|
||||
|
||||
|
||||
|
||||
-ignorewarnings
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes Exceptions
|
||||
-keepattributes InnerClasses
|
||||
-keepattributes Signature
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
-keep class com.huawei.hianalytics.**{*;}
|
||||
-keep class com.huawei.updatesdk.**{*;}
|
||||
-keep class com.huawei.hms.**{*;}
|
||||
|
||||
-keep class com.shayu.lib_google.**{*;}
|
||||
-keep class com.shayu.lib_huawei.**{*;}
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
<uses-permission
|
||||
android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_LOGS"
|
||||
@@ -62,6 +63,9 @@
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission
|
||||
@@ -81,12 +85,12 @@
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- Android11新增 -->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
<queries>
|
||||
<package android:name="com.twitter.android"/>
|
||||
<package android:name="jp.naver.line.android"/>
|
||||
<package android:name="com.twitter.android" />
|
||||
<package android:name="jp.naver.line.android" />
|
||||
|
||||
</queries>
|
||||
<application
|
||||
@@ -95,30 +99,30 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </service>-->
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </service>-->
|
||||
<service
|
||||
android:name="io.rong.push.platform.google.RongFirebaseMessagingService"
|
||||
android:stopWithTask="false"
|
||||
android:exported="false">
|
||||
android:exported="false"
|
||||
android:stopWithTask="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity"
|
||||
android:exported="true">
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -130,7 +134,8 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="smvslm" />
|
||||
|
||||
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -162,13 +167,16 @@
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
android:value="@string/facebook_client_token" />
|
||||
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
|
||||
android:value="false" />
|
||||
<meta-data
|
||||
android:name="firebase_messaging_auto_init_enabled"
|
||||
android:value="false" />
|
||||
<meta-data
|
||||
android:name="firebase_analytics_collection_enabled"
|
||||
android:value="false" />
|
||||
|
||||
<receiver
|
||||
android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
|
||||
android:exported="true">
|
||||
@@ -186,12 +194,13 @@
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||
<!-- android:value="106936673"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.cpid"-->
|
||||
<!-- android:value="30086000612391734"/>-->
|
||||
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.appid"
|
||||
android:value="109612651" />
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.cpid"
|
||||
android:value="30852000032486141" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -6,7 +6,6 @@ import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.net.http.HttpResponseCache;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -24,14 +23,13 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.shayu.phonelive.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@@ -44,9 +42,9 @@ import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
@@ -60,7 +58,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
@@ -143,7 +140,6 @@ public class AppContext extends CommonAppContext {
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
FirebaseAnalytics.getInstance(this);
|
||||
|
||||
File httpCacheDir = new File(getCacheDir(), "https");
|
||||
try {
|
||||
@@ -158,13 +154,26 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
ARouter.init(this);
|
||||
|
||||
|
||||
//初始化 邀请码库
|
||||
if (isMainProcess()) {
|
||||
OpenInstall.init(this);
|
||||
}
|
||||
//设置LOG开关,默认为false
|
||||
UMConfigure.setLogEnabled(true);
|
||||
|
||||
|
||||
//友盟正式初始化
|
||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||
|
||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||
|
||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||
UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
//初始化 AndroidUtilCode
|
||||
Utils.init(this);
|
||||
@@ -195,9 +204,7 @@ public class AppContext extends CommonAppContext {
|
||||
if (content.getContent().contains("_method_")) {
|
||||
msg.obj = content.getContent();
|
||||
//观众页面
|
||||
if (SocketRyClient.mSocketHandler != null
|
||||
&& (TextUtils.equals("__system__", message.getTargetId())
|
||||
|| ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||
if (SocketRyClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||
@@ -296,40 +303,37 @@ public class AppContext extends CommonAppContext {
|
||||
* 注册全局异常捕获,有需要时可以在onCreate调用
|
||||
*/
|
||||
private void registerError() {
|
||||
NeverCrashUtils.getInstance()
|
||||
.setDebugMode(BuildConfig.DEBUG)
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
}
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
NeverCrashUtils.getInstance().setDebugMode(BuildConfig.DEBUG).setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
}
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
})
|
||||
.setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
})
|
||||
.register(this);
|
||||
}).setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
}).register(this);
|
||||
}
|
||||
|
||||
public void registerFirebaseCrash() {
|
||||
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
||||
return;
|
||||
}
|
||||
FirebaseAnalytics.getInstance(this);
|
||||
FirebaseApp.initializeApp(this);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
GoogleUtils.newInstance(this).initializeApp(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -338,21 +342,5 @@ public class AppContext extends CommonAppContext {
|
||||
return;
|
||||
}
|
||||
String uid = CommonAppConfig.getInstance().getUid();
|
||||
FirebaseCrashlytics.getInstance().setUserId(CommonAppConfig.getInstance().getUid());
|
||||
if (uid != null && !uid.isEmpty()) {
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("uid", uid);
|
||||
} else {
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("uid", "uid is null");
|
||||
}
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("userData", SpUtil.getInstance().getStringValue(SpUtil.USER_INFO));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("PhoneName", Build.BRAND);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("Phone", Build.MODEL);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("CPU", Arrays.toString(Build.SUPPORTED_ABIS));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("RunTime", (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("enterRoom", CrashSaveBean.getInstance().getEnterRoom());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("slidingRoom", CrashSaveBean.getInstance().getSlidingRoom());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("playSvga", CrashSaveBean.getInstance().getPlaySvga());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("ActivitySize", CrashSaveBean.getInstance().getActivitySize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
@@ -108,7 +107,6 @@ public class NeverCrashUtils {
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppContext.setFirebaseCrashData();
|
||||
FirebaseCrashlytics.getInstance().recordException(e);
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
|
||||
@@ -229,8 +229,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
}
|
||||
}else{
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -389,6 +392,15 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
mPlayer = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (mLauncherAdViewHolder != null) {
|
||||
mLauncherAdViewHolder.release();
|
||||
checkUidAndToken();
|
||||
return;
|
||||
}
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放广告
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.yunbao.common.bean.NotificationMsgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -92,7 +93,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
if (AppContext.activityWeakReference != null) {
|
||||
Activity activity = AppContext.activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleDialog(activity, WordUtil.isNewZh()?"应用需要通知权限":"Application requires notification permission", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent intent = new Intent();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.shayu.phonelive.utils;
|
||||
|
||||
import android.app.Notification;
|
||||
@@ -108,3 +109,4 @@ public class MyNotificationService extends FirebaseMessagingService {
|
||||
// }
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@ buildscript {
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -23,6 +25,7 @@ buildscript {
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +44,7 @@ allprojects {
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||
google() // Google's Maven repository
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,11 @@ dependencies {
|
||||
|
||||
//谷歌支付
|
||||
//谷歌内购
|
||||
api 'com.android.billingclient:billing:5.0.0'
|
||||
//api 'com.android.billingclient:billing:5.0.0'
|
||||
|
||||
//api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||
//api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||
|
||||
api 'com.squareup.picasso:picasso:2.5.2'
|
||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||
api files('libs/liteavsdk.jar')
|
||||
@@ -179,9 +183,8 @@ dependencies {
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
|
||||
//loading样式库
|
||||
api 'com.wang.avi:library:2.1.3'
|
||||
api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||
api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||
api 'com.wang.avi:library:2.1.3'
|
||||
|
||||
// api 'com.huawei.hms:push:4.0.2.300'
|
||||
implementation 'com.github.tajchert:WaitingDots:0.6.1'
|
||||
//悬浮窗
|
||||
@@ -196,4 +199,21 @@ dependencies {
|
||||
api 'com.github.gzu-liyujiang.AndroidPicker:WheelView:4.1.11'
|
||||
//自定义圆角图片
|
||||
api 'com.makeramen:roundedimageview:2.3.0'
|
||||
// 友盟统计SDK
|
||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
||||
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
||||
api 'com.umeng.umsdk:uyumao:1.1.2'
|
||||
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||
// 标准版本SudMGP SDK
|
||||
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
||||
|
||||
// 多语言语音识别扩展库(可选)
|
||||
api 'tech.sud.mgp:SudASR:1.3.3.1158'
|
||||
|
||||
//华为支付插件包
|
||||
//api project(':lib_huawei')
|
||||
|
||||
//google插件包
|
||||
api project(':lib_google')
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.yunbao.common">
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
|
||||
<application android:allowBackup="true">
|
||||
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.ar.core"-->
|
||||
<!-- android:value="optional" />-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.ar.core"-->
|
||||
<!-- android:value="optional" />-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.WebViewActivity"
|
||||
@@ -32,23 +31,23 @@
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
|
||||
支付宝
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5AuthActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
支付宝 end
|
||||
-->
|
||||
支付宝
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5AuthActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
支付宝 end
|
||||
-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.ErrorActivity"
|
||||
@@ -57,6 +56,9 @@
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.SelectImageActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.SudGameActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.PreviewImageActivity"
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
@@ -19,6 +20,7 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -32,7 +34,7 @@ public class CommonAppConfig {
|
||||
//域名
|
||||
public static final String HOST = getMetaDataString("SERVER_HOST");
|
||||
//是否使用谷歌支付
|
||||
public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY");
|
||||
public static final int IS_GOOGLE_PLAY = getMetaDataInt("IS_GOOGLE_PLAY");
|
||||
//是否开启上报错误日志功能
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
@@ -78,8 +80,6 @@ public class CommonAppConfig {
|
||||
public static int alert_end_time = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
private CommonAppConfig() {
|
||||
|
||||
}
|
||||
@@ -148,6 +148,7 @@ public class CommonAppConfig {
|
||||
}
|
||||
return Constants.DIAMONDS;
|
||||
}
|
||||
|
||||
public String getGoldCoinName() {
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
@@ -183,12 +184,19 @@ public class CommonAppConfig {
|
||||
if (configBean != null) {
|
||||
callback.callback(configBean);
|
||||
} else {
|
||||
CommonHttpUtil.getConfig(null,callback);
|
||||
CommonHttpUtil.getConfig(null, callback);
|
||||
}
|
||||
}
|
||||
|
||||
private String[][] liveType = null;
|
||||
|
||||
public String[][] getLiveType() {
|
||||
return liveType;
|
||||
}
|
||||
|
||||
public void setConfig(ConfigBean config) {
|
||||
mConfig = config;
|
||||
liveType = config.getLiveType();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,13 +393,12 @@ public class CommonAppConfig {
|
||||
public String getAppName() {
|
||||
if (TextUtils.isEmpty(mAppName)) {
|
||||
int res = CommonAppContext.sInstance.getResources().getIdentifier("app_name", "string", "myname.pdlive.shayu");
|
||||
mAppName =WordUtil.getString(res);
|
||||
mAppName = WordUtil.getString(res);
|
||||
}
|
||||
return mAppName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取App图标的资源id
|
||||
*/
|
||||
@@ -447,9 +454,10 @@ public class CommonAppConfig {
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("tag","url:"+res);
|
||||
Log.i("tag", "url:" + res);
|
||||
return res;
|
||||
}
|
||||
|
||||
private static boolean getMetaDataBoolean(String key) {
|
||||
boolean res = false;
|
||||
try {
|
||||
@@ -462,6 +470,18 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
private static int getMetaDataInt(String key) {
|
||||
int res = 0;
|
||||
try {
|
||||
ApplicationInfo appInfo = CommonAppContext.sInstance.getPackageManager().getApplicationInfo(CommonAppContext.sInstance.getPackageName(), PackageManager.GET_META_DATA);
|
||||
res = appInfo.metaData.getInt(key);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
@@ -670,40 +690,45 @@ public class CommonAppConfig {
|
||||
public void setBeautySdkType(String sproutType) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_SDK_TYPE, sproutType);
|
||||
}
|
||||
|
||||
public String getBeautySdkType() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_SDK_TYPE);
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_SDK_TYPE);
|
||||
}
|
||||
|
||||
//设置是否显示转盘功能
|
||||
public void setTurnTableEnable(String enable) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.TURNTABLE_ENABLE, enable);
|
||||
}
|
||||
|
||||
public String getTurnTableEnable() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.TURNTABLE_ENABLE);
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.TURNTABLE_ENABLE);
|
||||
}
|
||||
|
||||
//设置360美颜贴纸下载地址
|
||||
public void setBeauty360TieZhiUrl(String tieZhiUrl) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_360_TIEZHI_URL, tieZhiUrl);
|
||||
}
|
||||
|
||||
public String getBeauty360TieZhiUrl() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_360_TIEZHI_URL);
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_360_TIEZHI_URL);
|
||||
}
|
||||
|
||||
//360贴纸已经下载过
|
||||
public void setBeauty360TieZhiExist(boolean isExist) {
|
||||
SpUtil.getInstance().setBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST, isExist);
|
||||
}
|
||||
|
||||
public boolean getBeauty360TieZhiExist() {
|
||||
return SpUtil.getInstance().getBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST);
|
||||
return SpUtil.getInstance().getBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST);
|
||||
}
|
||||
|
||||
//设置主播pk时间
|
||||
public void setAnchorPkTime(String pkTime){
|
||||
public void setAnchorPkTime(String pkTime) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.ANCHOR_PK_TIME, pkTime);
|
||||
}
|
||||
public String getAnchorPkTime(){
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
|
||||
|
||||
public String getAnchorPkTime() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
// RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK
|
||||
//设置新加坡融云服务器 有时候国内收不到推送是因为这个
|
||||
RongIMClient.setServerInfo("navsg01.cn.ronghub.com", null);
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder()
|
||||
.enableFCM(true)
|
||||
.build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
}
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
@@ -86,6 +86,9 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
}
|
||||
|
||||
public static Activity getTopActivity() {
|
||||
if (activityWeakReference == null) {
|
||||
return null;
|
||||
}
|
||||
return activityWeakReference.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -185,6 +185,7 @@ public class Constants {
|
||||
public static final String LIVE_PK_END = "endPK";//结束PK,以这个PK获取到的参数为准
|
||||
public static final String RED_PACKET = "RedPacket";//红包通知
|
||||
public static final String RED_PACKET_SUPER_JACKPOT = "RedPacketSuperJackpot";//超级红包通知
|
||||
public static final String SOCKET_LIVE_MSG_TO_USER = "SendMsgToUser";//七日用户主播提示语
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||
@@ -178,11 +179,15 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
}
|
||||
//友盟统计
|
||||
// MobclickAgent.onResume(this);
|
||||
MobclickAgent.onPageStart(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
MobclickAgent.onPageEnd(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag);
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onPause();
|
||||
@@ -376,4 +381,5 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class SudGameActivity extends AbsActivity {
|
||||
private FrameLayout gameContainer;
|
||||
private long mInteractionID;
|
||||
private String mLiveUid;
|
||||
private final QuickStartGameViewModel gameViewModel = new QuickStartGameViewModel(); // 创建ViewModel
|
||||
|
||||
private CreateSudRoomModel mCreateSudRoomModel;
|
||||
private TextView gameTitle, roomName, roomNumber;
|
||||
private RoundedImageView mAvatar;
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_sud_game;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private void initDate() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo("1", new HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
for (CustomSidebarInfoModel datum : data) {
|
||||
if (datum.getType().equals("6")) {
|
||||
customSidebarChildModels = datum.getChild();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
|
||||
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
|
||||
gameContainer = findViewById(R.id.game_container);
|
||||
gameTitle = findViewById(R.id.game_title);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
roomNumber = findViewById(R.id.room_number);
|
||||
mAvatar = findViewById(R.id.avatar);
|
||||
if (mCreateSudRoomModel != null) {
|
||||
gameTitle.setText(mCreateSudRoomModel.getSudGameName());
|
||||
roomName.setText(mCreateSudRoomModel.getRoomName());
|
||||
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
|
||||
ImgLoader.display(mContext, mCreateSudRoomModel.getAvatar(), mAvatar);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
gameViewModel.onDestroy();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(mContext, customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
|
||||
@Override
|
||||
public void onChanged(View view) {
|
||||
if (view == null) { // 在关闭游戏时,把游戏View给移除
|
||||
gameContainer.removeAllViews();
|
||||
} else { // 把游戏View添加到容器内
|
||||
gameContainer.addView(view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 加载游戏,参数定义可查看BaseGameViewModel.switchGame()方法注释
|
||||
// 游戏配置
|
||||
GameConfigModel gameConfigModel = gameViewModel.getGameConfigModel();
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
gameConfigModel.ui.game_settle_again_btn.custom = true;
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) mContext, mLiveUid, mInteractionID);
|
||||
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, -1, true, 1);
|
||||
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfCaptain(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
||||
// ViewClicksAntiShake.clicksAntiShake(gameTitle, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
// @Override
|
||||
// public void onViewClicks() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getStatus()==1){
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfPlaying(true);
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_STATE:
|
||||
LiveNetManager.get(mContext).deductMoney( mCreateSudRoomModel.getSudGameRoomId());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
@@ -47,6 +48,7 @@ import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.HintCustomPopup;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -111,7 +113,13 @@ public class WebViewActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
setTitle(view.getTitle());
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setTitle(view.getTitle());
|
||||
}
|
||||
}, 500);
|
||||
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
@@ -254,7 +262,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
mIsLive = isLive;
|
||||
if (Constants.LoginKefu) {
|
||||
if (addArgs) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(context, WebViewActivity.class);
|
||||
@@ -262,7 +270,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void forward(Context context, String url,boolean isLive) {
|
||||
public static void forward(Context context, String url, boolean isLive) {
|
||||
forward(context, url, true, isLive);
|
||||
}
|
||||
|
||||
@@ -330,6 +338,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -434,4 +443,11 @@ public class WebViewActivity extends AbsActivity {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.playerObject;
|
||||
import com.yunbao.common.views.AvatarListViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AvatarListAdapter extends RecyclerView.Adapter {
|
||||
private List<playerObject> playerObjects = new ArrayList<>();
|
||||
|
||||
public AvatarListAdapter(List<playerObject> playerObjects) {
|
||||
this.playerObjects = playerObjects;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_avatar_list_view, parent, false);
|
||||
return new AvatarListViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
AvatarListViewHolder avatarListViewHolder = (AvatarListViewHolder) holder;
|
||||
avatarListViewHolder.setData(playerObjects.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return playerObjects.size();
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,14 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
||||
import com.yunbao.common.views.DrawerTaskViewHolder;
|
||||
import com.yunbao.common.views.FunGamesViewHolder;
|
||||
import com.yunbao.common.views.InteractionGamesViewHolder;
|
||||
import com.yunbao.common.views.RecommendViewHolder;
|
||||
import com.yunbao.common.views.RigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
@@ -72,9 +75,12 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rights_interests, parent, false);
|
||||
return new RigtsInterestsViewHolder(rightsInterestsView);
|
||||
default:
|
||||
case RECOMMEND:
|
||||
View recommendView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_recommend, parent, false);
|
||||
return new RecommendViewHolder(recommendView);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_interaction_games_view, parent, false);
|
||||
return new InteractionGamesViewHolder(gamesView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +98,9 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
} else if (holder instanceof RigtsInterestsViewHolder) {
|
||||
RigtsInterestsViewHolder rigtsInterestsViewHolder = (RigtsInterestsViewHolder) holder;
|
||||
rigtsInterestsViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof InteractionGamesViewHolder) {
|
||||
InteractionGamesViewHolder interactionGamesViewHolder = (InteractionGamesViewHolder) holder;
|
||||
interactionGamesViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof RecommendViewHolder) {
|
||||
|
||||
RecommendViewHolder recommendViewHolder = (RecommendViewHolder) holder;
|
||||
@@ -101,9 +110,13 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
recommendViewHolder.setListener(new RecommendViewHolder.RecommendViewListener() {
|
||||
@Override
|
||||
public void changeOneBatch() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("num", "9");
|
||||
map.put("live_recommend", "sidebar");
|
||||
map.put("refresh", "1");
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend("9", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
@Override
|
||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||
|
||||
@@ -122,7 +135,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
ToastUtil.show(mContext.getString(R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.FunGamesChildViewHolder;
|
||||
import com.yunbao.common.views.NewRoleFunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private boolean showRed = false;
|
||||
public LiveNewRoleFunGamesAdapter(Context mContext, boolean rigts,boolean showRed) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
this.showRed = showRed;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public LiveNewRoleInteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new NewRoleCustomDrawerPopupEvent()
|
||||
.setDisMiss(true)
|
||||
.setInteractionID(activityID)
|
||||
.setChild(child)
|
||||
.setInteraction(true));
|
||||
}
|
||||
|
||||
|
||||
Bus.get().post(new LiveNewRoleEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.views.LiveNewRoleFunGamesViewHolder;
|
||||
import com.yunbao.common.views.LiveNewRoleInteractionGamesViewHolder;
|
||||
import com.yunbao.common.views.LiveNewRoleRigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
|
||||
private final int FUN_GAMES = 3;
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
private boolean showRed = false;
|
||||
public LiveNewRolerPopupAdapter(Context mContext,boolean showRed) {
|
||||
this.mContext = mContext;
|
||||
this.showRed = showRed;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
switch (viewType) {
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView);
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof LiveNewRoleFunGamesViewHolder) {
|
||||
LiveNewRoleFunGamesViewHolder funGamesViewHolder = (LiveNewRoleFunGamesViewHolder) holder;
|
||||
funGamesViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof LiveNewRoleRigtsInterestsViewHolder) {
|
||||
LiveNewRoleRigtsInterestsViewHolder rigtsInterestsViewHolder = (LiveNewRoleRigtsInterestsViewHolder) holder;
|
||||
rigtsInterestsViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof LiveNewRoleInteractionGamesViewHolder) {
|
||||
LiveNewRoleInteractionGamesViewHolder interactionGamesViewHolder = (LiveNewRoleInteractionGamesViewHolder) holder;
|
||||
interactionGamesViewHolder.setData(infoModels.get(position));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return infoModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
CustomSidebarInfoModel model = infoModels.get(position);
|
||||
switch (model.getType()) {
|
||||
|
||||
case "3":
|
||||
return FUN_GAMES;
|
||||
case "4":
|
||||
return RIGHTS_INTERESTS;
|
||||
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
|
||||
infoModels.clear();
|
||||
infoModels.addAll(mInfoModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private CustomDrawerListener listener;
|
||||
|
||||
public LiveNewRolerPopupAdapter setListener(CustomDrawerListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface CustomDrawerListener {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.DayWishItemViewHolder;
|
||||
import com.yunbao.common.views.LunarWishItemViewHolder;
|
||||
import com.yunbao.common.views.SeasonalWishItemViewHolder;
|
||||
@@ -53,7 +54,7 @@ public class LiveNewWishAdapter extends RecyclerView.Adapter {
|
||||
if (wishList.get(i)!=null){
|
||||
if (!TextUtils.isEmpty(wishList.get(i).getLid()) && !TextUtils.isEmpty(model.getLid())
|
||||
&& TextUtils.equals(wishList.get(i).getLid(), model.getLid())) {
|
||||
ToastUtil.show(R.string.too_many_gifts);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"重複添加禮物":"Too many gifts");
|
||||
isAdd = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GameRecordModel;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryViewHolder;
|
||||
|
||||
public class LiveSudGameHistoryAdapter extends RefreshAdapter<GameRecordModel> {
|
||||
|
||||
public LiveSudGameHistoryAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSudGameHistoryViewHolder(mInflater.inflate(R.layout.item_live_sud_game_history, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSudGameHistoryViewHolder sudGameListViewHolder = (LiveSudGameHistoryViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.NewRoleFunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private boolean rigts;
|
||||
|
||||
public NewRoleFunGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view2, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
|
||||
public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudGameListAdapter(Context context, boolean isHome) {
|
||||
super(context);
|
||||
this.isHome = isHome;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome){
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
}else {
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudGameListViewHolder sudGameListViewHolder = (SudGameListViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position),isHome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameSearchHistoryListAdapter extends RecyclerView.Adapter<SudGameSearchHistoryListAdapter.ViewHolder> {
|
||||
private List<String> mList;
|
||||
private Context mContext;
|
||||
private OnItemClickListener<String> onItemClickListener;
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudGameSearchHistoryListAdapter(Context mContext, boolean isHome) {
|
||||
this.isHome = isHome;
|
||||
this.mContext = mContext;
|
||||
mList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<String> list) {
|
||||
this.mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<String> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_search_history, parent, false));
|
||||
} else {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_search_history, parent, false));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return Math.min(mList.size(), 5);
|
||||
}
|
||||
|
||||
public List<String> getList() {
|
||||
return mList;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView nameView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
nameView = itemView.findViewById(R.id.history);
|
||||
|
||||
}
|
||||
|
||||
public void setData(String name) {
|
||||
nameView.setText(name);
|
||||
nameView.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(name, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class SudGameSearchRoomListAdapter extends RecyclerView.Adapter<SudGameSearchRoomListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudHomeGameListAdapter extends RecyclerView.Adapter<SudGameListViewHolder> {
|
||||
private Context mContext;
|
||||
private List<SudRoomListModel> mList;
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudHomeGameListAdapter(Context mContext, boolean isHome) {
|
||||
this.mContext = mContext;
|
||||
this.isHome = isHome;
|
||||
mList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<SudRoomListModel> mList) {
|
||||
this.mList = mList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SudGameListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome) {
|
||||
return new SudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
} else {
|
||||
return new SudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SudGameListViewHolder holder, int position) {
|
||||
holder.setData(mList.get(position),isHome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.SudTitleSelectViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
||||
|
||||
private List<String> selectString = new ArrayList<>();
|
||||
|
||||
private int mIndex;
|
||||
private int mType;
|
||||
|
||||
public SudTitleSelectAdapter(List<String> selectString, int index, int type) {
|
||||
this.selectString = selectString;
|
||||
mIndex = index;
|
||||
mType = type;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_title_select_view, parent, false);
|
||||
return new SudTitleSelectViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudTitleSelectViewHolder childViewHolder = (SudTitleSelectViewHolder) holder;
|
||||
childViewHolder.setData(selectString.get(position), mIndex == position, position, new SudTitleSelectViewHolder.SudTitleSelectListener() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
if (sudTitleSelectCallBack != null) {
|
||||
sudTitleSelectCallBack.onSudTitleSelectCallBack(index);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return selectString.size();
|
||||
}
|
||||
|
||||
private SudTitleSelectCallBack sudTitleSelectCallBack;
|
||||
|
||||
public void setSudTitleSelectCallBack(SudTitleSelectCallBack sudTitleSelectCallBack) {
|
||||
this.sudTitleSelectCallBack = sudTitleSelectCallBack;
|
||||
}
|
||||
|
||||
public interface SudTitleSelectCallBack {
|
||||
void onSudTitleSelectCallBack(int index);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* 活动
|
||||
@@ -105,7 +106,7 @@ public class ActiveModel extends BaseModel {
|
||||
"?uid=" + userInfo.getId() +
|
||||
"&token=" + userInfo.getToken()
|
||||
+ "&anchorUid=" + liveUid
|
||||
+ "&active_id=" + activeId;
|
||||
+ "&active_id=" + activeId+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CheckRemainingBalance extends BaseModel {
|
||||
|
||||
@SerializedName("golden_bean_remaining_balance")
|
||||
private int goldenBeanRemainingBalance;
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
@SerializedName("deduct_money_key")
|
||||
private String deductMoneyKey;
|
||||
|
||||
public String getDeductMoneyKey() {
|
||||
return deductMoneyKey;
|
||||
}
|
||||
|
||||
public CheckRemainingBalance setDeductMoneyKey(String deductMoneyKey) {
|
||||
this.deductMoneyKey = deductMoneyKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public CheckRemainingBalance setStatus(int status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getGoldenBeanRemainingBalance() {
|
||||
return goldenBeanRemainingBalance;
|
||||
}
|
||||
|
||||
public void setGoldenBeanRemainingBalance(int goldenBeanRemainingBalance) {
|
||||
this.goldenBeanRemainingBalance = goldenBeanRemainingBalance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CreateSudRoomModel extends BaseModel {
|
||||
|
||||
@SerializedName("sud_game_room_id")
|
||||
private String sudGameRoomId;
|
||||
@SerializedName("sud_game_id")
|
||||
private String sudGameId;
|
||||
@SerializedName("room_holder_id")
|
||||
private int roomHolderId;
|
||||
@SerializedName("room_holder_name")
|
||||
private String roomHolderName;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("room_holder_type")
|
||||
private int roomHolderType;
|
||||
@SerializedName("sud_game_name")
|
||||
private String sudGameName;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("room_status")
|
||||
private String roomStatus;
|
||||
@SerializedName("player_total")
|
||||
private String playerTotal;
|
||||
@SerializedName("ob_total")
|
||||
private String obTotal;
|
||||
@SerializedName("mg_id")
|
||||
private String mgId;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudGameIcon;
|
||||
|
||||
public String getSudGameRoomId() {
|
||||
return sudGameRoomId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameRoomId(String sudGameRoomId) {
|
||||
this.sudGameRoomId = sudGameRoomId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameId() {
|
||||
return sudGameId;
|
||||
}
|
||||
|
||||
public long getLongSudGameId() {
|
||||
try {
|
||||
if (TextUtils.isEmpty(sudGameId)) {
|
||||
return 0;
|
||||
} else {
|
||||
return Long.parseLong(sudGameId);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameId(String sudGameId) {
|
||||
this.sudGameId = sudGameId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRoomHolderId() {
|
||||
return roomHolderId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderId(int roomHolderId) {
|
||||
this.roomHolderId = roomHolderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderName() {
|
||||
return roomHolderName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderName(String roomHolderName) {
|
||||
this.roomHolderName = roomHolderName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderType(int roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameName() {
|
||||
return sudGameName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameName(String sudGameName) {
|
||||
this.sudGameName = sudGameName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomStatus() {
|
||||
return roomStatus;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomStatus(String roomStatus) {
|
||||
this.roomStatus = roomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPlayerTotal() {
|
||||
return playerTotal;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setPlayerTotal(String playerTotal) {
|
||||
this.playerTotal = playerTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getObTotal() {
|
||||
return obTotal;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setObTotal(String obTotal) {
|
||||
this.obTotal = obTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMgId() {
|
||||
return mgId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setMgId(String mgId) {
|
||||
this.mgId = mgId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameIcon() {
|
||||
return sudGameIcon;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameIcon(String sudGameIcon) {
|
||||
this.sudGameIcon = sudGameIcon;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,17 @@ public class CustomSidebarChildModel extends BaseModel {
|
||||
private String flag = "";
|
||||
@SerializedName("is_show")
|
||||
private String isShow;
|
||||
@SerializedName("sud_game_is_new")
|
||||
private String sudGameIsNew;
|
||||
|
||||
public String getSudGameIsNew() {
|
||||
return sudGameIsNew;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSudGameIsNew(String sudGameIsNew) {
|
||||
this.sudGameIsNew = sudGameIsNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsShow() {
|
||||
return isShow;
|
||||
|
||||
@@ -26,6 +26,8 @@ public class CustomSidebarInfoModel extends BaseModel {
|
||||
private String src;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("sud_game_is_new")
|
||||
private String sudGameIsNew;
|
||||
@SerializedName("child")
|
||||
private List<CustomSidebarChildModel> child;
|
||||
|
||||
@@ -38,6 +40,15 @@ public class CustomSidebarInfoModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameIsNew() {
|
||||
return sudGameIsNew;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSudGameIsNew(String sudGameIsNew) {
|
||||
this.sudGameIsNew = sudGameIsNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,40 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
@SerializedName("wishListProgress")
|
||||
private WishModel wishListProgress;
|
||||
|
||||
@SerializedName("sud_game_room_status")
|
||||
private String sudGameRoomStatus;
|
||||
@SerializedName("sud_game_room_name")
|
||||
private String sudGameRoomName;
|
||||
@SerializedName("sud_gameDate")
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
|
||||
public SudGameDateModel getSudGameDateModel() {
|
||||
return sudGameDateModel;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameDateModel(SudGameDateModel sudGameDateModel) {
|
||||
this.sudGameDateModel = sudGameDateModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomName() {
|
||||
return sudGameRoomName;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameRoomName(String sudGameRoomName) {
|
||||
this.sudGameRoomName = sudGameRoomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomStatus() {
|
||||
return sudGameRoomStatus;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameRoomStatus(String sudGameRoomStatus) {
|
||||
this.sudGameRoomStatus = sudGameRoomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public WishModel getWishListProgress() {
|
||||
return wishListProgress;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GameRecordModel extends BaseModel{
|
||||
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
@SerializedName("currency_type")
|
||||
private int currencyType;
|
||||
@SerializedName("settlement")
|
||||
private int settlement;
|
||||
@SerializedName("game_end_time")
|
||||
private String gameEndTime;
|
||||
@SerializedName("user_name")
|
||||
private List<String> userName;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public void setCurrencyType(int currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
}
|
||||
|
||||
public int getSettlement() {
|
||||
return settlement;
|
||||
}
|
||||
|
||||
public void setSettlement(int settlement) {
|
||||
this.settlement = settlement;
|
||||
}
|
||||
|
||||
public String getGameEndTime() {
|
||||
return gameEndTime;
|
||||
}
|
||||
|
||||
public void setGameEndTime(String gameEndTime) {
|
||||
this.gameEndTime = gameEndTime;
|
||||
}
|
||||
|
||||
public List<String> getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(List<String> userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,45 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LinkMicUserBean extends BaseModel {
|
||||
@SerializedName("user_nicename")
|
||||
private String uname;
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("dress_avatar")
|
||||
private String dress_avatar;
|
||||
private String uid = "";
|
||||
private String action;
|
||||
@SerializedName("id")
|
||||
private String id;//连麦显示右侧头像时要用
|
||||
@SerializedName("user_nicename")
|
||||
private String userNicename;
|
||||
@SerializedName("uname")
|
||||
private String uname;
|
||||
@SerializedName("level")
|
||||
private int level;
|
||||
@SerializedName("sex")
|
||||
private int sex;
|
||||
@SerializedName("dress_avatar")
|
||||
private String dressAvatar;
|
||||
|
||||
public String getUname() {
|
||||
return uname;
|
||||
if (TextUtils.isEmpty(uname)){
|
||||
return userNicename;
|
||||
}else {
|
||||
return uname;
|
||||
}
|
||||
}
|
||||
|
||||
public void setUname(String uname) {
|
||||
public LinkMicUserBean setUname(String uname) {
|
||||
this.uname = uname;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
@@ -34,28 +50,17 @@ public class LinkMicUserBean extends BaseModel {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
public String getUserNicename() {
|
||||
if (TextUtils.isEmpty(uname)){
|
||||
return userNicename;
|
||||
}else {
|
||||
return uname;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getDress_avatar() {
|
||||
return dress_avatar;
|
||||
}
|
||||
|
||||
public void setDress_avatar(String dress_avatar) {
|
||||
this.dress_avatar = dress_avatar;
|
||||
public void setUserNicename(String userNicename) {
|
||||
this.userNicename = userNicename;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
@@ -74,25 +79,11 @@ public class LinkMicUserBean extends BaseModel {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
public String getDressAvatar() {
|
||||
return dressAvatar;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LinkMicUserBean{" +
|
||||
"uname='" + uname + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", dress_avatar='" + dress_avatar + '\'' +
|
||||
", uid='" + uid + '\'' +
|
||||
", action='" + action + '\'' +
|
||||
", id='" + id + '\'' +
|
||||
", level=" + level +
|
||||
", sex=" + sex +
|
||||
'}';
|
||||
public void setDressAvatar(String dressAvatar) {
|
||||
this.dressAvatar = dressAvatar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ public class LiveBean implements Parcelable {
|
||||
private String recommendCardIconSizeThree = "";
|
||||
@SerializedName("red_packet_status")
|
||||
private int redPacketStatus;
|
||||
|
||||
@SerializedName("giftId")
|
||||
private String giftId;
|
||||
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||
|
||||
public String getRecommendCardIconSizeTwo() {
|
||||
@@ -66,6 +67,14 @@ public class LiveBean implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public String getRecommendCardIcon() {
|
||||
if (TextUtils.isEmpty(recommendCardIconSizeThree)) {
|
||||
if (!TextUtils.isEmpty(recommendCardIconSizeTwo)) {
|
||||
@@ -444,6 +453,7 @@ public class LiveBean implements Parcelable {
|
||||
this.recommendCardtype = in.readString();
|
||||
this.recommendCardIconSizeTwo = in.readString();
|
||||
this.recommendCardIconSizeThree = in.readString();
|
||||
this.giftId = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -488,6 +498,7 @@ public class LiveBean implements Parcelable {
|
||||
dest.writeString(this.recommendCardtype);
|
||||
dest.writeString(this.recommendCardIconSizeTwo);
|
||||
dest.writeString(this.recommendCardIconSizeThree);
|
||||
dest.writeString(this.giftId);
|
||||
}
|
||||
|
||||
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
@@ -16,6 +17,8 @@ public class LiveClassBean {
|
||||
private boolean checked;
|
||||
private String chinese;
|
||||
private String english;
|
||||
@SerializedName("channel_show")
|
||||
private int channel_show;
|
||||
|
||||
public String getChinese() {
|
||||
return chinese;
|
||||
@@ -92,4 +95,12 @@ public class LiveClassBean {
|
||||
public void setChecked(boolean checked) {
|
||||
this.checked = checked;
|
||||
}
|
||||
|
||||
public int getChannel_show() {
|
||||
return channel_show;
|
||||
}
|
||||
|
||||
public void setChannel_show(int channel_show) {
|
||||
this.channel_show = channel_show;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,28 @@ public class LiveGiftBean {
|
||||
private String namingCoin;
|
||||
@JSONField(name = "naming_user_coin")
|
||||
private String namingUserCoin;
|
||||
@JSONField(name = "blind_box_ticket")
|
||||
private int blindBoxTicket;
|
||||
@JSONField(name = "blind_box_ticket_id")
|
||||
private int blindBoxTicketId;
|
||||
|
||||
public int getBlindBoxTicketId() {
|
||||
return blindBoxTicketId;
|
||||
}
|
||||
|
||||
public LiveGiftBean setBlindBoxTicketId(int blindBoxTicketId) {
|
||||
this.blindBoxTicketId = blindBoxTicketId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getBlindBoxTicket() {
|
||||
return blindBoxTicket;
|
||||
}
|
||||
|
||||
public LiveGiftBean setBlindBoxTicket(int blindBoxTicket) {
|
||||
this.blindBoxTicket = blindBoxTicket;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingUserCoin() {
|
||||
return namingUserCoin;
|
||||
@@ -202,7 +224,7 @@ public class LiveGiftBean {
|
||||
return this;
|
||||
}
|
||||
|
||||
private int fansGiftLevel=0;//粉丝团礼物等级要求
|
||||
private int fansGiftLevel = 0;//粉丝团礼物等级要求
|
||||
|
||||
public int getFansGiftLevel() {
|
||||
return fansGiftLevel;
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class LiveUserMailBoxModel extends BaseModel {
|
||||
@SerializedName("id")
|
||||
@@ -127,7 +128,7 @@ public class LiveUserMailBoxModel extends BaseModel {
|
||||
url += "?";
|
||||
}
|
||||
url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken();
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
169
common/src/main/java/com/yunbao/common/bean/OpenAdModel.java
Normal file
169
common/src/main/java/com/yunbao/common/bean/OpenAdModel.java
Normal file
@@ -0,0 +1,169 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class OpenAdModel extends BaseModel {
|
||||
public static final int TYPE_HOME = 1;//主页
|
||||
public static final int TYPE_LIVE = 2;//直播间
|
||||
public static final int TYPE_LIVE_DELAY = 3;//直播间延迟
|
||||
public static final int MODEL_SQUARE = 1;//正方形
|
||||
public static final int MODEL_RECTANGLE = 2;//长方形
|
||||
public static final int MODEL_BOTTOM = 3;//底部
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("popup_location")
|
||||
private int type = TYPE_HOME;
|
||||
@SerializedName("activity_url")
|
||||
private String url;
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl;
|
||||
@SerializedName("display_time")
|
||||
private int showTime; //持续展示时间
|
||||
@SerializedName("delay_show_time")
|
||||
private int delayShowTime;//延迟展示时间
|
||||
@SerializedName("popup_model")
|
||||
private int model = MODEL_SQUARE;
|
||||
@SerializedName("start_show_time")
|
||||
private String startTime;//活动开始时间
|
||||
@SerializedName("end_show_time")
|
||||
private String endTime;//活动结束时间
|
||||
@SerializedName("popup_permission")
|
||||
private int permission;
|
||||
|
||||
|
||||
public OpenAdModel() {
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
if (!url.startsWith("http://") || !url.startsWith("https://")) {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
}
|
||||
return url + "?t=" + System.currentTimeMillis() / 1000;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public int getShowTime() {
|
||||
return showTime * 1000;
|
||||
}
|
||||
|
||||
public void setShowTime(int showTime) {
|
||||
this.showTime = showTime;
|
||||
}
|
||||
|
||||
public int getDelayShowTime() {
|
||||
return delayShowTime * 1000;
|
||||
}
|
||||
|
||||
public void setDelayShowTime(int delayShowTime) {
|
||||
this.delayShowTime = delayShowTime;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public int getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setModel(int model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getPermission() {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public void setPermission(int permission) {
|
||||
this.permission = permission;
|
||||
}
|
||||
|
||||
public boolean isInTime() {
|
||||
if (StringUtil.isEmpty(startTime, endTime)) {
|
||||
return true;
|
||||
}
|
||||
Date startTime = null;
|
||||
Date endTime = null;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
|
||||
try {
|
||||
startTime = sdf.parse(this.startTime);
|
||||
endTime = sdf.parse(this.endTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
return startTime.getTime() <= time && time <= endTime.getTime();
|
||||
}
|
||||
|
||||
public boolean userIsPermission(boolean isGuard) {
|
||||
if (permission == 4 && !isGuard) {//守护不可见
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OpenAdModel{" +
|
||||
"id=" + id +
|
||||
", type=" + type +
|
||||
", url='" + url + '\'' +
|
||||
", imageUrl='" + imageUrl + '\'' +
|
||||
", showTime=" + showTime +
|
||||
", delayShowTime=" + delayShowTime +
|
||||
", model=" + model +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", permission='" + permission + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@ public class PkRankBean extends BaseModel {
|
||||
public String clickUrl;
|
||||
@SerializedName("vs_img")
|
||||
public String vsImgUrl;
|
||||
@SerializedName("new_rank_name_en")
|
||||
public String newRankNameEn;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@@ -94,6 +96,14 @@ public class PkRankBean extends BaseModel {
|
||||
this.vsImgUrl = vsImgUrl;
|
||||
}
|
||||
|
||||
public String getNewRankNameEn() {
|
||||
return newRankNameEn;
|
||||
}
|
||||
|
||||
public void setNewRankNameEn(String newRankNameEn) {
|
||||
this.newRankNameEn = newRankNameEn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PkRankBean{" +
|
||||
@@ -105,6 +115,7 @@ public class PkRankBean extends BaseModel {
|
||||
", pkTopImgUrl='" + pkTopImgUrl + '\'' +
|
||||
", clickUrl='" + clickUrl + '\'' +
|
||||
", vsImgUrl='" + vsImgUrl + '\'' +
|
||||
", newRankNameEn='" + newRankNameEn + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ public class RedPacketInfoModel extends BaseModel {
|
||||
private String redPacketMoney;
|
||||
@SerializedName("red_packet_quantity")
|
||||
private String redPacketQuantity;
|
||||
@SerializedName("is_fans")
|
||||
private String isFans;
|
||||
@SerializedName("conditions")
|
||||
private String conditions;
|
||||
@SerializedName("create_time")
|
||||
@@ -270,4 +272,12 @@ public class RedPacketInfoModel extends BaseModel {
|
||||
this.userGoldenBean = userGoldenBean;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsFans() {
|
||||
return isFans.equals("1");
|
||||
}
|
||||
|
||||
public void setIsFans(String isFans) {
|
||||
this.isFans = isFans;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class SudGameDateModel extends BaseModel{
|
||||
|
||||
@SerializedName("room_holder_id")
|
||||
private String roomHolderId;
|
||||
@SerializedName("sex")
|
||||
private String sex;
|
||||
@SerializedName("golden_bean_number")
|
||||
private String goldenBeanNumber;
|
||||
|
||||
@SerializedName("room_holder_type")
|
||||
private String roomHolderType;
|
||||
@SerializedName("sud_game_id")
|
||||
private String sudGameId;
|
||||
@SerializedName("room_status")
|
||||
private String roomStatus;
|
||||
@SerializedName("sud_game_name")
|
||||
private String sudGameName;
|
||||
@SerializedName("sud_game_name_en")
|
||||
private String sud_game_name_en;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("player_total")
|
||||
private String playerTotal;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudGameIcon;
|
||||
@SerializedName("room_holder_name")
|
||||
private String roomHolderName;
|
||||
@SerializedName("sud_game_room_id")
|
||||
private String sudGameRoomId;
|
||||
@SerializedName("ob_total")
|
||||
private String obTotal;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("liveuid")
|
||||
private String liveuid;
|
||||
|
||||
public String getRoomHolderId() {
|
||||
return roomHolderId;
|
||||
}
|
||||
|
||||
public String getSud_game_name_en() {
|
||||
return sud_game_name_en;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSud_game_name_en(String sud_game_name_en) {
|
||||
this.sud_game_name_en = sud_game_name_en;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudGameDateModel setRoomHolderId(String roomHolderId) {
|
||||
this.roomHolderId = roomHolderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSex(String sex) {
|
||||
this.sex = sex;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGoldenBeanNumber() {
|
||||
return goldenBeanNumber;
|
||||
}
|
||||
|
||||
public SudGameDateModel setGoldenBeanNumber(String goldenBeanNumber) {
|
||||
this.goldenBeanNumber = goldenBeanNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public SudGameDateModel setRoomHolderType(String roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameId() {
|
||||
return sudGameId;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSudGameId(String sudGameId) {
|
||||
this.sudGameId = sudGameId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomStatus() {
|
||||
return roomStatus;
|
||||
}
|
||||
|
||||
public SudGameDateModel setRoomStatus(String roomStatus) {
|
||||
this.roomStatus = roomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameName() {
|
||||
return sudGameName;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSudGameName(String sudGameName) {
|
||||
this.sudGameName = sudGameName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public SudGameDateModel setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPlayerTotal() {
|
||||
return playerTotal;
|
||||
}
|
||||
|
||||
public SudGameDateModel setPlayerTotal(String playerTotal) {
|
||||
this.playerTotal = playerTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameIcon() {
|
||||
return sudGameIcon;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSudGameIcon(String sudGameIcon) {
|
||||
this.sudGameIcon = sudGameIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderName() {
|
||||
return roomHolderName;
|
||||
}
|
||||
|
||||
public SudGameDateModel setRoomHolderName(String roomHolderName) {
|
||||
this.roomHolderName = roomHolderName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomId() {
|
||||
return sudGameRoomId;
|
||||
}
|
||||
|
||||
public SudGameDateModel setSudGameRoomId(String sudGameRoomId) {
|
||||
this.sudGameRoomId = sudGameRoomId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getObTotal() {
|
||||
return obTotal;
|
||||
}
|
||||
|
||||
public SudGameDateModel setObTotal(String obTotal) {
|
||||
this.obTotal = obTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public SudGameDateModel setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveuid() {
|
||||
return liveuid;
|
||||
}
|
||||
|
||||
public SudGameDateModel setLiveuid(String liveuid) {
|
||||
this.liveuid = liveuid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudRoomListModel extends BaseModel {
|
||||
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("room_holder_id")
|
||||
private String roomHolderId;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("room_holder_type")
|
||||
private String roomHolderType;
|
||||
@SerializedName("sud_game_id")
|
||||
private String sudGameId;
|
||||
@SerializedName("golden_bean_number")
|
||||
private String goldenBeanNumber;
|
||||
@SerializedName("room_status")
|
||||
private String roomStatus;
|
||||
@SerializedName("sud_game_room_id")
|
||||
private String sudGameRoomId;
|
||||
@SerializedName("room_holder_name")
|
||||
private String roomHolderName;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("sud_game_name")
|
||||
private String sudGameName;
|
||||
@SerializedName("player_total")
|
||||
private String playerTotal;
|
||||
@SerializedName("ob_total")
|
||||
private String obTotal;
|
||||
@SerializedName("liveuid")
|
||||
private String liveUid;
|
||||
@SerializedName("sex")
|
||||
private String sex;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudgameicon;
|
||||
@SerializedName("currency_type")
|
||||
private String currencyType;
|
||||
|
||||
public String getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public SudRoomListModel setCurrencyType(String currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudgameicon() {
|
||||
return sudgameicon;
|
||||
}
|
||||
|
||||
public SudRoomListModel setSudgameicon(String sudgameicon) {
|
||||
this.sudgameicon = sudgameicon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveUid() {
|
||||
return liveUid;
|
||||
}
|
||||
|
||||
public SudRoomListModel setLiveUid(String liveUid) {
|
||||
this.liveUid = liveUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public SudRoomListModel setSex(String sex) {
|
||||
this.sex = sex;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SerializedName("player_object")
|
||||
private List<playerObject> playerObjects = new ArrayList<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public SudRoomListModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderId() {
|
||||
return roomHolderId;
|
||||
}
|
||||
|
||||
public SudRoomListModel setRoomHolderId(String roomHolderId) {
|
||||
this.roomHolderId = roomHolderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public SudRoomListModel setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public SudRoomListModel setRoomHolderType(String roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameId() {
|
||||
return sudGameId;
|
||||
}
|
||||
|
||||
public SudRoomListModel setSudGameId(String sudGameId) {
|
||||
this.sudGameId = sudGameId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGoldenBeanNumber() {
|
||||
return goldenBeanNumber;
|
||||
}
|
||||
|
||||
public SudRoomListModel setGoldenBeanNumber(String goldenBeanNumber) {
|
||||
this.goldenBeanNumber = goldenBeanNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomStatus() {
|
||||
return roomStatus;
|
||||
}
|
||||
|
||||
public SudRoomListModel setRoomStatus(String roomStatus) {
|
||||
this.roomStatus = roomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomId() {
|
||||
return sudGameRoomId;
|
||||
}
|
||||
|
||||
public SudRoomListModel setSudGameRoomId(String sudGameRoomId) {
|
||||
this.sudGameRoomId = sudGameRoomId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderName() {
|
||||
return roomHolderName;
|
||||
}
|
||||
|
||||
public SudRoomListModel setRoomHolderName(String roomHolderName) {
|
||||
this.roomHolderName = roomHolderName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public SudRoomListModel setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameName() {
|
||||
return sudGameName;
|
||||
}
|
||||
|
||||
public SudRoomListModel setSudGameName(String sudGameName) {
|
||||
this.sudGameName = sudGameName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPlayerTotal() {
|
||||
return playerTotal;
|
||||
}
|
||||
|
||||
public SudRoomListModel setPlayerTotal(String playerTotal) {
|
||||
this.playerTotal = playerTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getObTotal() {
|
||||
return obTotal;
|
||||
}
|
||||
|
||||
public SudRoomListModel setObTotal(String obTotal) {
|
||||
this.obTotal = obTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<playerObject> getPlayerObjects() {
|
||||
return playerObjects;
|
||||
}
|
||||
|
||||
public SudRoomListModel setPlayerObjects(List<playerObject> playerObjects) {
|
||||
this.playerObjects = playerObjects;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTotal() {
|
||||
if (TextUtils.isEmpty(obTotal) && TextUtils.isEmpty(playerTotal)) {
|
||||
return "0";
|
||||
} else {
|
||||
int obT = Integer.parseInt(obTotal);
|
||||
int playerO = Integer.parseInt(playerTotal);
|
||||
return String.valueOf(obT + playerO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class SudgameCodeModel extends BaseModel {
|
||||
@SerializedName("code")
|
||||
private String code;
|
||||
@SerializedName("expireDate")
|
||||
private long expireDate;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public SudgameCodeModel setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getExpireDate() {
|
||||
return expireDate;
|
||||
}
|
||||
|
||||
public SudgameCodeModel setExpireDate(long expireDate) {
|
||||
this.expireDate = expireDate;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,38 @@ public class UserBean implements Parcelable {
|
||||
//粉丝团等级
|
||||
private int fansLevel;
|
||||
//粉丝团进场皮肤
|
||||
protected int typeMic;
|
||||
private boolean isMicList = false;
|
||||
|
||||
private boolean isRequest = false;
|
||||
|
||||
public boolean isRequest() {
|
||||
return isRequest;
|
||||
}
|
||||
|
||||
public UserBean setRequest(boolean request) {
|
||||
isRequest = request;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isMicList() {
|
||||
return isMicList;
|
||||
}
|
||||
|
||||
public UserBean setMicList(boolean micList) {
|
||||
isMicList = micList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getTypeMic() {
|
||||
return typeMic;
|
||||
}
|
||||
|
||||
public UserBean setTypeMic(int typeMic) {
|
||||
this.typeMic = typeMic;
|
||||
return this;
|
||||
}
|
||||
|
||||
private String fansEnterRoomUrl;
|
||||
|
||||
public int getUserInfoComplete() {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class playerObject extends BaseModel {
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
public boolean isChange = false;
|
||||
|
||||
public boolean isChange() {
|
||||
return isChange;
|
||||
}
|
||||
|
||||
public playerObject setChange(boolean change) {
|
||||
isChange = change;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public playerObject setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public playerObject setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
|
||||
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.yunbao.common.R;
|
||||
@@ -188,7 +187,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
if (mRecyclerView != null) {
|
||||
RecyclerView.Adapter adapter = mRecyclerView.getAdapter();
|
||||
if (adapter != null && adapter.getItemCount() > 0) {
|
||||
ToastUtil.show(R.string.load_failure);
|
||||
ToastUtil.show(mContext.getString(R.string.load_failure));
|
||||
} else {
|
||||
mLoadFailureView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -196,7 +195,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
mLoadFailureView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(R.string.load_failure);
|
||||
ToastUtil.show(mContext.getString(R.string.load_failure));
|
||||
}
|
||||
}
|
||||
if (mDataHelper != null) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.impl.FullScreenPopupView;
|
||||
|
||||
/**
|
||||
* 居中弹窗
|
||||
*/
|
||||
public abstract class AbsDialogFullScreenPopupWindow extends FullScreenPopupView {
|
||||
public final Context mContext;
|
||||
|
||||
public AbsDialogFullScreenPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
|
||||
*/
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return bindLayoutId();
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
XPopup.Builder builder = new XPopup.Builder(mContext);
|
||||
builder.isDestroyOnDismiss(true);
|
||||
builder.enableDrag(false);
|
||||
buildDialog(builder);
|
||||
builder.asCustom(this).show();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import static androidx.core.content.ContextCompat.getSystemService;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.SudGameActivity;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CreateSudGameEvent;
|
||||
import com.yunbao.common.event.CurrencyTypeEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public class CreateSudGamePopup extends BottomPopupView {
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private TextView createGameType, selectCurrencyType;
|
||||
private EditText roomName, gameSill;
|
||||
private long interactionID = 0;
|
||||
private String id;
|
||||
private boolean isHomeView;
|
||||
private boolean isHome = false;
|
||||
private List<String> roomNames = new ArrayList<>();
|
||||
|
||||
private String currencyType = "3", currencyTypeName;
|
||||
private long animDuration = 500;
|
||||
private ImageView roomGameArrow;
|
||||
|
||||
public CreateSudGamePopup(@NonNull Context context, List<CustomSidebarChildModel> child, boolean isHome) {
|
||||
super(context);
|
||||
customSidebarChildModels = child;
|
||||
this.isHome = isHome;
|
||||
}
|
||||
|
||||
public CreateSudGamePopup setHomeView(boolean homeView) {
|
||||
isHomeView = homeView;
|
||||
return this;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
if (isHomeView) {
|
||||
return R.layout.dialog_home_create_sud_game;
|
||||
}
|
||||
return R.layout.dialog_create_sud_game;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initDate();
|
||||
initView();
|
||||
|
||||
}
|
||||
|
||||
private String userName;
|
||||
private boolean isYuanbao;
|
||||
|
||||
private void initDate() {
|
||||
currencyTypeName = getContext().getString(R.string.golden_bean);
|
||||
userName = IMLoginManager.get(getContext()).getUserInfo().getUserNicename();
|
||||
roomNames.add(WordUtil.isNewZh() ? "壹起玩吧!" : "Let's play together!");
|
||||
roomNames.add(WordUtil.isNewZh() ? "來戰鬥吧!" : "Let's fight!");
|
||||
roomNames.add(WordUtil.isNewZh() ? "決戰到天亮 " : "Fight until dawn");
|
||||
roomNames.add(WordUtil.isNewZh() ? "在線等遊戲夥伴~" : "Waiting for game partners~");
|
||||
roomNames.add(WordUtil.isNewZh() ? userName + "的房间 " : userName + "‘s room");
|
||||
LiveNetManager.get(getContext()).checkCurrency(new HttpCallback<CheckCurrencyModel>() {
|
||||
@Override
|
||||
public void onSuccess(CheckCurrencyModel data) {
|
||||
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
createGameType = findViewById(R.id.create_game_type);
|
||||
selectCurrencyType = findViewById(R.id.select_currency_type);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
gameSill = findViewById(R.id.game_sill);
|
||||
roomGameArrow = findViewById(R.id.room_game_arrow);
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
ViewClicksAntiShake.clicksAntiShake(createGameType, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (hasMoveUp) {
|
||||
InputMethodManager imm = getSystemService(getContext(), InputMethodManager.class);
|
||||
if (imm != null) {
|
||||
imm.hideSoftInputFromWindow(roomName.getWindowToken(), 0);
|
||||
imm.hideSoftInputFromWindow(gameSill.getWindowToken(), 0);
|
||||
}
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(createGameType);
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||
.show();
|
||||
}
|
||||
}, 500);
|
||||
} else {
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(createGameType);
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
||||
new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.create_room), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
String sill = gameSill.getText().toString();
|
||||
String name = roomName.getText().toString();
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
if (name.length() > 15) {
|
||||
ToastUtil.show("房間名长度为[1-15]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() != Locale.SIMPLIFIED_CHINESE) {
|
||||
if (name.length() > 30) {
|
||||
ToastUtil.show("Room name length is [1-30]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("房间名不能为空");
|
||||
} else {
|
||||
ToastUtil.show("The room name cannot be empty");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(id)) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("还未选择游戏");
|
||||
} else {
|
||||
ToastUtil.show("No game has been selected");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(sill)) {
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
} else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]");
|
||||
} }
|
||||
|
||||
return;
|
||||
}
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
if (sill.length() > 6) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
return;
|
||||
|
||||
} else {
|
||||
int sillNumber = Integer.parseInt(sill);
|
||||
if (sillNumber < 100 || sillNumber > 50000) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sillNumber % 10 != 0) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量必須為10的倍數");
|
||||
} else {
|
||||
ToastUtil.show("The number of currency must be a multiple of 10");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sill.length() > 4) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
int sillNumber = Integer.parseInt(sill);
|
||||
if (sillNumber < 10 || sillNumber > 1000) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sillNumber % 10 != 0) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量必須為10的倍數");
|
||||
} else {
|
||||
ToastUtil.show("The number of currency must be a multiple of 10");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LiveNetManager.get(getContext())
|
||||
.createSudRoom(name, sill, currencyType, id, new HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (isHome) {
|
||||
dialog.dismiss();
|
||||
Intent intent = new Intent(getContext(), SudGameActivity.class);
|
||||
intent.putExtra("CreateSudRoom", new Gson().toJson(data));
|
||||
getContext().startActivity(intent);
|
||||
} else {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
|
||||
dialog.dismiss();
|
||||
Bus.get().post(new SudGameListDissMissEvent());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
roomName.setText(WordUtil.isNewZh() ? userName + "的房间 " : userName + "‘s room");
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.create_game_random), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Random random = new Random();
|
||||
int randomNumber = random.nextInt(roomNames.size());
|
||||
roomName.setText(roomNames.get(randomNumber));
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.currency_type), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
closeAnimSudGameListEvent();
|
||||
}
|
||||
})
|
||||
)
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void closeAnimSudGameListEvent() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
Bus.getOff(this);
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListEvent(CreateSudGameEvent event) {
|
||||
interactionID = event.getInteractionID();
|
||||
createGameType.setText(event.getTitle());
|
||||
id = event.getId();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCurrencyTypeEvent(CurrencyTypeEvent event) {
|
||||
currencyTypeName = event.getCurrencyTypeName();
|
||||
currencyType = event.getCurrencyType();
|
||||
selectCurrencyType.setText(currencyTypeName);
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
} else {
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveNewRolerPopupAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewRolePopup extends BottomPopupView {
|
||||
private boolean showRed = false;
|
||||
|
||||
public LiveNewRolePopup(@NonNull Context context, boolean showRed) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
this.showRed = showRed;
|
||||
}
|
||||
|
||||
private RecyclerView drawerList;
|
||||
private LiveNewRolerPopupAdapter adapter;
|
||||
private Context mContext;
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_live_new_role;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo("1", new com.yunbao.common.http.base.HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
adapter.updateData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
drawerList = findViewById(R.id.drawerList);
|
||||
adapter = new LiveNewRolerPopupAdapter(mContext, showRed);
|
||||
drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
drawerList.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
Bus.getOff(this);
|
||||
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveNewRoleEvent(LiveNewRoleEvent event) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
|
||||
public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
private ImageView mImageView;
|
||||
private ImageView mClose;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
|
||||
public OpenAdBottomDialogPopup(@NonNull Context context, OpenAdModel model) {
|
||||
super(context);
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_open_bottom_ad;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
if (mListener != null) {
|
||||
mListener.onItemClick(model, 0);
|
||||
mListener = null;
|
||||
}
|
||||
}
|
||||
|
||||
public OpenAdBottomDialogPopup setListener(OnItemClickListener<OpenAdModel> mListener) {
|
||||
this.mListener = mListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
mImageView = findViewById(R.id.img);
|
||||
mClose = findViewById(R.id.close);
|
||||
mImageView.setOnClickListener(v -> {
|
||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||
if (mListener != null) {
|
||||
mListener.onItemClick(model, 1);
|
||||
mListener = null;
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
|
||||
public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
private ImageView mImageView;
|
||||
private ImageView mClose;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
|
||||
public OpenAdCenterDialogPopup(@NonNull Context context, OpenAdModel model) {
|
||||
super(context);
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public OpenAdCenterDialogPopup setListener(OnItemClickListener<OpenAdModel> mListener) {
|
||||
this.mListener = mListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_open_center_ad;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
if (mListener != null) {
|
||||
mListener.onItemClick(model, 0);
|
||||
mListener = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
mImageView = findViewById(R.id.img);
|
||||
mClose = findViewById(R.id.close);
|
||||
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
||||
mImageView.setOnClickListener(v -> {
|
||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||
if (mListener != null) {
|
||||
mListener.onItemClick(model, 1);
|
||||
mListener = null;
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
int width = ScreenDimenUtil.getInstance().getScreenWdith() - DpUtil.dp2px(40);
|
||||
int height = (int) (width * 1.4);
|
||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||
height = width;
|
||||
}
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mImageView.getLayoutParams();
|
||||
params.width = width;
|
||||
params.height = height;
|
||||
mImageView.setLayoutParams(params);
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,361 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.adapter.SudGameListAdapter;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.event.SudGameListRefreshEvent;
|
||||
import com.yunbao.common.event.SudGameListSillEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class SudGameListPopup extends BottomPopupView {
|
||||
private long interactionID = 0;
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private ImageView roomGameArrow, roomSillArrow, houseOwnerArrow;
|
||||
|
||||
private TextView gameTitle, sillTitle, houseOwnerTitle;
|
||||
private String id = "0", mLiveUid;
|
||||
private int page = 0;
|
||||
private String mSill = "0,0,0", mSillName, roomHolderType = "0", roomHolderTypeName;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private SudGameListAdapter sudGameListAdapter;
|
||||
|
||||
public SudGameListPopup(@NonNull Context context, long interactionID, List<CustomSidebarChildModel> child, String liveUid) {
|
||||
super(context);
|
||||
this.interactionID = interactionID;
|
||||
customSidebarChildModels = child;
|
||||
mLiveUid = liveUid;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_sud_game_list;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
roomGameArrow = findViewById(R.id.room_game_arrow);
|
||||
roomSillArrow = findViewById(R.id.room_sill_arrow);
|
||||
houseOwnerArrow = findViewById(R.id.house_owner_arrow);
|
||||
gameTitle = findViewById(R.id.game_title);
|
||||
sillTitle = findViewById(R.id.room_sill_text);
|
||||
houseOwnerTitle = findViewById(R.id.house_owner_text);
|
||||
|
||||
mRefreshView = findViewById(R.id.refreshView);
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudGameListAdapter = new SudGameListAdapter(getContext(), false);
|
||||
mRefreshView.setLoadMoreEnable(true);
|
||||
mRefreshView.setRecyclerViewAdapter(sudGameListAdapter);
|
||||
|
||||
for (CustomSidebarChildModel model : customSidebarChildModels) {
|
||||
if (TextUtils.equals(String.valueOf(interactionID), model.getSrc())) {
|
||||
gameTitle.setText(model.getTitle());
|
||||
id = model.getId();
|
||||
}
|
||||
}
|
||||
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SudRoomListModel>() {
|
||||
@Override
|
||||
public RefreshAdapter<SudRoomListModel> getAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
page = p;
|
||||
LiveHttpUtil.getRoomList(id, mSill, roomHolderType, mLiveUid, "3", p - 1, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SudRoomListModel> processData(String[] info) {
|
||||
if (info.length > 0) {
|
||||
List<SudRoomListModel> sudRoomListModels = new ArrayList<>();
|
||||
for (String json : info) {
|
||||
SudRoomListModel model = new Gson().fromJson(json, SudRoomListModel.class);
|
||||
sudRoomListModels.add(model);
|
||||
}
|
||||
return sudRoomListModels;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<SudRoomListModel> list, int listCount) {
|
||||
Log.i("onRefreshSuccess", listCount + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<SudRoomListModel> loadItemList, int loadItemCount) {
|
||||
sudGameListAdapter.insertList(loadItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
mRefreshView.initData();
|
||||
mRefreshView.setEmptyLayoutId(R.layout.sud_no_data1);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.random_start), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.randomRoom(id, mSill, roomHolderType, new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (data != null) {
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
dialog.dismiss();
|
||||
} else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("当前没有可加入的房间");
|
||||
} else {
|
||||
ToastUtil.show("There are currently no rooms to join");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("当前没有可加入的房间");
|
||||
} else {
|
||||
ToastUtil.show("There are currently no rooms to join");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.search), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new SudGameSearchDialogPopup(getContext(), false).showDialog();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_room_game), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.interactive_game_room_game));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 0, customSidebarChildModels, interactionID))
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_sill), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomSillArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.room_sill));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 1, mSillName))
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.house_owner), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(houseOwnerArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.house_owner));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 2, roomHolderTypeName))
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_add), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.moveUpToKeyboard(true)
|
||||
.asCustom(new CreateSudGamePopup(getContext(), customSidebarChildModels, false))
|
||||
|
||||
.show();
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_bottom), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new SudGameRuleBottom(getContext())).show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(getContext(), customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
Bus.getOff(this);
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
|
||||
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListEvent(SudGameListEvent event) {
|
||||
interactionID = event.getInteractionID();
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
gameTitle.setText(event.getTitle());
|
||||
} else {
|
||||
if (event.getTitle().contains("All")) {
|
||||
gameTitle.setText("All");
|
||||
} else {
|
||||
if ((event.getTitle().length() > 6)) {
|
||||
gameTitle.setText(event.getTitle());
|
||||
} else {
|
||||
gameTitle.setText(event.getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
id = event.getId();
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListSillEvent(SudGameListSillEvent event) {
|
||||
mSill = event.getSill();
|
||||
mSillName = event.getSillName();
|
||||
if (TextUtils.equals("0,0,0", mSill)) {
|
||||
sillTitle.setText(mSillName);
|
||||
} else {
|
||||
sillTitle.setText(mSillName.substring(0, mSillName.length() - 2));
|
||||
}
|
||||
|
||||
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomSillArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onRoomHolderTypeEvent(RoomHolderTypeEvent event) {
|
||||
roomHolderType = event.getRoomHolderType();
|
||||
roomHolderTypeName = event.getRoomHolderTypeName();
|
||||
houseOwnerTitle.setText(roomHolderTypeName);
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(houseOwnerArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListRefreshEvent(SudGameListRefreshEvent event) {
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudTitleSelectAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CreateSudGameEvent;
|
||||
import com.yunbao.common.event.CurrencyTypeEvent;
|
||||
import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.event.SudGameListSillEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SudGameListSelectPopup extends AttachPopupView {
|
||||
private int mType;
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private List<String> selectString = new ArrayList<>();
|
||||
private Map<String, String> selectSill = new HashMap<>();
|
||||
private TextView topSelect;
|
||||
|
||||
private RecyclerView sudTitleSelect;
|
||||
|
||||
private SudTitleSelectAdapter sudTitleSelectAdapter;
|
||||
private long interactionID = 0;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
private String mSill;
|
||||
private boolean isYuanbao;
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
|
||||
super(context);
|
||||
customSidebarChildModels = child;
|
||||
mType = type;
|
||||
this.interactionID = interactionID;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill) {
|
||||
super(context);
|
||||
this.mType = mType;
|
||||
mSill = sill;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill, boolean isYuanbao) {
|
||||
super(context);
|
||||
this.mType = mType;
|
||||
mSill = sill;
|
||||
this.isYuanbao = isYuanbao;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
|
||||
super(context);
|
||||
this.mType = 8;
|
||||
mSill = sill;
|
||||
customSidebarChildModels = child;
|
||||
}
|
||||
|
||||
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_sud_game_slelect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
topSelect = findViewById(R.id.top_select);
|
||||
sudTitleSelect = findViewById(R.id.sud_title_select);
|
||||
int index = -1;
|
||||
if (mType == 0 || mType == 4) {
|
||||
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||
selectString.add(customSidebarChildModels.get(i).getTitle());
|
||||
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
if (interactionID == 0) {
|
||||
topSelect.setSelected(true);
|
||||
}
|
||||
if (mType == 4) {
|
||||
topSelect.setVisibility(GONE);
|
||||
}
|
||||
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
if (mType == 0) {
|
||||
Bus.get().post(new SudGameListEvent()
|
||||
.setInteractionID(Long.parseLong(customSidebarChildModels.get(index).getSrc()))
|
||||
.setId(customSidebarChildModels.get(index).getId())
|
||||
.setTitle(customSidebarChildModels.get(index).getTitle()));
|
||||
} else {
|
||||
Bus.get().post(new CreateSudGameEvent()
|
||||
.setInteractionID(Long.parseLong(customSidebarChildModels.get(index).getSrc()))
|
||||
.setId(customSidebarChildModels.get(index).getId())
|
||||
.setTitle(customSidebarChildModels.get(index).getTitle()));
|
||||
}
|
||||
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (mType == 1) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_0_1));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_1_2));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_5));
|
||||
selectString.add(getContext().getString(R.string.room_sill0_100));
|
||||
selectString.add(getContext().getString(R.string.room_sill100_500));
|
||||
selectString.add(getContext().getString(R.string.room_sill500_m));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0,0,0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_0_1), "0,1,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_1_2), "1,5,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_5), "5,0,3");
|
||||
selectSill.put(getContext().getString(R.string.room_sill0_100), "0,1,2");
|
||||
selectSill.put(getContext().getString(R.string.room_sill100_500), "1,5,2");
|
||||
selectSill.put(getContext().getString(R.string.room_sill500_m), "5,0,2");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String sillName = selectString.get(index);
|
||||
String sill = selectSill.get(sillName);
|
||||
Bus.get().post(new SudGameListSillEvent().setSill(sill).setSillName(sillName));
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (mType == 2) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.live_anchor));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_player));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.live_anchor), "1");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_player), "2");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new RoomHolderTypeEvent().setRoomHolderType(roomHolderType).setRoomHolderTypeName(roomHolderTypeName));
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (mType == 5) {
|
||||
selectString.add(getContext().getString(R.string.golden_bean));
|
||||
if (isYuanbao) {
|
||||
selectString.add(getContext().getString(R.string.coins));
|
||||
}
|
||||
selectSill.put(getContext().getString(R.string.golden_bean), "3");
|
||||
if (isYuanbao) {
|
||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||
}
|
||||
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new CurrencyTypeEvent().setCurrencyType(roomHolderType).setCurrencyTypeName(roomHolderTypeName));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 6) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.golden_bean));
|
||||
selectString.add(getContext().getString(R.string.coins));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.golden_bean), "3");
|
||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(3));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 7) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_7));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_30));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today), "1");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today_7), "2");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today_30), "3");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(2));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 8) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||
selectString.add(customSidebarChildModels.get(i).getTitle());
|
||||
selectSill.put(customSidebarChildModels.get(i).getTitle(), customSidebarChildModels.get(i).getId());
|
||||
}
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(1));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(topSelect, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new SudGameListEvent().setInteractionID(0L).setTitle(getContext().getString(R.string.interactive_game_room_all)).setId("0"));
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class SudGameRuleBottom extends BottomPopupView {
|
||||
public SudGameRuleBottom(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.sud_game_rule_bottom_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class SudGameRulePopup extends CenterPopupView {
|
||||
public SudGameRulePopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.sud_game_rule_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudHomeGameListAdapter;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.event.SudRoomListModelEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.FlowLayout;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
private static final String SP_HISTORY = "sud_game_search_history";
|
||||
private EditText editSearch;
|
||||
private RecyclerView listRoom;//listHistory, ;
|
||||
private View history;
|
||||
private FlowLayout searchHistory;
|
||||
// private SudGameSearchHistoryListAdapter historyListAdapter;
|
||||
private SudHomeGameListAdapter sudGameListAdapter;
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudGameSearchDialogPopup(@NonNull Context context, boolean isHome) {
|
||||
super(context);
|
||||
this.isHome = isHome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
Bus.getOff(this);
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.moveUpToKeyboard(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
if (isHome) {
|
||||
return R.layout.dialog_home_search_sud_game;
|
||||
} else {
|
||||
return R.layout.dialog_search_sud_game;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
editSearch = findViewById(R.id.edit_search);
|
||||
// listHistory = findViewById(R.id.list_history);
|
||||
listRoom = findViewById(R.id.list_room);
|
||||
history = findViewById(R.id.layout_history);
|
||||
findViewById(R.id.layout_history_empty).setVisibility(GONE);
|
||||
searchHistory = findViewById(R.id.search_history);
|
||||
searchHistory.removeAllViews();
|
||||
sudGameListAdapter = new SudHomeGameListAdapter(mContext, isHome);
|
||||
listRoom.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
listRoom.setAdapter(sudGameListAdapter);
|
||||
initHistoryData();
|
||||
switchList(true);
|
||||
|
||||
editSearch.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
String value = s.toString();
|
||||
if (!StringUtil.isEmpty(value)) {
|
||||
search(value);
|
||||
|
||||
} else {
|
||||
findViewById(R.id.layout_history_empty).setVisibility(GONE);
|
||||
switchList(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_back), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> historyList;
|
||||
|
||||
private void addHistoryData(String str) {
|
||||
LinearLayout.LayoutParams layoutParams =
|
||||
new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.setMargins(15, 10, 15, 7);
|
||||
TextView chip = new TextView(mContext);
|
||||
chip.setText(str);
|
||||
chip.setMaxEms(10);
|
||||
chip.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
chip.setSingleLine();
|
||||
if (isHome) {
|
||||
|
||||
chip.setBackgroundResource(R.drawable.bg_item_search_history);
|
||||
chip.setTextColor(Color.parseColor("#FF999999"));
|
||||
} else {
|
||||
|
||||
chip.setBackgroundResource(R.drawable.bg_item_home_search_history);
|
||||
chip.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}
|
||||
|
||||
chip.setLayoutParams(layoutParams);
|
||||
searchHistory.addView(chip, layoutParams);
|
||||
|
||||
chip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
editSearch.setText(str);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initHistoryData() {
|
||||
searchHistory.removeAllViews();
|
||||
String value = SpUtil.getStringValue(SP_HISTORY);
|
||||
historyList = new ArrayList<>();
|
||||
if (!StringUtil.isEmpty(value)) {
|
||||
historyList = JSONArray.parseArray(value, String.class);
|
||||
}
|
||||
|
||||
|
||||
for (String str : historyList) {
|
||||
addHistoryData(str);
|
||||
}
|
||||
}
|
||||
|
||||
private void search(String value) {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.searchRoomList("0", "0,0,0", "0", value, "0", 0, new HttpCallback<List<SudRoomListModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudRoomListModel> data) {
|
||||
if (data.size() > 0) {
|
||||
switchList(false);
|
||||
sudGameListAdapter.setList(data);
|
||||
|
||||
findViewById(R.id.layout_history_empty).setVisibility(GONE);
|
||||
boolean isValue = false;
|
||||
for (String str : historyList) {
|
||||
if (!isValue) {
|
||||
isValue = TextUtils.equals(value, str);
|
||||
}
|
||||
|
||||
}
|
||||
if (!isValue) {
|
||||
|
||||
if (historyList.size() < 6) {
|
||||
if (historyList.size() == 5) {
|
||||
historyList.remove(0);
|
||||
}
|
||||
historyList.add(value);
|
||||
SpUtil.setStringValue(SP_HISTORY, JSONArray.toJSONString(historyList));
|
||||
searchHistory.removeAllViews();
|
||||
|
||||
for (String str : historyList) {
|
||||
addHistoryData(str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
findViewById(R.id.layout_history_empty).setVisibility(VISIBLE);
|
||||
listRoom.setVisibility(GONE);
|
||||
history.setVisibility(GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
findViewById(R.id.layout_history_empty).setVisibility(VISIBLE);
|
||||
switchList(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void switchList(boolean isHistory) {
|
||||
if (isHistory) {
|
||||
history.setVisibility(VISIBLE);
|
||||
listRoom.setVisibility(GONE);
|
||||
} else {
|
||||
listRoom.setVisibility(VISIBLE);
|
||||
history.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListEvent(SudRoomListModelEvent event) {
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
createSudRoomModel.setSudGameId(event.getModel().getSudGameId());
|
||||
createSudRoomModel.setSudGameRoomId(event.getModel().getSudGameRoomId());
|
||||
createSudRoomModel.setAvatar(event.getModel().getAvatar());
|
||||
createSudRoomModel.setRoomName(event.getModel().getRoomName());
|
||||
createSudRoomModel.setSudGameName(event.getModel().getSudGameName());
|
||||
dialog.dismiss();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ public class AllServerNotifyEvent extends BaseModel {
|
||||
//礼物名称
|
||||
@SerializedName("giftname")
|
||||
private String giftName;
|
||||
|
||||
//盲盒名称
|
||||
@SerializedName("box_type_name")
|
||||
private String boxTypeName;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CheckCurrencyModel extends BaseModel {
|
||||
|
||||
@SerializedName("is_yuanbao")
|
||||
private String isYuanbao;
|
||||
|
||||
public String getIsYuanbao() {
|
||||
return isYuanbao;
|
||||
}
|
||||
|
||||
public CheckCurrencyModel setIsYuanbao(String isYuanbao) {
|
||||
this.isYuanbao = isYuanbao;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
public int seatIndex=0;
|
||||
private String SudMGPMGState;
|
||||
|
||||
public String getSudMGPMGState() {
|
||||
return SudMGPMGState;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setSudMGPMGState(String sudMGPMGState) {
|
||||
SudMGPMGState = sudMGPMGState;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getSeatIndex() {
|
||||
return seatIndex;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setSeatIndex(int seatIndex) {
|
||||
this.seatIndex = seatIndex;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CreateSudGameEvent extends BaseModel {
|
||||
private long interactionID = 0;
|
||||
private String title;
|
||||
private String id;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CreateSudGameEvent setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CreateSudGameEvent setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getInteractionID() {
|
||||
return interactionID;
|
||||
}
|
||||
|
||||
public CreateSudGameEvent setInteractionID(long interactionID) {
|
||||
this.interactionID = interactionID;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CurrencyTypeEvent extends BaseModel {
|
||||
private String currencyType;
|
||||
private String currencyTypeName;
|
||||
|
||||
public String getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public CurrencyTypeEvent setCurrencyType(String currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCurrencyTypeName() {
|
||||
return currencyTypeName;
|
||||
}
|
||||
|
||||
public CurrencyTypeEvent setCurrencyTypeName(String currencyTypeName) {
|
||||
this.currencyTypeName = currencyTypeName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CustomDrawerPopupEvent extends BaseModel {
|
||||
//是否关闭弹窗
|
||||
@@ -28,6 +32,37 @@ public class CustomDrawerPopupEvent extends BaseModel {
|
||||
//畫質選擇
|
||||
private boolean qualitySelection = false;
|
||||
private boolean fontSize = false;
|
||||
private boolean interaction = false;
|
||||
private long interactionID;
|
||||
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public List<CustomSidebarChildModel> getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setChild(List<CustomSidebarChildModel> child) {
|
||||
this.child = child;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isInteraction() {
|
||||
return interaction;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setInteraction(boolean interaction) {
|
||||
this.interaction = interaction;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getInteractionID() {
|
||||
return interactionID;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setInteractionID(long interactionID) {
|
||||
this.interactionID = interactionID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSmallWindow() {
|
||||
return smallWindow;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class HideShowEvent extends BaseModel {
|
||||
private boolean isClose = false;
|
||||
private boolean hide = false;
|
||||
|
||||
public boolean isHide() {
|
||||
return hide;
|
||||
}
|
||||
|
||||
public HideShowEvent setHide(boolean hide) {
|
||||
this.hide = hide;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isClose() {
|
||||
return isClose;
|
||||
}
|
||||
|
||||
public HideShowEvent setClose(boolean close) {
|
||||
isClose = close;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
public class LiveNewRoleEvent {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
|
||||
public class LiveOpenSudRoomEvent extends BaseModel {
|
||||
private CreateSudRoomModel createSudRoomModel = null;
|
||||
|
||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||
return createSudRoomModel;
|
||||
}
|
||||
|
||||
public LiveOpenSudRoomEvent setCreateSudRoomModel(CreateSudRoomModel createSudRoomModel) {
|
||||
this.createSudRoomModel = createSudRoomModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LiveSudGameHistoryEvent extends BaseModel {
|
||||
private String type;
|
||||
private String typeName;
|
||||
private int index;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
|
||||
public class LiveSudGamePopupShowOrHideEvent {
|
||||
private int type = 0;//0展示,1hide隱藏,2dismiss關閉
|
||||
private CreateSudRoomModel createSudRoomModel;
|
||||
|
||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||
return createSudRoomModel;
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setCreateSudRoomModel(CreateSudRoomModel createSudRoomModel) {
|
||||
this.createSudRoomModel = createSudRoomModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setType(int type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NewRoleCustomDrawerPopupEvent extends BaseModel {
|
||||
//是否关闭弹窗
|
||||
private boolean isDisMiss = false;
|
||||
//权益的名字
|
||||
private String rightsInterests = "";
|
||||
//活动的id
|
||||
private int activityId = 0;
|
||||
//跳转网页地址
|
||||
private String htmlUrl;
|
||||
//是否半屏展示
|
||||
private boolean screen = false;
|
||||
//系统消息
|
||||
private boolean systemNotice = false;
|
||||
//在线客服
|
||||
private boolean online = false;
|
||||
//举报
|
||||
private boolean reportLayout = false;
|
||||
//刷新
|
||||
private boolean refresh = false;
|
||||
//特效設置
|
||||
private boolean effects = false;
|
||||
//小窗播放
|
||||
private boolean smallWindow = false;
|
||||
//畫質選擇
|
||||
private boolean qualitySelection = false;
|
||||
private boolean fontSize = false;
|
||||
private boolean interaction = false;
|
||||
private long interactionID;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public List<CustomSidebarChildModel> getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setChild(List<CustomSidebarChildModel> child) {
|
||||
this.child = child;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isInteraction() {
|
||||
return interaction;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setInteraction(boolean interaction) {
|
||||
this.interaction = interaction;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getInteractionID() {
|
||||
return interactionID;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setInteractionID(long interactionID) {
|
||||
this.interactionID = interactionID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSmallWindow() {
|
||||
return smallWindow;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setSmallWindow(boolean smallWindow) {
|
||||
this.smallWindow = smallWindow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isQualitySelection() {
|
||||
return qualitySelection;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setQualitySelection(boolean qualitySelection) {
|
||||
this.qualitySelection = qualitySelection;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isRefresh() {
|
||||
return refresh;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setRefresh(boolean refresh) {
|
||||
this.refresh = refresh;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSystemNotice() {
|
||||
return systemNotice;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setSystemNotice(boolean systemNotice) {
|
||||
this.systemNotice = systemNotice;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
return online;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setOnline(boolean online) {
|
||||
this.online = online;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isReportLayout() {
|
||||
return reportLayout;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setReportLayout(boolean reportLayout) {
|
||||
this.reportLayout = reportLayout;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHtmlUrl() {
|
||||
return htmlUrl;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setHtmlUrl(String htmlUrl) {
|
||||
this.htmlUrl = htmlUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isScreen() {
|
||||
return screen;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setScreen(boolean screen) {
|
||||
this.screen = screen;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setActivityId(int activityId) {
|
||||
this.activityId = activityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRightsInterests() {
|
||||
return rightsInterests;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setRightsInterests(String rightsInterests) {
|
||||
this.rightsInterests = rightsInterests;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDisMiss() {
|
||||
return isDisMiss;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setDisMiss(boolean disMiss) {
|
||||
isDisMiss = disMiss;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEffects() {
|
||||
return effects;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setEffects(boolean effects) {
|
||||
this.effects = effects;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFontSize() {
|
||||
return fontSize;
|
||||
}
|
||||
|
||||
public NewRoleCustomDrawerPopupEvent setFontSize(boolean fontSize) {
|
||||
this.fontSize = fontSize;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class RoomHolderTypeEvent extends BaseModel {
|
||||
private String roomHolderType;
|
||||
private String roomHolderTypeName;
|
||||
|
||||
public String getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public RoomHolderTypeEvent setRoomHolderType(String roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderTypeName() {
|
||||
return roomHolderTypeName;
|
||||
}
|
||||
|
||||
public RoomHolderTypeEvent setRoomHolderTypeName(String roomHolderTypeName) {
|
||||
this.roomHolderTypeName = roomHolderTypeName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
@@ -21,6 +23,8 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
private String totalcoin;
|
||||
@SerializedName("giftname")
|
||||
private String giftname;
|
||||
@SerializedName("giftname_en")
|
||||
private String giftname_en;
|
||||
@SerializedName("giftnameen")
|
||||
private String giftnameen;
|
||||
@SerializedName("gifticon")
|
||||
@@ -69,6 +73,8 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
private String needcoin;
|
||||
@SerializedName("gift_msg")
|
||||
private String giftMsg;
|
||||
@SerializedName("gift_msg_en")
|
||||
private String giftMsgen;
|
||||
@SerializedName("gift_colour")
|
||||
private String giftColour;
|
||||
@SerializedName("box_type")
|
||||
@@ -85,6 +91,8 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
private Object dressId;
|
||||
@SerializedName("dress_name")
|
||||
private String dressName;
|
||||
@SerializedName("dress_nameen")
|
||||
private String dress_nameen;
|
||||
@SerializedName("display_src")
|
||||
private Object displaySrc;
|
||||
@SerializedName("effect_src")
|
||||
@@ -95,6 +103,8 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
private Object nobleDress;
|
||||
@SerializedName("dress_msg")
|
||||
private String dressMsg;
|
||||
@SerializedName("dress_msg_en")
|
||||
private String dressMsgEN;
|
||||
@SerializedName("dress_colour")
|
||||
private String dressColour;
|
||||
@SerializedName("dress_threshold_value")
|
||||
@@ -119,11 +129,29 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftMsgen() {
|
||||
return giftMsgen;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftMsgen(String giftMsgen) {
|
||||
this.giftMsgen = giftMsgen;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDress_nameen() {
|
||||
return dress_nameen;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDress_nameen(String dress_nameen) {
|
||||
this.dress_nameen = dress_nameen;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
@@ -530,6 +558,15 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressMsgEN() {
|
||||
return dressMsgEN;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressMsgEN(String dressMsgEN) {
|
||||
this.dressMsgEN = dressMsgEN;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressColour() {
|
||||
return dressColour;
|
||||
}
|
||||
@@ -556,4 +593,13 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
this.liveGiftNotify = liveGiftNotify;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftname_en() {
|
||||
return TextUtils.isEmpty(giftname_en)?giftnameen:giftname_en;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftname_en(String giftname_en) {
|
||||
this.giftname_en = giftname_en;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class ShowHideEvent extends BaseModel {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SudGameListDissMissEvent extends BaseModel {
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SudGameListEvent extends BaseModel {
|
||||
private long interactionID = 0;
|
||||
private String title;
|
||||
private String id;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public SudGameListEvent setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public SudGameListEvent setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getInteractionID() {
|
||||
return interactionID;
|
||||
}
|
||||
|
||||
public SudGameListEvent setInteractionID(long interactionID) {
|
||||
this.interactionID = interactionID;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SudGameListRefreshEvent extends BaseModel {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SudGameListSillEvent extends BaseModel {
|
||||
private String sillName;
|
||||
private String sill;
|
||||
|
||||
public String getSillName() {
|
||||
return sillName;
|
||||
}
|
||||
|
||||
public SudGameListSillEvent setSillName(String sillName) {
|
||||
this.sillName = sillName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSill() {
|
||||
return sill;
|
||||
}
|
||||
|
||||
public SudGameListSillEvent setSill(String sill) {
|
||||
this.sill = sill;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
|
||||
public class SudRoomListModelEvent extends BaseModel {
|
||||
private SudRoomListModel model;
|
||||
|
||||
public SudRoomListModel getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public SudRoomListModelEvent setModel(SudRoomListModel model) {
|
||||
this.model = model;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.HintCustomPopup;
|
||||
import com.yunbao.common.views.LiveNewWishGiftPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -82,7 +83,7 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
ToastUtil.show(getActivity().getString(R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -149,12 +150,12 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show("修改成功");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
} else if (wishList2.size() == 1) {
|
||||
@@ -174,38 +175,38 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
public void onCancel() {
|
||||
|
||||
if (wishList2.size() > 10) {
|
||||
ToastUtil.show(R.string.must_hint);
|
||||
ToastUtil.show(getActivity().getString(R.string.must_hint));
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(getContext()).
|
||||
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show("修改成功");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
if (wishList2.size() > 10) {
|
||||
ToastUtil.show(R.string.must_hint);
|
||||
ToastUtil.show(getContext().getString(R.string.must_hint));
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(getContext()).
|
||||
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show("修改成功");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -46,6 +46,13 @@ public class LoadingDialog extends AbsDialogFragment {
|
||||
hint.setText(showText);
|
||||
}
|
||||
|
||||
public void setHintText(String text) {
|
||||
if (hint != null) {
|
||||
hint.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -56,7 +63,7 @@ public class LoadingDialog extends AbsDialogFragment {
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = DeviceUtils.getScreenWidth(getActivity())/2;
|
||||
params.width = DeviceUtils.getScreenWidth(getActivity()) / 2;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.CENTER;
|
||||
window.setAttributes(params);
|
||||
|
||||
@@ -81,20 +81,20 @@ public class ProcessFragment extends Fragment {
|
||||
switch (permission) {
|
||||
case Manifest.permission.READ_EXTERNAL_STORAGE:
|
||||
case Manifest.permission.WRITE_EXTERNAL_STORAGE:
|
||||
ToastUtil.show(R.string.permission_storage_refused);
|
||||
ToastUtil.show(getActivity().getString(R.string.permission_storage_refused));
|
||||
break;
|
||||
case Manifest.permission.CAMERA:
|
||||
ToastUtil.show(R.string.permission_camera_refused);
|
||||
ToastUtil.show(getActivity().getString(R.string.permission_camera_refused));
|
||||
break;
|
||||
case Manifest.permission.RECORD_AUDIO:
|
||||
ToastUtil.show(R.string.permission_record_audio_refused);
|
||||
ToastUtil.show(getActivity().getString(R.string.permission_record_audio_refused));
|
||||
break;
|
||||
case Manifest.permission.ACCESS_COARSE_LOCATION:
|
||||
ToastUtil.show(R.string.permission_location_refused);
|
||||
ToastUtil.show(getActivity().getString(R.string.permission_location_refused));
|
||||
CommonAppConfig.getInstance().clearLocationInfo();
|
||||
break;
|
||||
case Manifest.permission.READ_PHONE_STATE:
|
||||
ToastUtil.show(R.string.permission_read_phone_state_refused);
|
||||
ToastUtil.show(getActivity().getString(R.string.permission_read_phone_state_refused));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okgo.request.PostRequest;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.ErrorActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
@@ -162,7 +163,7 @@ public class CommonHttpUtil {
|
||||
} else {
|
||||
locale = IMLoginManager.get(context).getLocaleLanguage();
|
||||
}
|
||||
if (locale.getLanguage().equals("zh")) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
lang = "chinese";
|
||||
|
||||
} else {
|
||||
@@ -172,104 +173,97 @@ public class CommonHttpUtil {
|
||||
}
|
||||
Log.i("来了", lang);
|
||||
//或者仅仅使用 locale = Locale.getDefault(); 不需要考虑接口 deprecated(弃用)问题
|
||||
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG)
|
||||
.params("langue", lang)
|
||||
.params("version", "" + VersionUtil.getVersion())
|
||||
.params("from", "android")
|
||||
.params("appType", "1")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
try {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class);
|
||||
CommonAppConfig.getInstance().setConfig(bean);
|
||||
CommonAppConfig.getInstance().setLevel(obj.getString("level"));
|
||||
CommonAppConfig.getInstance().setAnchorLevel(obj.getString("levelanchor"));
|
||||
CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time");
|
||||
CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time");
|
||||
//解析粉丝徽章
|
||||
CommonAppConfig.getInstance().setAnchorFansMedal(obj.getString("levelfans"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.CONFIG, info[0]);
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(bean);
|
||||
}
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("levelfans")) {
|
||||
JSONArray levelArray = obj.getJSONArray("levelfans");
|
||||
new NewLevelManager(context).upDataFansLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("liveclass")) {//缓存直播间分类
|
||||
JSONArray levelArray = obj.getJSONArray("liveclass");
|
||||
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("apk_ver")) {
|
||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||
}
|
||||
if (obj.containsKey("apk_url")) {
|
||||
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||
}
|
||||
if (obj.containsKey("apk_des")) {
|
||||
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||
}
|
||||
if (obj.containsKey("google_isup")) {
|
||||
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||
}
|
||||
if (obj.containsKey("isup")) {
|
||||
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||
}
|
||||
if (obj.containsKey("clarity")) {
|
||||
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||
}
|
||||
if (obj.containsKey("defaultBubbleUrl")) {
|
||||
IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl"));
|
||||
}
|
||||
if (obj.containsKey("gift_quantity")) {
|
||||
JSONArray giftQuantity = obj.getJSONArray("gift_quantity");
|
||||
new GiftQuantityManager(context).UpGiftQuantity(giftQuantity.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
}
|
||||
} else if (code == 1000) {
|
||||
new DialogUitl
|
||||
.Builder(context)
|
||||
.setContent(msg)
|
||||
.setCancelable(false)
|
||||
.setClickCallback3(new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
}).build().show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG).params("langue", lang).params("version", "" + VersionUtil.getVersion()).params("from", "android").params("appType", "1").execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
try {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class);
|
||||
CommonAppConfig.getInstance().setConfig(bean);
|
||||
CommonAppConfig.getInstance().setLevel(obj.getString("level"));
|
||||
CommonAppConfig.getInstance().setAnchorLevel(obj.getString("levelanchor"));
|
||||
CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time");
|
||||
CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time");
|
||||
//解析粉丝徽章
|
||||
CommonAppConfig.getInstance().setAnchorFansMedal(obj.getString("levelfans"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.CONFIG, info[0]);
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(null);
|
||||
commonCallback.callback(bean);
|
||||
}
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("levelfans")) {
|
||||
JSONArray levelArray = obj.getJSONArray("levelfans");
|
||||
new NewLevelManager(context).upDataFansLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("liveclass")) {//缓存直播间分类
|
||||
JSONArray levelArray = obj.getJSONArray("liveclass");
|
||||
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("apk_ver")) {
|
||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||
}
|
||||
if (obj.containsKey("apk_url")) {
|
||||
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||
}
|
||||
if (obj.containsKey("apk_des")) {
|
||||
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||
}
|
||||
if (obj.containsKey("google_isup")) {
|
||||
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||
}
|
||||
if (obj.containsKey("isup")) {
|
||||
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||
}
|
||||
if (obj.containsKey("clarity")) {
|
||||
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||
}
|
||||
if (obj.containsKey("defaultBubbleUrl")) {
|
||||
IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl"));
|
||||
}
|
||||
if (obj.containsKey("gift_quantity")) {
|
||||
JSONArray giftQuantity = obj.getJSONArray("gift_quantity");
|
||||
new GiftQuantityManager(context).UpGiftQuantity(giftQuantity.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
}
|
||||
});
|
||||
} else if (code == 1000) {
|
||||
new DialogUitl.Builder(context).setContent(msg).setCancelable(false).setClickCallback3(new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
ToastUtil.show(context.getString(R.string.net_error) + "code:" + code + " msg:" + msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -277,20 +271,18 @@ public class CommonHttpUtil {
|
||||
* QQ登录的时候 获取unionID 与PC端互通的时候用
|
||||
*/
|
||||
public static void getQQLoginUnionID(String accessToken, final CommonCallback<String> commonCallback) {
|
||||
OkGo.<String>get("https://graph.qq.com/oauth2.0/me?access_token=" + accessToken + "&unionid=1")
|
||||
.tag(CommonHttpConsts.GET_QQ_LOGIN_UNION_ID)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
if (commonCallback != null) {
|
||||
String data = response.body();
|
||||
data = data.substring(data.indexOf("{"), data.lastIndexOf("}") + 1);
|
||||
L.e("getQQLoginUnionID------>" + data);
|
||||
JSONObject obj = JSON.parseObject(data);
|
||||
commonCallback.callback(obj.getString("unionid"));
|
||||
}
|
||||
}
|
||||
});
|
||||
OkGo.<String>get("https://graph.qq.com/oauth2.0/me?access_token=" + accessToken + "&unionid=1").tag(CommonHttpConsts.GET_QQ_LOGIN_UNION_ID).execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
if (commonCallback != null) {
|
||||
String data = response.body();
|
||||
data = data.substring(data.indexOf("{"), data.lastIndexOf("}") + 1);
|
||||
L.e("getQQLoginUnionID------>" + data);
|
||||
JSONObject obj = JSON.parseObject(data);
|
||||
commonCallback.callback(obj.getString("unionid"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -309,13 +301,11 @@ public class CommonHttpUtil {
|
||||
ToastUtil.show(WordUtil.getString(R.string.cannot_follow_self));
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("User.setAttents", tag)
|
||||
.params("touid", touid)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0 || code == 1001) {
|
||||
int isAttention = JSON.parseObject(info[0]).getIntValue("isattent");//1是 关注 0是未关注
|
||||
HttpClient.getInstance().get("User.setAttents", tag).params("touid", touid).execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0 || code == 1001) {
|
||||
int isAttention = JSON.parseObject(info[0]).getIntValue("isattent");//1是 关注 0是未关注
|
||||
/* if (code == 1001) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
ToastUtil.show("粉絲團等級已清零,待領取獎勵已自動領取至【個性裝扮】");
|
||||
@@ -323,13 +313,13 @@ public class CommonHttpUtil {
|
||||
ToastUtil.show("The level of the fan club has been cleared, and the rewards to be claimed have been automatically received to [Personalized Dressing]");
|
||||
}
|
||||
}*/
|
||||
EventBus.getDefault().post(new FollowEvent(touid, isAttention));
|
||||
if (callback != null) {
|
||||
callback.callback(isAttention);
|
||||
}
|
||||
}
|
||||
EventBus.getDefault().post(new FollowEvent(touid, isAttention));
|
||||
if (callback != null) {
|
||||
callback.callback(isAttention);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,15 +327,14 @@ public class CommonHttpUtil {
|
||||
*/
|
||||
public static void getBalance(HttpCallback callback) {
|
||||
String isGoogle;
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
isGoogle = "1";
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
isGoogle = "2";
|
||||
} else {
|
||||
isGoogle = "-1";
|
||||
}
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE)
|
||||
.params("type", 0)
|
||||
.params("isGooglePay", isGoogle)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE).params("type", 0).params("isGooglePay", isGoogle).execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -354,8 +343,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getAliOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_ALI_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_ALI_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,8 +352,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getWxOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -376,8 +363,7 @@ public class CommonHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getCashierOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_CASHIER_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_CASHIER_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -389,8 +375,7 @@ public class CommonHttpUtil {
|
||||
|
||||
|
||||
public static void getWxH5Order(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_H5ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_H5ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -398,8 +383,7 @@ public class CommonHttpUtil {
|
||||
* 检查token是否失效
|
||||
*/
|
||||
public static void checkTokenInvalid() {
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID)
|
||||
.execute(NO_CALLBACK);
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID).execute(NO_CALLBACK);
|
||||
}
|
||||
|
||||
|
||||
@@ -407,32 +391,15 @@ public class CommonHttpUtil {
|
||||
* 谷歌支付成功后,通知自己服务器
|
||||
*/
|
||||
public static void notifyMeGoogle(String purchaseToken, String productId, String orderno, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("productId", productId)
|
||||
.params("orderno", orderno)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("productId", productId).params("orderno", orderno).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
public static void notifyGoogle(String purchaseToken, String orderNo, String tradeNo, String allData, String gps_adid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("allData", allData)
|
||||
.params("gps_adid", gps_adid)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("orderno", orderNo).params("trade_no", tradeNo).params("allData", allData).params("gps_adid", gps_adid).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
public static void Google_sec_pay(String purchaseToken, String orderNo, String tradeNo, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Charge.Google_sec_pay", "Charge.Google_sec_pay")
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("Charge.Google_sec_pay", "Charge.Google_sec_pay").params("purchaseToken", purchaseToken).params("orderno", orderNo).params("trade_no", tradeNo).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
//不做任何操作的HttpCallback
|
||||
@@ -449,20 +416,9 @@ public class CommonHttpUtil {
|
||||
public static void setCommunityReport(String community_type, String comment_id, String dynamic_id, String content, File file1, File file2, File file3, String report_type, HttpCallback callback) {
|
||||
PostRequest<JsonBean> request;
|
||||
if ("2".equals(community_type)) {
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
|
||||
.isMultipart(true)
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("report_type", report_type)
|
||||
.params("content", content)
|
||||
.params("community_type", community_type)
|
||||
.params("comment_id", comment_id);
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT).isMultipart(true).params("dynamic_id", dynamic_id).params("report_type", report_type).params("content", content).params("community_type", community_type).params("comment_id", comment_id);
|
||||
} else {
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
|
||||
.isMultipart(true)
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("report_type", report_type)
|
||||
.params("content", content)
|
||||
.params("community_type", community_type);
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT).isMultipart(true).params("dynamic_id", dynamic_id).params("report_type", report_type).params("content", content).params("community_type", community_type);
|
||||
}
|
||||
if (file1 != null) {
|
||||
request.params("file1", file1);
|
||||
@@ -480,9 +436,7 @@ public class CommonHttpUtil {
|
||||
* 用户个人主页信息
|
||||
*/
|
||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||
}
|
||||
//
|
||||
// //埋点唯一性
|
||||
|
||||
@@ -8,10 +8,10 @@ import com.google.gson.Gson;
|
||||
import com.lzy.okgo.callback.AbsCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okgo.request.base.Request;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketException;
|
||||
@@ -36,7 +36,7 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
|
||||
public void onSuccess(Response<JsonBean> response) {
|
||||
JsonBean bean = response.body();
|
||||
String gson = new Gson().toJson(bean);
|
||||
Log.e("onSuccess",gson);
|
||||
Log.e("onSuccess", gson);
|
||||
if (bean != null) {
|
||||
if (200 == bean.getRet()) {
|
||||
Data data = bean.getData();
|
||||
@@ -65,7 +65,7 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
|
||||
t.printStackTrace();
|
||||
L.e("网络请求错误---->" + t.getClass() + " : " + t.getMessage());
|
||||
if (t instanceof SocketTimeoutException || t instanceof ConnectException || t instanceof UnknownHostException || t instanceof UnknownServiceException || t instanceof SocketException) {
|
||||
ToastUtil.show(R.string.load_failure);
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "網絡請求失敗" : "Network request failed");
|
||||
}
|
||||
// if (showLoadingDialog() && mLoadingDialog != null) {
|
||||
// mLoadingDialog.dismiss();
|
||||
|
||||
@@ -6,10 +6,6 @@ import com.lzy.okgo.request.GetRequest;
|
||||
import com.lzy.okgo.request.PostRequest;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.JsonBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
@@ -292,6 +288,7 @@ public class LiveHttpUtil {
|
||||
|
||||
/**
|
||||
* 主播或管理员禁言
|
||||
*
|
||||
* @param time 禁言时间 (分)
|
||||
*/
|
||||
public static void setShutUp(String liveUid, String stream, int type, String touid, String time, HttpCallback callback) {
|
||||
@@ -619,17 +616,19 @@ public class LiveHttpUtil {
|
||||
* 观众给主播送礼物
|
||||
*/
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) {
|
||||
sendGift(by, liveUid, stream, giftId, giftCount, 0, false,callback);
|
||||
sendGift(by, liveUid, stream, giftId, giftCount, 0, false, callback);
|
||||
}
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, HttpCallback callback) {
|
||||
sendGift(by, liveUid, stream, giftId, giftCount, isContactGift, false,callback);
|
||||
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, HttpCallback callback) {
|
||||
sendGift(by, liveUid, stream, giftId, giftCount, isContactGift, false, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众给主播送礼物
|
||||
*
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift,HttpCallback callback) {
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
@@ -637,7 +636,20 @@ public class LiveHttpUtil {
|
||||
.params("isContactGift", isContactGift)
|
||||
.params("giftcount", giftCount)
|
||||
.params("isprank", by)
|
||||
.params("fans_exclusive_pack",isFansGroupGift?"1":"0")
|
||||
.params("fans_exclusive_pack", isFansGroupGift ? "1" : "0")
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
.params("isContactGift", 0)
|
||||
.params("giftcount", "1")
|
||||
.params("isprank", by)
|
||||
.params("fans_exclusive_pack", "0")
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -955,6 +967,37 @@ public class LiveHttpUtil {
|
||||
HttpClient.getInstance().get("Home.getFollow", "Home.getFollow")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
|
||||
}
|
||||
|
||||
public static void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Sudgameserver.getRoomList", "Sudgameserver.getRoomList")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("threshold", threshold)
|
||||
.params("room_holder_type", roomHolderType)
|
||||
.params("liveuid", liveUid)
|
||||
.params("currency_type ", currencyType)
|
||||
.params("page", page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戲記錄
|
||||
*
|
||||
* @param sudGameId sud_game_id 游戏ID
|
||||
* @param currencyType currency_type 游戏货币类型 3=>金豆 2=>星币 0=>星币
|
||||
* @param dateType date_type 时间 0=>不限 1=>今日 2=>7日内 3=>30日内
|
||||
* @param page
|
||||
* @param callback
|
||||
*/
|
||||
public static void gameRecord(String sudGameId, String currencyType, String dateType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Sudgameserver.gameRecord", "Sudgameserver.gameRecord")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("currency_type", currencyType)
|
||||
.params("date_type", dateType)
|
||||
.params("page", page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
@@ -40,6 +42,7 @@ import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
@@ -53,11 +56,14 @@ import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -158,18 +164,23 @@ public interface PDLiveApi {
|
||||
* @param num 请求数量
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Home.anchorRecommend ")
|
||||
@GET("/api/public/?service=Home.anchorRecommend")
|
||||
Observable<ResponseModel<AnchorRecommendModel>> anchorRecommend(
|
||||
@Query("num") String num
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Home.anchorRecommend")
|
||||
Observable<ResponseModel<AnchorRecommendModel>> anchorRecommend(
|
||||
@QueryMap Map<String, Object> map
|
||||
);
|
||||
|
||||
/**
|
||||
* 直播间上下滚动列表
|
||||
*
|
||||
* @param num 请求数量
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Home.anchorRecommend ")
|
||||
@GET("/api/public/?service=Home.anchorRecommend")
|
||||
Observable<ResponseModel<AnchorRecommendModel>> anchorRecommend(
|
||||
@Query("num") String num, @Query("type") String type
|
||||
);
|
||||
@@ -182,7 +193,7 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveInfo")
|
||||
Observable<ResponseModel<List<LiveInfoModel>>> getLiveInfo(
|
||||
@Query("liveuid") String liveuid
|
||||
@Query("liveuid") String liveui
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -296,7 +307,7 @@ public interface PDLiveApi {
|
||||
* 新侧边栏请求
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getCustomSidebarInfo")
|
||||
Observable<ResponseModel<List<CustomSidebarInfoModel>>> getCustomSidebarInfo();
|
||||
Observable<ResponseModel<List<CustomSidebarInfoModel>>> getCustomSidebarInfo(@Query("type") String type);
|
||||
|
||||
/**
|
||||
* 任务领取接口
|
||||
@@ -766,18 +777,19 @@ public interface PDLiveApi {
|
||||
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物当前数据
|
||||
* 创建红包
|
||||
*/
|
||||
@GET("/api/public/?service=Live.createRedPacket")
|
||||
Observable<ResponseModel<Object>> createRedPacket(
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("is_fans") int needFansGroup,
|
||||
@Query("red_packet_money") String redPacketMoney,
|
||||
@Query("red_packet_quantity") String redPacketQuantity,
|
||||
@Query("conditions") String conditions
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物当前数据
|
||||
* 获取红包数据
|
||||
*/
|
||||
@GET("/api/public/?service=Live.redPacketInfo")
|
||||
Observable<ResponseModel<RedPacketInfoModel>> redPacketInfo(
|
||||
@@ -968,5 +980,90 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=gift.getGiftNamingInfo")
|
||||
Observable<ResponseModel<GiftNamingInfoModel>> getGiftNamingInfo(@Query("gift_id") String giftId);
|
||||
|
||||
/**
|
||||
* 获取游戏code
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgame.getCode")
|
||||
Observable<ResponseModel<List<SudgameCodeModel>>> getCode();
|
||||
|
||||
/**
|
||||
* 创建游戏房
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgameserver.createSudRoom")
|
||||
Observable<ResponseModel<CreateSudRoomModel>> createSudRoom(
|
||||
@Query("room_name") String roomName,
|
||||
@Query("golden_bean_number") String goldenBeanNumber,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("game_id") String gameId);
|
||||
|
||||
/**
|
||||
* 获取游戏房列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgameserver.getRoomList")
|
||||
Observable<ResponseModel<List<SudRoomListModel>>> getRoomList(
|
||||
@Query("sud_game_id") String sudGameId,
|
||||
@Query("threshold") String threshold,
|
||||
@Query("room_holder_type") String roomHolderType,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("page") int page
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取游戏房列表 - 搜索
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgameserver.getRoomList")
|
||||
Observable<ResponseModel<List<SudRoomListModel>>> searchRoomList(
|
||||
@Query("sud_game_id") String sudGameId,
|
||||
@Query("threshold") String threshold,
|
||||
@Query("room_holder_type") String roomHolderType,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("search") String search,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("page") int page
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.checkRemainingBalance")
|
||||
Observable<ResponseModel<CheckRemainingBalance>> checkRemainingBalance(
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.randomRoom")
|
||||
Observable<ResponseModel<CreateSudRoomModel>> randomRoom(
|
||||
@Query("sud_game_id") String sudGameId,
|
||||
@Query("threshold") String threshold,
|
||||
@Query("room_holder_type") String roomHolderType
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.checkRoomStatus")
|
||||
Observable<ResponseModel<CreateSudRoomModel>> checkRoomStatus(
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
/**
|
||||
* 活动弹窗
|
||||
*/
|
||||
@GET("/api/public/?service=Home.activityPopup")
|
||||
Observable<ResponseModel<List<OpenAdModel>>> activityPopup();
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.gameStartCheckRemainingBalance")
|
||||
Observable<ResponseModel<CheckRemainingBalance>> gameStartCheckRemainingBalance(
|
||||
@Query("mg_id") String mgId,
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.deductMoney")
|
||||
Observable<ResponseModel<Object>> deductMoney(
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
@GET("/api/public/?service=Sudgameserver.checkCurrency")
|
||||
Observable<ResponseModel<CheckCurrencyModel>> checkCurrency(
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
@@ -29,7 +31,6 @@ import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
@@ -39,6 +40,7 @@ import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
@@ -50,15 +52,19 @@ import com.yunbao.common.bean.RedPacketInfoModel;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -314,9 +320,9 @@ public class LiveNetManager {
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getCustomSidebarInfo(HttpCallback<List<CustomSidebarInfoModel>> callback) {
|
||||
public void getCustomSidebarInfo(String type, HttpCallback<List<CustomSidebarInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCustomSidebarInfo()
|
||||
.getCustomSidebarInfo(type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> callback.onSuccess(listResponseModel.getData().getInfo()), throwable -> {
|
||||
@@ -1631,10 +1637,11 @@ public class LiveNetManager {
|
||||
* @param redPacketMoney 红包金额
|
||||
* @param redPacketQuantity 红包数量
|
||||
* @param conditions 红包领取条件 0.无 1.关注主播
|
||||
* @param needFansGroup 是否需要加入粉丝团条件
|
||||
*/
|
||||
public void createRedPacket(String liveUid, String redPacketMoney, String redPacketQuantity, String conditions, HttpCallback<String> callback) {
|
||||
public void createRedPacket(String liveUid, String redPacketMoney, String redPacketQuantity, String conditions, boolean needFansGroup, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createRedPacket(liveUid, redPacketMoney, redPacketQuantity, conditions)
|
||||
.createRedPacket(liveUid, needFansGroup ? 1 : 0, redPacketMoney, redPacketQuantity, conditions)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@@ -1931,7 +1938,7 @@ public class LiveNetManager {
|
||||
|
||||
public void giftDetail(String liveUid, String giftId, String toUid, HttpCallback<GiftWallGiftDetail> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.giftDetail(liveUid, giftId,toUid)
|
||||
.giftDetail(liveUid, giftId, toUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<GiftWallGiftDetail>>() {
|
||||
@@ -2171,7 +2178,7 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getGiftNamingInfo(String giftId,HttpCallback<GiftNamingInfoModel> callback) {
|
||||
public void getGiftNamingInfo(String giftId, HttpCallback<GiftNamingInfoModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getGiftNamingInfo(giftId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -2179,7 +2186,7 @@ public class LiveNetManager {
|
||||
.subscribe(new Consumer<ResponseModel<GiftNamingInfoModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<GiftNamingInfoModel> liveGiftBeanResponseModel) throws Exception {
|
||||
if (callback!=null){
|
||||
if (callback != null) {
|
||||
callback.onSuccess(liveGiftBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
@@ -2193,6 +2200,258 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void activityPopup(HttpCallback<List<OpenAdModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.activityPopup()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<OpenAdModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<OpenAdModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getCode(HttpCallback<List<SudgameCodeModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCode()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<SudgameCodeModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<SudgameCodeModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (createSudRoomModelResponseModel.getData().getCode() == 0) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void randomRoom(String sudGameId, String threshold, String roomHolderType, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.randomRoom(sudGameId, threshold, roomHolderType)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void checkRoomStatus(String roomId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkRoomStatus(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void deductMoney(String roomId) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.deductMoney(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void checkCurrency(HttpCallback<CheckCurrencyModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkCurrency()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckCurrencyModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CheckCurrencyModel> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void gameStartCheckRemainingBalance(String mgId, String roomId, HttpCallback<CheckRemainingBalance> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.gameStartCheckRemainingBalance(mgId, roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckRemainingBalance>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CheckRemainingBalance> createSudRoomModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (createSudRoomModelResponseModel.getData().getInfo().getStatus() == 1) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
|
||||
callback.onError(WordUtil.isNewZh() ? "金豆不够" : "Insufficient money ");
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRoomList(sudGameId, threshold, roomHolderType, liveUid, currencyType, page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<SudRoomListModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<SudRoomListModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void searchRoomList(String sudGameId, String threshold, String roomHolderType, String search, String currencyType, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.searchRoomList(sudGameId, threshold, roomHolderType, "0", search, currencyType, page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<SudRoomListModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<SudRoomListModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void checkRemainingBalance(String roomId, HttpCallback<CheckRemainingBalance> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkRemainingBalance(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckRemainingBalance>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CheckRemainingBalance> checkRemainingBalanceResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,9 @@ import com.yunbao.common.http.ResponseData;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
@@ -115,6 +117,22 @@ public class MainNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(anchorRecommendModelResponseModel -> {
|
||||
if (httpCallback != null) {
|
||||
AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
||||
httpCallback.onSuccess(model);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (httpCallback != null) {
|
||||
httpCallback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*
|
||||
@@ -122,7 +140,11 @@ public class MainNetManager {
|
||||
* @return
|
||||
*/
|
||||
public void anchorRecommendType(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(num, "1")
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("num", num);
|
||||
map.put("live_recommend", "slide");
|
||||
map.put("type", "1");
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(anchorRecommendModelResponseModel -> {
|
||||
@@ -266,6 +288,7 @@ public class MainNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播间上下滑动红包集合
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
@@ -50,6 +51,32 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private final String LIVE_NOTIFY_SETTINGS = "liveNotifySettings";//开播通知
|
||||
|
||||
private final String KEY_LANGUAGE = "language";
|
||||
private final String KEY_GAME = "key_game";
|
||||
|
||||
public void setRedPoint() {
|
||||
put("RedPoint", "1");
|
||||
}
|
||||
|
||||
public boolean getRedPoint() {
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1");
|
||||
}
|
||||
|
||||
public void setSudGameMin() {
|
||||
put("SudGameMin", "0");
|
||||
}
|
||||
|
||||
public boolean getSudGameMin() {
|
||||
return !TextUtils.isEmpty(getString("SudGameMin")) && !TextUtils.equals(getString("SudGameMin"), "1");
|
||||
}
|
||||
|
||||
public void setSudGame(String sudGameJson) {
|
||||
put(KEY_GAME, sudGameJson);
|
||||
}
|
||||
|
||||
|
||||
public String getSudGame() {
|
||||
return getString(KEY_GAME);
|
||||
}
|
||||
|
||||
public void setLanguage(boolean isEnglish) {
|
||||
put(KEY_LANGUAGE, isEnglish);
|
||||
@@ -301,6 +328,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
* @param model
|
||||
*/
|
||||
public void setupLoginUser(@NonNull IMLoginModel model) {
|
||||
//当用户使用自有账号登录时,可以这样统计:
|
||||
MobclickAgent.onProfileSignIn(String.valueOf(model.getId()));
|
||||
this.userInfo = model;
|
||||
if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
|
||||
token = userInfo.getToken();
|
||||
@@ -425,6 +454,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
// IMCenter.getInstance().clearConversations(null, Conversation.ConversationType.PRIVATE);
|
||||
RongcloudIMManager.logoutIM();
|
||||
MessageIMManager.get(activity).logout();
|
||||
//登出
|
||||
MobclickAgent.onProfileSignOff();
|
||||
put(IS_HINT, 0);
|
||||
APPEasyFloat.getInstance().dismiss(activity);
|
||||
if (EasyFloat.isShow("LiveFloatView")) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -100,7 +101,11 @@ public class IMRTCManager {
|
||||
public void onSuccess() {
|
||||
callback.onSuccess();
|
||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("发起邀请成功");
|
||||
if(WordUtil.isNewZh()) {
|
||||
ToastUtil.show("发起邀请成功");
|
||||
}else{
|
||||
ToastUtil.show("successful");
|
||||
}
|
||||
}
|
||||
requestUid.add(liveUid);
|
||||
startRequestTimeoutTask(liveUid);
|
||||
@@ -109,7 +114,11 @@ public class IMRTCManager {
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||
if(WordUtil.isNewZh()) {
|
||||
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||
}else{
|
||||
ToastUtil.show("invite failed:" +errorCode.getValue());
|
||||
}
|
||||
}
|
||||
if (RandomPkManager.getInstance().isRequestPk()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -36,7 +37,30 @@ public class LiveClassManager extends BaseCacheManager {
|
||||
* @return
|
||||
*/
|
||||
public List<LiveClassBean> getLiveClass() {
|
||||
return getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() {
|
||||
List<LiveClassBean> liveModels = new ArrayList<>();
|
||||
List<LiveClassBean> liveClassBeans = getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() {
|
||||
}.getType());
|
||||
if (WordUtil.isNewZh()) {
|
||||
for (int i = 0; i < liveClassBeans.size(); i++) {
|
||||
if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "Hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "熱門")) {
|
||||
liveModels.add(0, liveClassBeans.get(i));
|
||||
} else {
|
||||
liveModels.add(liveClassBeans.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < liveClassBeans.size(); i++) {
|
||||
if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "English") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "english")
|
||||
|| TextUtils.equals(liveClassBeans.get(i).getEnglish(), "英語")) {
|
||||
liveModels.add(0, liveClassBeans.get(i));
|
||||
} else {
|
||||
liveModels.add(liveClassBeans.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return liveModels;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user