Compare commits
2 Commits
dev_6-6-1
...
6.4.4_fix_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
283de1047c | ||
|
|
06079c7e9c |
@@ -71,7 +71,7 @@ public class FaceManager implements SensorEventListener {
|
||||
* 配置美颜SDK
|
||||
*/
|
||||
public void initFURender(Context context) {
|
||||
initFaceUnity(context);
|
||||
|
||||
mFURenderer = FURenderer.getInstance();
|
||||
mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE);
|
||||
mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT);
|
||||
@@ -105,11 +105,9 @@ public class FaceManager implements SensorEventListener {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void loadConfig() {
|
||||
public void loadConfig(){
|
||||
initFaceBeauty();
|
||||
}
|
||||
|
||||
public void initFaceBeauty() {
|
||||
FaceBeautyDataFactory faceBeautyDataFactory;
|
||||
faceBeautyDataFactory = new FaceBeautyDataFactory();
|
||||
@@ -117,13 +115,9 @@ public class FaceManager implements SensorEventListener {
|
||||
for (String key : configMap.keySet()) {
|
||||
if ("FilterViewHolder_".equals(key)) {
|
||||
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
||||
if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) {
|
||||
try {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (filter.getKey().equals(configMap.get(key))&&!"origin".equals(configMap.get(key))) {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")))/100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 ="+filter.getKey()+" val = "+configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -131,25 +125,17 @@ public class FaceManager implements SensorEventListener {
|
||||
String name = key.replace("BeautySkinViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (key.startsWith("BeautyShapeViewHolder")) {
|
||||
}else if(key.startsWith("BeautyShapeViewHolder")){
|
||||
String name = key.replace("BeautyShapeViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +277,6 @@ public class FaceManager implements SensorEventListener {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
isInit = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ public class ContainerRecyclerAdapter extends RecyclerView.Adapter<BaseViewHolde
|
||||
}
|
||||
|
||||
public void hideSeekBar() {
|
||||
if (seekBar.getVisibility() == View.INVISIBLE) {
|
||||
if (seekBar.getVisibility() == View.GONE) {
|
||||
return;
|
||||
}
|
||||
seekBar.setOnProgressChangeListener(null);
|
||||
seekBar.setVisibility(View.INVISIBLE);
|
||||
seekBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ public class FURenderer extends IFURenderer {
|
||||
private FURenderKit mFURenderKit;
|
||||
|
||||
/* AI道具*/
|
||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||
private String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||
private String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||
|
||||
/* GL 线程 ID */
|
||||
private Long mGlThreadId = 0L;
|
||||
|
||||
@@ -314,35 +314,6 @@ public class FileUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String copyAssetsFile(Context context, String assetsPath, String fileName, String saveFileDir) {
|
||||
File fileDir = new File(saveFileDir);
|
||||
if (!fileDir.exists()) {
|
||||
fileDir.mkdirs();
|
||||
}
|
||||
File file = new File(fileDir, fileName);
|
||||
if (file.exists()) {
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
try {
|
||||
InputStream inputStream = context.getAssets().open(assetsPath);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
BufferedInputStream bis = new BufferedInputStream(inputStream);
|
||||
BufferedOutputStream bos = new BufferedOutputStream(fos);
|
||||
byte[] byteArray = new byte[1024];
|
||||
int bytes = bis.read(byteArray);
|
||||
while (bytes > 0) {
|
||||
bos.write(byteArray, 0, bytes);
|
||||
bos.flush();
|
||||
bytes = bis.read(byteArray);
|
||||
}
|
||||
bos.close();
|
||||
fos.close();
|
||||
return file.getAbsolutePath();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Uri文件绝对路径
|
||||
@@ -551,7 +522,6 @@ public class FileUtils {
|
||||
|
||||
/**
|
||||
* 遍历一个文件夹获取改文件夹下所有文件名
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
@@ -593,7 +563,7 @@ public class FileUtils {
|
||||
* @param path String
|
||||
* @return Boolean
|
||||
*/
|
||||
public static Boolean checkIsVideo(Context context, String path) {
|
||||
public static Boolean checkIsVideo(Context context,String path) {
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
retriever.setDataSource(context, Uri.fromFile(new File(path)));
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#FF8D41</color>
|
||||
<color name="colorPrimaryDark">#FF8D41</color>
|
||||
<color name="colorAccent">#FF8D41</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
|
||||
<!--fulive demo 主配色-->
|
||||
<color name="primary_background">#050F14</color>
|
||||
|
||||
@@ -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">Buffing</string>
|
||||
<string name="beauty_box_color_level">Skin Tone</string>
|
||||
<string name="beauty_box_red_level">Rosy</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_sharpen">Sharpen</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_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_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">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_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_radio_filter">Filter</string>
|
||||
<string name="beauty_radio_style">Style recommend</string>
|
||||
<string name="beauty_radio_style">Presets</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">Dark Circles</string>
|
||||
<string name="beauty_micro_nasolabial">Laugh Line</string>
|
||||
<string name="beauty_micro_pouch">Circle</string>
|
||||
<string name="beauty_micro_nasolabial">Wrinkles</string>
|
||||
<string name="beauty_micro_smile">Smile</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_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_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 \'Style recommend\' first.</string>
|
||||
<string name="beauty_face_style_toast">To use %s, cancel \'Presets\' first.</string>
|
||||
|
||||
<string name="select_data_photo">Photo</string>
|
||||
<string name="select_data_video">Video</string>
|
||||
@@ -299,7 +299,7 @@
|
||||
<string name="beautify_hip_slim">Hip</string>
|
||||
<string name="beautify_head_slim">Head shrink</string>
|
||||
<string name="beautify_leg_thin_slim">Thin leg</string>
|
||||
<string name="toast_not_detect_body">No message tracking</string>
|
||||
<string name="toast_not_detect_body">No body tracking</string>
|
||||
<string name="pta_human_full_body">Body driver</string>
|
||||
<string name="pta_human_half_body">Bust driver</string>
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.yunbao.faceunity;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
@@ -7,5 +10,8 @@ package com.yunbao.faceunity;
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
1
Share/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,73 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
packagingOptions {
|
||||
pickFirst "lib/armeabi/libyuvutils.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||
pickFirst "lib/armeabi-v7a/libyuvutils.so"
|
||||
pickFirst "lib/armeabi/libyuvtools.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvtools.so"
|
||||
pickFirst "lib/armeabi-v7a/libyuvtools.so"
|
||||
exclude "lib/arm64-v8a/libmmcv_api_handgesture.so"
|
||||
exclude "lib/arm64-v8a/libmmcv_api_express.so"
|
||||
exclude "lib/arm64-v8a/libMediaEncoder.so"
|
||||
exclude "lib/arm64-v8a/libarcore_sdk_c.so"
|
||||
exclude "lib/arm64-v8a/libmediadecoder.so"
|
||||
exclude "lib/arm64-v8a/libMediaMuxer.so"
|
||||
exclude "lib/arm64-v8a/libarcore_sdk_jni.so"
|
||||
exclude "lib/arm64-v8a/libMediaUtils.so"
|
||||
exclude "lib/arm64-v8a/libcosmosffmpeg.so"
|
||||
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode rootProject.ext.android.versionCode
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
cruncherEnabled = false
|
||||
useNewCruncher = false
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs', '../libs'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
//common
|
||||
implementation project(path: ':common')
|
||||
//Twitter
|
||||
implementation 'com.twitter.sdk.android:twitter:3.1.1'
|
||||
//facebook & Messenger
|
||||
implementation 'com.facebook.android:facebook-share:15.2.0'
|
||||
|
||||
|
||||
|
||||
}
|
||||
21
Share/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.yunbao.share.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.pdlive.shayu">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pdlive.shayu"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
android:name="com.facebook.composer" />
|
||||
|
||||
<package
|
||||
android:name="com.facebook.katana" />
|
||||
<package
|
||||
android:name="com.facebook.messenger" />
|
||||
<provider
|
||||
android:authorities="com.facebook.katana.provider.PlatformProvider"
|
||||
tools:ignore="ExportedContentProvider" />
|
||||
|
||||
</queries>
|
||||
<application android:allowBackup="true">
|
||||
<activity
|
||||
android:name="com.facebook.FacebookActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name="com.facebook.FacebookContentProvider"
|
||||
android:authorities="com.facebook.app.FacebookContentProvider2011402032399020"
|
||||
android:exported="true" />
|
||||
<receiver
|
||||
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_SUCCESS" />
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_FAILURE" />
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.TWEET_COMPOSE_CANCEL" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.receiver.TwitterResultReceiver;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbsShareInterface {
|
||||
protected final Context mContext;
|
||||
|
||||
public AbsShareInterface(Context context) {
|
||||
this.mContext = context;
|
||||
IntentFilter filter = new IntentFilter(TweetUploadService.UPLOAD_SUCCESS);
|
||||
filter.addAction(TweetUploadService.UPLOAD_FAILURE);
|
||||
filter.addAction(TweetUploadService.TWEET_COMPOSE_CANCEL);
|
||||
context.registerReceiver(new TwitterResultReceiver(), filter);
|
||||
}
|
||||
|
||||
public abstract void share(ShareBuilder builder, ICallback callback);
|
||||
|
||||
public Uri fileToUri(File file){
|
||||
return FileProvider.getUriForFile(mContext,
|
||||
mContext.getPackageName() + ".fileprovider",
|
||||
file
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
public interface ICallback {
|
||||
void onSuccess();
|
||||
void onFailure();
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.yunbao.share.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.platform.FacebookShare;
|
||||
import com.yunbao.share.platform.Instagram;
|
||||
import com.yunbao.share.platform.Line;
|
||||
import com.yunbao.share.platform.MessengerShare;
|
||||
import com.yunbao.share.platform.TwitterShare;
|
||||
import com.yunbao.share.platform.WhatsApp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
||||
private Context mContext;
|
||||
private List<ShareBuilder> list;
|
||||
|
||||
public ShareAppAdapter(Context mContext) {
|
||||
list = new ArrayList<>();
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<ShareBuilder> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AppViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new AppViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_share_app, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
||||
ShareBuilder builder = list.get(position);
|
||||
switch (builder.getType()) {
|
||||
case ShareBuilder.APP_FACEBOOK:
|
||||
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
|
||||
break;
|
||||
case ShareBuilder.APP_LINE:
|
||||
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
||||
break;
|
||||
case ShareBuilder.APP_TWITTER:
|
||||
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
||||
break;
|
||||
case ShareBuilder.APP_WHATSAPP:
|
||||
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
||||
break;
|
||||
case ShareBuilder.APP_MESSENGER:
|
||||
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
||||
break;
|
||||
case ShareBuilder.APP_INSTAGRAM:
|
||||
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public static class AppViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView icon;
|
||||
TextView title;
|
||||
|
||||
public AppViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.share_app_icon);
|
||||
title = itemView.findViewById(R.id.share_app_name);
|
||||
}
|
||||
|
||||
public void setData(ShareBuilder bean, @DrawableRes int iconId, @StringRes int appName) {
|
||||
icon.setImageResource(iconId);
|
||||
title.setText(appName);
|
||||
itemView.setOnClickListener(v -> {
|
||||
switch (bean.getType()) {
|
||||
case ShareBuilder.APP_FACEBOOK:
|
||||
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_LINE:
|
||||
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_TWITTER:
|
||||
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_WHATSAPP:
|
||||
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_MESSENGER:
|
||||
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_INSTAGRAM:
|
||||
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static class ShareCallback implements ICallback {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
package com.yunbao.share.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ShareBuilder {
|
||||
public static final int APP_FACEBOOK = 0;
|
||||
public static final int APP_LINE = 1;
|
||||
public static final int APP_TWITTER = 2;
|
||||
public static final int APP_WHATSAPP = 3;
|
||||
public static final int APP_MESSENGER = 4;
|
||||
public static final int APP_INSTAGRAM = 5;
|
||||
|
||||
private String text;
|
||||
private String link;
|
||||
private File file;
|
||||
private int type;
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
|
||||
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||
return String.format(CommonAppConfig.HOST +
|
||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||
anchorId,
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
) ;
|
||||
}
|
||||
|
||||
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"
|
||||
);
|
||||
}
|
||||
|
||||
public static ShareBuilder builder(int type) {
|
||||
return new ShareBuilder(type);
|
||||
}
|
||||
|
||||
private ShareBuilder(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAnchorId() {
|
||||
return anchorId;
|
||||
}
|
||||
|
||||
public void setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public String getAnchorName() {
|
||||
return anchorName;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
|
||||
public String getAnchorAvatar() {
|
||||
return anchorAvatar;
|
||||
}
|
||||
|
||||
public void setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
}
|
||||
|
||||
public ShareBuilder setText(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBuilder setLink(String link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBuilder setFile(File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
if (StringUtil.isEmpty(text)) {
|
||||
return getLink();
|
||||
}
|
||||
return text + "\n" + getLink();
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
if (StringUtil.isEmpty(link)) {
|
||||
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ShareBuilder{" +
|
||||
"text='" + text + '\'' +
|
||||
", link='" + link + '\'' +
|
||||
", file=" + file +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.widget.ShareDialog;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class FacebookShare extends AbsShareInterface {
|
||||
public static CallbackManager callbackManager;
|
||||
public FacebookShare(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
callbackManager= CallbackManager.Factory.create();
|
||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||
.setContentUrl(Uri.parse(builder.getLink()))
|
||||
.build();
|
||||
ShareDialog dialog=new ShareDialog((Activity) mContext);
|
||||
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
|
||||
@Override
|
||||
public void onSuccess(Sharer.Result result) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull FacebookException e) {
|
||||
}
|
||||
});
|
||||
dialog.show(content);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class Instagram extends AbsShareInterface {
|
||||
public Instagram(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
String type = "image/*";
|
||||
Intent share = new Intent(Intent.ACTION_SEND);
|
||||
Uri uri = fileToUri(builder.getFile());
|
||||
share.setType(type);
|
||||
share.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
share.setPackage("com.instagram.android");
|
||||
mContext.startActivity(Intent.createChooser(share, "Share to"));
|
||||
callback.onSuccess();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class Line extends AbsShareInterface {
|
||||
|
||||
public Line(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
try {
|
||||
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
||||
mContext.startActivity(share);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.widget.MessageDialog;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class MessengerShare extends AbsShareInterface {
|
||||
public static CallbackManager callbackManager;
|
||||
|
||||
public MessengerShare(Context context) {
|
||||
super(context);
|
||||
FacebookSdk.setIsDebugEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
callbackManager = CallbackManager.Factory.create();
|
||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||
.setContentUrl(Uri.parse(builder.getLink()))
|
||||
.build();
|
||||
MessageDialog dialog = new MessageDialog((Activity) mContext);
|
||||
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
|
||||
@Override
|
||||
public void onSuccess(Sharer.Result result) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull FacebookException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
if(dialog.canShow(content)) {
|
||||
dialog.show(content);
|
||||
}else{
|
||||
callback.onFailure();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.twitter.sdk.android.core.Twitter;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class TwitterShare extends AbsShareInterface {
|
||||
public TwitterShare(Context context) {
|
||||
super(context);
|
||||
Twitter.initialize(context);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder date, ICallback callback) {
|
||||
|
||||
/*
|
||||
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
|
||||
@Override
|
||||
public void success(Result<TwitterSession> result) {
|
||||
//获取以下登录成功返回信息进行登录验证
|
||||
|
||||
//获取登录用户信息
|
||||
final TwitterSession activeSession=TwitterCore.getInstance().getSessionManager().getActiveSession();
|
||||
Intent intent = new ComposerActivity.Builder(mContext)
|
||||
.session(activeSession)
|
||||
.image(fileToUri(date.getFile()))
|
||||
.text(date.getText())
|
||||
.hashtags("#twitter")
|
||||
.createIntent();
|
||||
mContext.startActivity(intent);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void failure(TwitterException e) {
|
||||
}
|
||||
});*/
|
||||
/* TweetComposer.Builder builder;
|
||||
if (date.getFile() == null) {
|
||||
try {
|
||||
builder=new TweetComposer.Builder(mContext)
|
||||
.text(date.getText())
|
||||
.url(new URL(date.getLink()));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
builder = new TweetComposer.Builder(mContext)
|
||||
.text(date.getText())
|
||||
.image(fileToUri(date.getFile()));
|
||||
}
|
||||
builder.show();*/
|
||||
try {
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_VIEW);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, date.getText());
|
||||
// sendIntent.setType("text/plain");
|
||||
//sendIntent.setPackage("com.twitter.composer.ComposerShareActivity");
|
||||
sendIntent.setData(Uri.parse("https://twitter.com/intent/tweet?text=" +URLEncoder.encode(date.getText(),"UTF-8")));
|
||||
mContext.startActivity(sendIntent);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class WhatsApp extends AbsShareInterface {
|
||||
public WhatsApp(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
try {
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, builder.getText());
|
||||
sendIntent.setType("text/plain");
|
||||
sendIntent.setPackage("com.whatsapp");
|
||||
mContext.startActivity(sendIntent);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.yunbao.share.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
public class TwitterResultReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.i("分享log", "onReceive: "+intent.getAction());
|
||||
if (TweetUploadService.UPLOAD_SUCCESS.equals(intent.getAction())) {
|
||||
ToastUtil.show("推特分享成功");
|
||||
// success
|
||||
final Long tweetId = intent.getExtras().getLong(TweetUploadService.EXTRA_TWEET_ID);
|
||||
} else if (TweetUploadService.UPLOAD_FAILURE.equals(intent.getAction())) {
|
||||
// failure
|
||||
ToastUtil.show("推特分享失败");
|
||||
final Intent retryIntent = intent.getExtras().getParcelable(TweetUploadService.EXTRA_RETRY_INTENT);
|
||||
} else if (TweetUploadService.TWEET_COMPOSE_CANCEL.equals(intent.getAction())) {
|
||||
// cancel
|
||||
ToastUtil.show("推特分享取消");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
private ShareAppAdapter adapter;
|
||||
private RecyclerView list;
|
||||
private RoundedImageView avatar;
|
||||
private TextView info;
|
||||
private TextView link;
|
||||
private TextView title;
|
||||
private List<ShareBuilder> data;
|
||||
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private String url;
|
||||
|
||||
public InvitePopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public InvitePopDialog setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_share;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.close).setOnClickListener(v -> dismiss());
|
||||
((ImageView) findViewById(R.id.close)).setImageResource(R.mipmap.icon_invite_close);
|
||||
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
|
||||
// findViewById(R.id.share_preview).setVisibility(GONE);
|
||||
findViewById(R.id.share_dialog).setBackgroundResource(R.mipmap.bg_dialog_inviet);
|
||||
title = findViewById(R.id.share_title);
|
||||
list = findViewById(R.id.share_apps_list);
|
||||
avatar = findViewById(R.id.share_avatar);
|
||||
info = findViewById(R.id.share_info);
|
||||
link = findViewById(R.id.share_link);
|
||||
adapter = new ShareAppAdapter(getContext());
|
||||
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
link.setText(url.substring(0, 40));
|
||||
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);
|
||||
title.getViewTreeObserver().addOnGlobalLayoutListener(this::setTitleColor);
|
||||
}
|
||||
|
||||
private void setTitleColor() {
|
||||
int[] colors = {
|
||||
Color.parseColor("#3377FF"),
|
||||
Color.parseColor("#7F66FF"),
|
||||
};
|
||||
float[] position = {
|
||||
0f,
|
||||
1.0f
|
||||
};
|
||||
float height = title.getMeasuredHeight();
|
||||
LinearGradient mLinearGradient = new LinearGradient(0, 0, 0, height, colors, position, Shader.TileMode.CLAMP);
|
||||
title.getPaint().setShader(mLinearGradient);
|
||||
title.invalidate();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
data = new ArrayList<>();
|
||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
data.add(builder(ShareBuilder.APP_LINE));
|
||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
||||
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||
adapter.setList(data);
|
||||
|
||||
}
|
||||
|
||||
private ShareBuilder builder(int type) {
|
||||
ShareBuilder builder = ShareBuilder.builder(type);
|
||||
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
||||
builder.setLink(url);
|
||||
builder.setUid(uid);
|
||||
builder.setAnchorId(anchorId);
|
||||
builder.setAnchorName(anchorName);
|
||||
builder.setAnchorAvatar(anchorAvatar);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void copyLink() {
|
||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", info.getText() + "\n" + url);
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||
}
|
||||
|
||||
public InvitePopDialog setUrl(String data) {
|
||||
this.url = data + "&isGoogle=" + (CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0");
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
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.adapters.ShareAppAdapter;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
private ShareAppAdapter adapter;
|
||||
private RecyclerView list;
|
||||
private RoundedImageView avatar;
|
||||
private TextView info;
|
||||
private TextView link;
|
||||
private List<ShareBuilder> data;
|
||||
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private String shareLink;
|
||||
|
||||
public SharePopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SharePopDialog setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setShareLink(String link) {
|
||||
this.shareLink = link + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_share;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.close).setOnClickListener(v -> dismiss());
|
||||
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
|
||||
list = findViewById(R.id.share_apps_list);
|
||||
avatar = findViewById(R.id.share_avatar);
|
||||
info = findViewById(R.id.share_info);
|
||||
link = findViewById(R.id.share_link);
|
||||
adapter = new ShareAppAdapter(getContext());
|
||||
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
data = new ArrayList<>();
|
||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
data.add(builder(ShareBuilder.APP_LINE));
|
||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
||||
//data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||
adapter.setList(data);
|
||||
String url;
|
||||
if (shareLink == null) {
|
||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar).substring(0, 40) + "...";
|
||||
} else {
|
||||
if (shareLink.length() > 40) {
|
||||
url = shareLink.substring(0, 40) + "...";
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
|
||||
private ShareBuilder builder(int type) {
|
||||
ShareBuilder builder = ShareBuilder.builder(type);
|
||||
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
||||
builder.setUid(uid);
|
||||
builder.setAnchorId(anchorId);
|
||||
builder.setAnchorName(anchorName);
|
||||
builder.setAnchorAvatar(anchorAvatar);
|
||||
if (shareLink != null) {
|
||||
builder.setLink(shareLink);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void copyLink() {
|
||||
String url;
|
||||
if (shareLink != null) {
|
||||
url = shareLink;
|
||||
} else {
|
||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||
}
|
||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="189dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffc621" android:endColor="#ffffae05" android:angle="135" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffffffff" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#3377FF" android:endColor="#7F66FF" android:angle="90" />
|
||||
<corners android:topLeftRadius="22dp" android:topRightRadius="22dp" android:bottomLeftRadius="22dp" android:bottomRightRadius="22dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="15dp" />
|
||||
<solid android:color="#ffffff" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#EBEBEB" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_dialog"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_dialog_share">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_invite_title"
|
||||
android:textColor="@drawable/bg_invite_title"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:srcCompat="@mipmap/icon_dialog_charge_close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/share_apps_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
|
||||
tools:itemCount="6"
|
||||
tools:layoutManager="GridLayoutManager"
|
||||
tools:listitem="@layout/item_share_app"
|
||||
tools:spanCount="3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_dialog"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_dialog_share">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_share_title"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:srcCompat="@mipmap/icon_share_close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/share_preview"
|
||||
layout="@layout/view_share_preview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/share_apps_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/share_preview"
|
||||
tools:itemCount="6"
|
||||
tools:layoutManager="GridLayoutManager"
|
||||
tools:listitem="@layout/item_share_app"
|
||||
tools:spanCount="3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_app_icon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="35dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="35dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="TextView"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/share_app_icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_preview"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/share_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_share_info"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_copy"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="16dp"
|
||||
|
||||
android:background="@drawable/bg_btn"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="25dp"
|
||||
android:text="@string/dialog_share_copy"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_layout_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@mipmap/icon_share_url" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="TextView"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
Before Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 548 B |
|
Before Width: | Height: | Size: 484 B |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 955 B |
|
Before Width: | Height: | Size: 7.2 KiB |
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="dialog_share_title">Share</string>
|
||||
<string name="dialog_share_info">Come and watch %s live on PDLIVE and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
|
||||
<string name="dialog_share_copy">Copy</string>
|
||||
</resources>
|
||||
@@ -1,17 +0,0 @@
|
||||
<resources>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_KEY" translatable="false">ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_SECRET" translatable="false">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="dialog_share_title">分享</string>
|
||||
<string name="dialog_share_info">快來 PDLIVE觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook" translatable="false">Facebook</string>
|
||||
<string name="dialog_share_app_line" translatable="false">Line</string>
|
||||
<string name="dialog_share_app_twitter" translatable="false">Twitter</string>
|
||||
<string name="dialog_share_app_whatsapp" translatable="false">WhatsApp</string>
|
||||
<string name="dialog_share_app_messenger" translatable="false">Messenger</string>
|
||||
<string name="dialog_share_app_instagram" translatable="false">Instagram</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PDLIVE觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
</resources>
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,10 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
dexOptions {
|
||||
jumboMode = true
|
||||
}
|
||||
project.tasks.getByName("tasks").doFirst {
|
||||
|
||||
}
|
||||
/* applicationVariants.all { variant ->
|
||||
variant.mergeAssetsProvider.configure {
|
||||
@@ -95,13 +92,6 @@ android {
|
||||
exclude 'lib/armeabi-v7a/libmmlic.so'
|
||||
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
||||
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
||||
//美颜
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
||||
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
||||
exclude 'lib/armeabi-v7a/libfuai.so'
|
||||
exclude 'lib/arm64-v8a/libfuai.so'
|
||||
}
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
@@ -109,11 +99,6 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
applicationVariants.all { variant ->
|
||||
println "清空build文件夹";
|
||||
for (final def project in rootProject.getAllprojects()) {
|
||||
delete project.buildDir
|
||||
println project.buildDir
|
||||
}
|
||||
String variantName = variant.name.capitalize()
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
@@ -154,36 +139,9 @@ android {
|
||||
'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'
|
||||
]))
|
||||
} else {
|
||||
println "不删除bundle"
|
||||
}
|
||||
}
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "link"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay) {
|
||||
isGoogle = "Google"
|
||||
}
|
||||
def isPlugin = "all"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
isPlugin = "plugin"
|
||||
}
|
||||
def isTest = "测试服"
|
||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
||||
isTest = "正式服"
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -235,17 +193,12 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
zipAlignEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
zipAlignEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
@@ -277,7 +230,6 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
|
||||
// implementation rootProject.ext.dependencies["leakcanary"]
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||
|
||||
|
||||
}
|
||||
|
||||
211
app/proguard-rules.pro
vendored
@@ -12,40 +12,17 @@
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
public *;
|
||||
}
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the groupLast number information for
|
||||
# debugging stack traces.
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the groupLast number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep class com.yunbao.**{
|
||||
public <methods>;
|
||||
protected <methods>;
|
||||
}
|
||||
-keep class * implements com.yunbao.common.bean.BaseModel {
|
||||
*;
|
||||
}
|
||||
-keep class com.yunbao.common.bean.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.yunbao.common.views.weight.VerticalViewPager$LayoutParams{
|
||||
*;
|
||||
}
|
||||
-keep class android.**{
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
-keep class com.tencent.** { *; }
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-keep class com.adjust.sdk.**{ *; }
|
||||
-keep class com.google.android.gms.common.ConnectionResult {
|
||||
int SUCCESS;
|
||||
@@ -71,13 +48,6 @@
|
||||
-keep class okhttp3.internal.**{*;}
|
||||
|
||||
-dontwarn okio.**
|
||||
#okhttp
|
||||
-dontwarn okhttp3.**
|
||||
-keep class okhttp3.**{*;}
|
||||
|
||||
#okio
|
||||
-dontwarn okio.**
|
||||
-keep class okio.**{*;}
|
||||
|
||||
# Retrofit
|
||||
|
||||
@@ -85,10 +55,9 @@
|
||||
|
||||
-keep class retrofit2.** { *; }
|
||||
|
||||
-keepattributes Signature-keepattributes,Exceptions
|
||||
-keepattributes Signature-keepattributes Exceptions
|
||||
|
||||
# RxJava RxAndroid
|
||||
-dontwarn java.util.concurrent.Flow*
|
||||
|
||||
-dontwarn sun.misc.**
|
||||
|
||||
@@ -100,180 +69,20 @@ long consumerIndex;
|
||||
|
||||
}
|
||||
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef* {
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
|
||||
|
||||
rx.internal.util.atomic.LinkedQueueNode* producerNode;
|
||||
rx.internal.util.atomic.LinkedQueueNode producerNode;
|
||||
|
||||
}
|
||||
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef* {
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
|
||||
|
||||
rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
rx.internal.util.atomic.LinkedQueueNode consumerNode;
|
||||
|
||||
}
|
||||
|
||||
# Gson
|
||||
|
||||
-keep class com.google.gson.stream.** { *; }
|
||||
##---------------Begin: proguard configuration for Gson ----------
|
||||
# Gson uses generic type information stored in a class file when working with fields. Proguard
|
||||
# removes such information by default, so configure it to keep all of it.
|
||||
-keepattributes Signature
|
||||
|
||||
# For using GSON @Expose annotation
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# Gson specific classes
|
||||
-dontwarn sun.misc.**
|
||||
#-keep class com.google.gson.stream.** { *; }
|
||||
|
||||
# Application classes that will be serialized/deserialized over Gson
|
||||
-keep class com.google.gson.examples.android.model.** { <fields>; }
|
||||
|
||||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||
-keep class * extends com.google.gson.TypeAdapter
|
||||
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||
-keep class * implements com.google.gson.JsonSerializer
|
||||
-keep class * implements com.google.gson.JsonDeserializer
|
||||
|
||||
# Prevent R8 from leaving Data object members always null
|
||||
-keepclassmembers,allowobfuscation class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||
|
||||
##---------------End: proguard configuration for Gson ----------
|
||||
|
||||
-keepattributes EnclosingMethod
|
||||
#--------融云
|
||||
-keepattributes Exceptions,InnerClasses
|
||||
-keepattributes Signature
|
||||
-keep class io.rong.** {*;}
|
||||
-keep class cn.rongcloud.** {*;}
|
||||
-keep class * implements io.rong.imlib.model.MessageContent {*;}
|
||||
-dontwarn io.rong.push.**
|
||||
-dontnote com.xiaomi.**
|
||||
-dontnote com.google.android.gms.gcm.**
|
||||
-dontnote io.rong.**
|
||||
# 下方混淆使用了融云 IMKit 提供的 locationKit 位置插件时才需要配置,可参考高德官网的混淆方式:https://lbs.amap.com/api/android-sdk/guide/create-project/dev-attention
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
-keep class com.amap.api.location.**{*;}
|
||||
-keep class com.amap.api.fence.**{*;}
|
||||
-keep class com.loc.**{*;}
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
-keep class com.amap.api.services.**{*;}
|
||||
-ignorewarnings
|
||||
|
||||
#--------科大讯飞
|
||||
-keep class com.iflytek.**{*;}
|
||||
-keepattributes Signature
|
||||
#EvenBus
|
||||
-keepattributes *Annotation*
|
||||
-keepclassmembers class * {
|
||||
@org.greenrobot.eventbus.Subscribe <methods>;
|
||||
}
|
||||
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
||||
|
||||
# If using AsyncExecutord, keep required constructor of default event used.
|
||||
# Adjust the class name if a custom failure event type is used.
|
||||
-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
|
||||
<init>(java.lang.Throwable);
|
||||
}
|
||||
|
||||
# Accessed via reflection, avoid renaming or removal
|
||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
||||
|
||||
#--------ARouter
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
# If you use the byType method to obtain Service, add the following rules to protect the interface:
|
||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
|
||||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
#----retrofit2
|
||||
-keepattributes Signature, InnerClasses, EnclosingMethod
|
||||
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
|
||||
-keepattributes AnnotationDefault
|
||||
-keepclassmembers,allowshrinking,allowobfuscation interface * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement*
|
||||
-dontwarn javax.annotation.**
|
||||
-dontwarn kotlin.Unit
|
||||
-dontwarn retrofit2.KotlinExtensions*
|
||||
-dontwarn retrofit2.KotlinExtensions$*
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface <1>
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface * extends <1>
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
||||
-if interface * { @retrofit2.http.* public *** *(...); }
|
||||
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
|
||||
|
||||
#-----glide
|
||||
-keep public class com.bumptech.glide.** {*;}
|
||||
-keep public class jp.co.cyberagent.** {*;}
|
||||
-dontwarn jp.co.cyberagent.android.gpuimage.**
|
||||
|
||||
-printconfiguration tmp/full-r8-config.txt
|
||||
#---美颜模块需要暴露出来的参数名
|
||||
-keep class com.yunbao.faceunity.utils.FURenderer{
|
||||
public static java.lang.String BUNDLE_AI_FACE;
|
||||
}
|
||||
-keep class com.yunbao.faceunity.utils.FaceUnityConfig{
|
||||
public static java.lang.String BUNDLE_FACE_BEAUTIFICATION;
|
||||
}
|
||||
-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.** {*;}
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
tools:node="remove" />
|
||||
<uses-permission
|
||||
android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_LOGS"
|
||||
tools:ignore="ProtectedPermissions"
|
||||
@@ -63,9 +60,6 @@
|
||||
<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
|
||||
@@ -84,15 +78,10 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
|
||||
<!-- 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.ACCESS_NOTIFICATION_POLICY" />
|
||||
<queries>
|
||||
<package android:name="com.twitter.android" />
|
||||
<package android:name="jp.naver.line.android" />
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
|
||||
</queries>
|
||||
<application
|
||||
android:name="com.shayu.phonelive.AppContext"
|
||||
android:allowBackup="true"
|
||||
@@ -101,28 +90,28 @@
|
||||
android:largeHeap="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
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:exported="false"
|
||||
android:stopWithTask="false">
|
||||
android:stopWithTask="false"
|
||||
android:exported="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">
|
||||
tools:ignore="LockedOrientationActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -134,10 +123,22 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
||||
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
|
||||
<data android:scheme="smvslm" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</activity> <!-- keytool -exportcert -alias androiddebugkey -keystore feixiong.jks | openssl sha1 -binary | openssl base64 -->
|
||||
<meta-data
|
||||
android:name="TencentMapSDK"
|
||||
android:value="${txMapAppKey}" />
|
||||
<!-- 百度语音识别 -->
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.APP_ID"
|
||||
android:value="${baiduAppId}" />
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.API_KEY"
|
||||
android:value="${baiduAppKey}" />
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.SECRET_KEY"
|
||||
android:value="${baiduAppSecretKey}" />
|
||||
|
||||
<!-- 服务器地址 -->
|
||||
<meta-data
|
||||
@@ -150,9 +151,6 @@
|
||||
<meta-data
|
||||
android:name="IS_UPLOAD_ERROR_LOG"
|
||||
android:value="${isUploadLog}" />
|
||||
<meta-data
|
||||
android:name="IS_PLUGIN_MODEL"
|
||||
android:value="${isPluginModel}" />
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
android:value="${isUploadLog}" />
|
||||
@@ -167,16 +165,13 @@
|
||||
<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">
|
||||
@@ -194,12 +189,12 @@
|
||||
<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="106936673"/>
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.cpid"
|
||||
android:value="30086000612391734"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -11,45 +11,42 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustConfig;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.adjust.sdk.LogLevel;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
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.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.faceunity.FaceManager;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
@@ -86,14 +83,15 @@ public class AppContext extends CommonAppContext {
|
||||
public LiveImDeletUtil liveImDeletUtil;
|
||||
private final static List<WeakReference<Activity>> activities = new ArrayList<>();
|
||||
|
||||
|
||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
Adjust.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Adjust.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,14 +112,12 @@ public class AppContext extends CommonAppContext {
|
||||
return;
|
||||
}
|
||||
}
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
activities.add(new WeakReference<>(activity));
|
||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||
AppManager.getInstance().addActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +130,13 @@ public class AppContext extends CommonAppContext {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//注册全局异常捕获
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
@@ -165,24 +160,39 @@ public class AppContext extends CommonAppContext {
|
||||
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);
|
||||
|
||||
String environment = AdjustConfig.ENVIRONMENT_PRODUCTION;
|
||||
AdjustConfig config = new AdjustConfig(this, "3om5fbglyqdc", environment);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
||||
config.setDefaultTracker("xa7k5ut");
|
||||
}
|
||||
Adjust.onCreate(config);
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
config.setLogLevel(LogLevel.WARN);
|
||||
//激活操作记录
|
||||
AdjustEvent adjustEvent = new AdjustEvent("m7wk0c");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_activation", null);
|
||||
|
||||
//FB激活
|
||||
logger.logEvent("FB_activation");
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("p7igfz");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("p7igfz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_complete_1st_loading", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_complete_1st_loading");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//初始化 AndroidUtilCode
|
||||
Utils.init(this);
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
@@ -216,16 +226,11 @@ public class AppContext extends CommonAppContext {
|
||||
&& (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);
|
||||
JSONObject map = received.getMsg().getJSONObject(0);
|
||||
sendStartAnchorLive(map);
|
||||
}
|
||||
//主播页面
|
||||
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||
EventBus.getDefault().post(message);
|
||||
}
|
||||
@@ -235,14 +240,6 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendStartAnchorLive(JSONObject map) {
|
||||
AnchorStartLiveBean bean = new AnchorStartLiveBean();
|
||||
bean.setAnchorName(map.getString("anchorName"));
|
||||
bean.setRoomId(map.getString("roomid"));
|
||||
bean.setAvatar(map.getString("avatar"));
|
||||
EventBus.getDefault().post(bean);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -271,12 +268,10 @@ public class AppContext extends CommonAppContext {
|
||||
mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
configSPApp();
|
||||
//初始化美颜SDK
|
||||
// FaceManager.initFaceUnity(this);
|
||||
|
||||
FaceManager.initFaceUnity(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,21 +313,18 @@ public class AppContext extends CommonAppContext {
|
||||
.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();
|
||||
}
|
||||
//闪退后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);
|
||||
});
|
||||
|
||||
}
|
||||
/* 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会打印异常信息
|
||||
@@ -350,7 +342,7 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
|
||||
|
||||
public static void setFirebaseCrashData() {
|
||||
private void setFirebaseCrashData() {
|
||||
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,13 +8,9 @@ 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;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
@@ -94,12 +90,10 @@ public class NeverCrashUtils {
|
||||
*
|
||||
* @param application application
|
||||
*/
|
||||
private boolean errorWhile = true;
|
||||
|
||||
public void register(Application application) {
|
||||
//主线程异常拦截
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
while (errorWhile) {
|
||||
while (true) {
|
||||
try {
|
||||
Looper.loop();
|
||||
} catch (Throwable e) {
|
||||
@@ -107,13 +101,10 @@ public class NeverCrashUtils {
|
||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppContext.setFirebaseCrashData();
|
||||
FirebaseCrashlytics.getInstance().recordException(e);
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
Toast.makeText(application, "发生闪退", 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);
|
||||
AppManager.runDebugCode(() -> errorWhile = false);
|
||||
// return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -148,11 +139,11 @@ public class NeverCrashUtils {
|
||||
writer.write("PhoneName=" + Build.BRAND + "\n");
|
||||
writer.write("Phone=" + Build.MODEL + "\n");
|
||||
writer.write("CPU=" + Arrays.toString(Build.SUPPORTED_ABIS) + "\n");
|
||||
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()) + "\n");
|
||||
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom() + "\n");
|
||||
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom() + "\n");
|
||||
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga() + "\n");
|
||||
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize() + "\n");
|
||||
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime())+ "\n");
|
||||
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom()+ "\n");
|
||||
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom()+ "\n");
|
||||
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga()+ "\n");
|
||||
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize()+ "\n");
|
||||
writer.write("UserData=" + SpUtil.getInstance().getStringValue(SpUtil.USER_INFO) + "\n");
|
||||
writer.write("[ERROR]");
|
||||
PrintWriter printWriter = new PrintWriter(writer);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -22,10 +21,9 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -50,7 +48,6 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DownloadUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LogUtil;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
@@ -104,22 +101,20 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
private int mVideoLastProgress;
|
||||
private boolean mForward;
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
setStatusBar();
|
||||
setContentView(R.layout.activity_launcher);
|
||||
//开屏
|
||||
AdjustEvent adjustEvent = new AdjustEvent("vjqk8g");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_screen", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_screen");
|
||||
mContext = this;
|
||||
mRoot = findViewById(R.id.root);
|
||||
mCover = findViewById(R.id.cover);
|
||||
@@ -145,7 +140,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
};
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +194,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
String adInfo = bean.getAdInfo();
|
||||
if (!TextUtils.isEmpty(adInfo)) {
|
||||
JSONObject obj = JSON.parseObject(adInfo);
|
||||
Log.i(TAG, "callback: " + adInfo);
|
||||
if (obj.getIntValue("switch") == 1) {
|
||||
List<AdBean> list = JSON.parseArray(obj.getString("list"), AdBean.class);
|
||||
if (list != null && list.size() > 0) {
|
||||
@@ -229,11 +222,8 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
}
|
||||
}else{
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -288,19 +278,8 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
if (getIntent().getStringExtra("activityUrl") != null) {
|
||||
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
|
||||
}
|
||||
if (mImageViewList != null && mImageViewList.size() > 0) {
|
||||
Log.i(TAG, "forwardMainActivity: " + mImageViewList.size());
|
||||
AdBean bean = mAdList.get(0);
|
||||
if (bean != null && bean.getAnimation() == 1) {
|
||||
intent.putExtra("ad_url", mAdList.get(0).getUrl());
|
||||
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle();
|
||||
LauncherActivity.this.startActivity(intent, bundle);
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -409,7 +388,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
imageView.setBackgroundColor(0xffffffff);
|
||||
imageView.setTransitionName("ad_img_" + i);
|
||||
mImageViewList.add(imageView);
|
||||
ImgLoader.display(mContext, mAdList.get(i).getUrl(), imageView);
|
||||
}
|
||||
@@ -543,7 +521,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
}
|
||||
} else if (e == TXLiveConstants.PLAY_ERR_NET_DISCONNECT ||
|
||||
e == TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND) {
|
||||
ToastUtil.show(mContext.getString(R.string.live_play_error));
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_play_error));
|
||||
checkUidAndToken();
|
||||
} else if (e == TXLiveConstants.PLAY_EVT_PLAY_PROGRESS) {
|
||||
int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS");
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.shayu.phonelive.utils;
|
||||
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -20,7 +17,6 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -35,12 +31,9 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.phonelive.AppContext;
|
||||
import com.shayu.phonelive.activity.LauncherActivity;
|
||||
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.main.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -59,7 +52,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = new NotificationChannel(channelID, channelNAME, level);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"), null);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"),null);
|
||||
manager.createNotificationChannel(channel);
|
||||
return channelID;
|
||||
} else {
|
||||
@@ -88,26 +81,6 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
@Override
|
||||
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
||||
if (AppContext.activityWeakReference != null) {
|
||||
Activity activity = AppContext.activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
||||
intent.putExtra("app_package", context.getPackageName());
|
||||
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
||||
// for Android 8 and above
|
||||
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
||||
activity.startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notificationMessage.getExtra() == null) {
|
||||
msg.setImg("" + notificationMessage.getSenderPortrait());
|
||||
msg.setTitle(notificationMessage.getPushTitle());
|
||||
@@ -226,7 +199,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -260,7 +233,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -303,7 +276,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.shayu.phonelive.utils;
|
||||
|
||||
import static java.text.DateFormat.DEFAULT;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class LogUtils {
|
||||
/**
|
||||
* 采集所有日志
|
||||
*/
|
||||
public static void start(Context context) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
String[] exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
|
||||
exec = new String[]{"logcat", "-v", "color", "UTC-8"};
|
||||
|
||||
Process process = Runtime.getRuntime().exec(exec);
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
String line;
|
||||
PrintWriter writer = null;
|
||||
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
|
||||
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
|
||||
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
|
||||
if (dir.listFiles() != null) {
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) {
|
||||
String fileName = file.getName().replace(".log", "").split("_")[1];
|
||||
if (isDelLog(fileName)) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File saveFile = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".log");
|
||||
FileOutputStream os = new FileOutputStream(saveFile, true);
|
||||
writer = new PrintWriter(os);
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
writer.append(line).write("\n");
|
||||
writer.flush();
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
bufferedReader.close();
|
||||
start(context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是要删除的日志
|
||||
**/
|
||||
private static boolean isDelLog(String time) {
|
||||
try {
|
||||
Calendar timeCal = Calendar.getInstance(Locale.CHINA);
|
||||
timeCal.setTime(Objects.requireNonNull(SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).parse(time)));
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE, -3);
|
||||
return calendar.after(timeCal);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">PDLIVE</string>
|
||||
<string name="leak_canary_test_class_name">assertk.Assert</string>
|
||||
</resources>
|
||||
@@ -86,7 +86,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
|
||||
TiUtils.unzip(file, targetDir);
|
||||
bean.setDownloadSuccess(mContext);
|
||||
} catch (Exception e) {
|
||||
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
|
||||
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
|
||||
bean.setDownloading(false);
|
||||
} finally {
|
||||
file.delete();
|
||||
@@ -103,7 +103,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
|
||||
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
|
||||
bean.setDownloading(false);
|
||||
notifyItemChanged(position, Constants.PAYLOAD);
|
||||
mLoadingTaskMap.remove(position);
|
||||
|
||||
@@ -11,7 +11,6 @@ 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/' }//埋点
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -23,7 +22,6 @@ buildscript {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
|
||||
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"
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +40,6 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ dependencies {
|
||||
api rootProject.ext.dependencies["ucrop"]
|
||||
|
||||
//腾讯定位,地图sdk
|
||||
// api files('libs/TencentLocationSdk_v6.2.5.3.jar')
|
||||
// api files('libs/TencentMapSDK_1.2.8.1.jar')
|
||||
api files('libs/TencentLocationSdk_v6.2.5.3.jar')
|
||||
api files('libs/TencentMapSDK_1.2.8.1.jar')
|
||||
|
||||
//下拉刷新上拉加载
|
||||
api rootProject.ext.dependencies["smartRefreshLayout"]
|
||||
@@ -147,6 +147,7 @@ dependencies {
|
||||
//谷歌支付
|
||||
//谷歌内购
|
||||
api 'com.android.billingclient:billing:5.0.0'
|
||||
implementation 'com.teprinciple:updateapputils:2.3.0'
|
||||
api 'com.squareup.picasso:picasso:2.5.2'
|
||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||
api files('libs/liteavsdk.jar')
|
||||
@@ -154,32 +155,31 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
|
||||
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.5.8' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.5.4' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
||||
//融云小视频模块
|
||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
||||
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
api 'com.facebook.android:facebook-android-sdk:15.0.1'
|
||||
implementation 'com.facebook.android:facebook-android-sdk:15.0.1'
|
||||
|
||||
api('com.twitter.sdk.android:twitter-core:3.1.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
api 'com.linecorp:linesdk:5.0.1'
|
||||
api 'com.adjust.sdk:adjust-android:4.30.1'
|
||||
api 'com.android.installreferrer:installreferrer:2.2'
|
||||
//Retrofit2库
|
||||
api 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
|
||||
//gson解析
|
||||
api 'com.squareup.retrofit2:converter-gson:2.3.0'//混淆
|
||||
implementation "io.reactivex.rxjava2:rxjava:2.2.3"//混淆
|
||||
api 'com.squareup.retrofit2:converter-gson:2.3.0'
|
||||
implementation "io.reactivex.rxjava2:rxjava:2.2.3"
|
||||
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.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.huawei.hms:push:4.0.2.300'
|
||||
@@ -188,22 +188,4 @@ dependencies {
|
||||
api 'com.github.princekin-f:EasyFloat:2.0.4'
|
||||
api files('libs/Msc.jar')
|
||||
|
||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||
|
||||
api 'com.github.shenbengit:PagerGridLayoutManager:1.1.7'
|
||||
//选择器
|
||||
api 'com.github.gzu-liyujiang.AndroidPicker:Common:4.1.11'
|
||||
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'
|
||||
}
|
||||
|
||||
BIN
common/libs/TencentLocationSdk_v6.2.5.3.jar
Normal file
BIN
common/libs/TencentMapSDK_1.2.8.1.jar
Normal file
BIN
common/libs/bdasr_3.0.8.2.jar
Normal file
@@ -1,15 +1,16 @@
|
||||
<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"
|
||||
@@ -31,23 +32,21 @@
|
||||
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"
|
||||
@@ -56,9 +55,6 @@
|
||||
<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,7 +7,6 @@ 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;
|
||||
@@ -20,7 +19,6 @@ 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;
|
||||
@@ -37,8 +35,6 @@ public class CommonAppConfig {
|
||||
public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY");
|
||||
//是否开启上报错误日志功能
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
@@ -80,6 +76,8 @@ public class CommonAppConfig {
|
||||
public static int alert_end_time = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
private CommonAppConfig() {
|
||||
|
||||
}
|
||||
@@ -148,7 +146,6 @@ public class CommonAppConfig {
|
||||
}
|
||||
return Constants.DIAMONDS;
|
||||
}
|
||||
|
||||
public String getGoldCoinName() {
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
@@ -184,19 +181,12 @@ 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();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -399,6 +389,7 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取App图标的资源id
|
||||
*/
|
||||
@@ -454,10 +445,9 @@ 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 {
|
||||
@@ -678,45 +668,40 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
@@ -24,6 +24,9 @@ import io.rong.push.RongPushClient;
|
||||
import io.rong.push.pushconfig.PushConfig;
|
||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
@@ -32,12 +35,13 @@ import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
public static CommonAppContext sInstance;
|
||||
public static WeakReference<Activity> activityWeakReference;
|
||||
private int mCount;
|
||||
private boolean mFront;//是否前台
|
||||
public static int jpushMsgNum;
|
||||
public static int Ingroup = 0;
|
||||
public static String lang = "chinese";
|
||||
public static FirebaseAnalytics mFirebaseAnalytics;
|
||||
public static AppEventsLogger logger;
|
||||
public static boolean isReady = false;
|
||||
public static String home_zdy_img_us = "";
|
||||
public static String home_zdy_img_cn = "";
|
||||
@@ -63,31 +67,33 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);
|
||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
||||
|
||||
|
||||
|
||||
logger = AppEventsLogger.newLogger(this);
|
||||
setAutoLogAppEventsEnabled(true);
|
||||
FacebookSdk.fullyInitialize();
|
||||
setAdvertiserIDCollectionEnabled(true);
|
||||
registerActivityLifecycleCallbacks();
|
||||
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if (locale.getLanguage().equals("zh")) {
|
||||
lang = "chinese";
|
||||
|
||||
} else {
|
||||
lang = "english";
|
||||
|
||||
}
|
||||
Log.i("lang", lang);
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if(locale.getLanguage().equals("en")){
|
||||
lang = "english";
|
||||
}else{
|
||||
lang = "chinese";
|
||||
}
|
||||
Log.i("lang",lang);
|
||||
|
||||
}
|
||||
|
||||
public static Activity getTopActivity() {
|
||||
return activityWeakReference.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
@@ -105,12 +111,11 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
activityWeakReference = new WeakReference<>(activity);
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
L.e("AppContext------->处于前台");
|
||||
ShortcutBadger.applyCount(activity, 0);
|
||||
jpushMsgNum = 0;
|
||||
ShortcutBadger.applyCount(activity,0);
|
||||
jpushMsgNum=0;
|
||||
CommonAppConfig.getInstance().setFrontGround(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class Constants {
|
||||
public static final String NEW_ENTER_ROOM = "enterRoom";
|
||||
|
||||
public static final String URL = "url";
|
||||
public static final String PAYLOAD = "payload";
|
||||
public static final String SEX = "sex";
|
||||
@@ -76,7 +74,7 @@ public class Constants {
|
||||
public static final String PAY_BUY_COIN_ALI = "Charge.getAliOrder";
|
||||
public static final String PAY_BUY_COIN_WX = "Charge.getWxOrder";
|
||||
|
||||
// public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
public static final String PACKAGE_NAME_WX = "com.tencent.mm";//微信的包名
|
||||
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
||||
public static final String LAT = "lat";
|
||||
@@ -132,8 +130,6 @@ public class Constants {
|
||||
public static final int LIVE_FUNC_MIC = 2013;//語音
|
||||
public static final int LIVE_FUNC_WKS = 2014;//語音
|
||||
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
||||
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
|
||||
public static final int LIVE_ROBOT = 2017;//机器人
|
||||
|
||||
//socket
|
||||
public static final String SOCKET_CONN = "conn";
|
||||
@@ -147,7 +143,6 @@ public class Constants {
|
||||
public static final String SOCKET_ALL_SERVER_NOTIFY = "AllServerNotify";//全服通知
|
||||
public static final String SOCKET_SEND_BARRAGE = "SendBarrage";//发弹幕
|
||||
public static final String SOCKET_LIVE_DRPK = "LiveDRPK";//多人PK
|
||||
public static final String SOCKET_LIVE_DRPK_RANDOM = "LiveRandomPK";//随机PK
|
||||
public static final String SOCKET_LEAVE_ROOM = "disconnect";//用户离开房间
|
||||
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
||||
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
||||
@@ -172,20 +167,7 @@ public class Constants {
|
||||
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
||||
public static final String AI_AUTOMATIC_SPEECH_LIVE = "aiAutomaticSpeechNew";//机器人助手
|
||||
public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
||||
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
|
||||
public static final String XYD_COMPLETE = "XydComplete";//心愿单完成通知
|
||||
public static final String WISH_LIST_PROGRESS = "wishListProgress";//心愿单进度通知
|
||||
public static final String LIVE_VOTE_CREATE = "createVote";
|
||||
public static final String LIVE_VOTE_UPDATE = "updateVote";
|
||||
public static final String LIVE_VOTE_END = "endVote";
|
||||
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";//炸金花
|
||||
@@ -200,7 +182,6 @@ public class Constants {
|
||||
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
||||
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
||||
|
||||
public static final int SOCKET_WHAT_CONN = 0;
|
||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||
|
||||
@@ -8,7 +8,7 @@ public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=59";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/portal/page/index/id/59";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -24,11 +23,9 @@ 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;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -50,7 +47,6 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
@@ -58,9 +54,8 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
create();
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
Intent intent=getIntent();
|
||||
if(intent!=null) {
|
||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||
if (isFullWindow) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
@@ -90,9 +85,6 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
protected void main() {
|
||||
|
||||
}
|
||||
protected void create(){
|
||||
|
||||
}
|
||||
|
||||
protected boolean isStatusBarWhite() {
|
||||
@@ -179,15 +171,11 @@ 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();
|
||||
@@ -370,16 +358,4 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrimMemory(int level) {
|
||||
super.onTrimMemory(level);
|
||||
Log.i("memory", "onTrimMemory: " + level);
|
||||
switch (level) {
|
||||
case TRIM_MEMORY_RUNNING_CRITICAL://内存低值危险值
|
||||
break;
|
||||
case TRIM_MEMORY_RUNNING_LOW://内存过低
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ public class ErrorActivity extends AbsActivity {
|
||||
ClipboardManager clipboardManager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", mErrorInfo);
|
||||
clipboardManager.setPrimaryClip(clipData);
|
||||
ToastUtil.show(mContext.getString(R.string.copy_success));
|
||||
ToastUtil.show(WordUtil.getString(R.string.copy_success));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
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.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
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.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
});
|
||||
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_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
|
||||
// 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) {
|
||||
if (event.getResults().size() > 0) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
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("Insufficient money ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆不够 ");
|
||||
}else {
|
||||
ToastUtil.show("Insufficient money ");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
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 androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@@ -22,41 +23,15 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
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.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
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;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
@@ -84,18 +59,19 @@ public class WebViewActivity extends AbsActivity {
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
L.e("H5--->" + url);
|
||||
Bus.getOn(this);
|
||||
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||
mWebView = findViewById(R.id.webView);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
mWebView = new WebView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
params.topMargin = DpUtil.dp2px(1);
|
||||
// mWebView.setLayoutParams(params);
|
||||
//mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
mWebView.setLayoutParams(params);
|
||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
rootView.addView(mWebView);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
@@ -113,22 +89,10 @@ public class WebViewActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setTitle(view.getTitle());
|
||||
}
|
||||
}, 500);
|
||||
|
||||
setTitle(view.getTitle());
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||
if (!navigationGestureEnabled(mContext)) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -172,12 +136,12 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
});
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||
@@ -186,7 +150,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
if (Constants.myIntoIndex == 2) {
|
||||
ft_title.setVisibility(View.GONE);
|
||||
@@ -202,6 +165,58 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//js调用原生
|
||||
public class JsInteration {
|
||||
@JavascriptInterface
|
||||
public void onBack() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void modifyMydata() {
|
||||
indexInto = 1;
|
||||
RouteUtil.forwardEditProfileActivity();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void reportUser(String touid) {
|
||||
RouteUtil.forwardLiveReportActivity(touid);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void gotoHomePage(String indexStr) {
|
||||
Log.e("tgasss","indexStr4"+indexStr);
|
||||
|
||||
if (!"".equals(indexStr) && indexStr != null) {
|
||||
int index = -1;
|
||||
if ("0".equals(indexStr)) {
|
||||
index = 0;
|
||||
} else if ("1".equals(indexStr)) {
|
||||
index = 1;
|
||||
} else if ("2".equals(indexStr)) {
|
||||
index = 2;
|
||||
} else if ("3".equals(indexStr)) {
|
||||
index = 3;
|
||||
}
|
||||
if (index != -1) {
|
||||
finish();
|
||||
Constants.isShowPage = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebView(String url) {
|
||||
Constants.isTitle = false;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebViewTitle(String url) {
|
||||
Constants.isTitle = true;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
}
|
||||
|
||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
||||
mValueCallback = valueCallback;
|
||||
@@ -213,7 +228,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
}
|
||||
intent.setType("image/*");
|
||||
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
|
||||
startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@@ -256,25 +271,21 @@ public class WebViewActivity extends AbsActivity {
|
||||
mValueCallback2 = null;
|
||||
}
|
||||
|
||||
private static boolean mIsLive = false;
|
||||
|
||||
public static void forward(Context context, String url, boolean addArgs, boolean isLive) {
|
||||
mIsLive = isLive;
|
||||
public static void forward(Context context, String url, boolean addArgs) {
|
||||
if (Constants.LoginKefu) {
|
||||
if (addArgs) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(context, WebViewActivity.class);
|
||||
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
intent.putExtra(Constants.URL, url);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void forward(Context context, String url, boolean isLive) {
|
||||
forward(context, url, true, isLive);
|
||||
public static void forward(Context context, String url) {
|
||||
forward(context, url, true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mWebView != null) {
|
||||
@@ -287,7 +298,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
Constants.myIntoIndex = 0;
|
||||
indexInto = 0;
|
||||
Constants.LoginKefu = true;
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -338,116 +348,11 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
|
||||
// new Handler().postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mWebView.reload();
|
||||
// }
|
||||
// }, 100);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
indexInto = event.getIndexInto();
|
||||
if (event.getMethod().equals("androidInviteShare")) {
|
||||
try {
|
||||
Class<?> clz = mContext.getClassLoader().loadClass("com.yunbao.share.ui.InvitePopDialog");
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(mContext);
|
||||
invite = invite.getClass().getMethod("setUrl", String.class).invoke(invite, event.getData());
|
||||
assert invite != null;
|
||||
invite.getClass().getMethod("showDialog").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "clickLogOffAccount")) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new HintCustomPopup(mContext,
|
||||
mContext.getString(R.string.delete_account1),
|
||||
mContext.getString(R.string.delete_account2))
|
||||
.setLiveOpenOk(mContext.getString(R.string.delete_account3))
|
||||
.setLiveOpenCancel(mContext.getString(R.string.cancel))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
LiveNetManager.get(mContext).
|
||||
setLogOff(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
|
||||
for (int i = 0; i < allActivityStacks.size(); i++) {
|
||||
if (!(allActivityStacks.get(i) instanceof WebViewActivity)) {
|
||||
allActivityStacks.get(i).finish();
|
||||
}
|
||||
}
|
||||
IMLoginManager.get(mContext).logout(mContext);
|
||||
CommonAppConfig.getInstance().clearLoginInfo();
|
||||
mContext.finish();
|
||||
RouteUtil.forwardLoginActivity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||
//看直播
|
||||
gotoLive(event.getLiveId());
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
|
||||
LiveHttpUtil.getLiveInfo(live_id, new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (mIsLive) {
|
||||
finish();
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
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.UserMedalModel;
|
||||
import com.yunbao.common.views.AchievementDetailsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AchievementDetailsAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalModel> dressInfo = new ArrayList<>();
|
||||
|
||||
public AchievementDetailsAdapter(List<UserMedalModel> dressInfo) {
|
||||
this.dressInfo = dressInfo;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_achievement_details, parent, false);
|
||||
return new AchievementDetailsViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
AchievementDetailsViewHolder achievementDetailsViewHolder = (AchievementDetailsViewHolder) holder;
|
||||
achievementDetailsViewHolder.showData(dressInfo.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dressInfo.size();
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class ChatChargeCoinAdapter extends RecyclerView.Adapter<ChatChargeCoinAd
|
||||
mList = list;
|
||||
mCoinName = CommonAppConfig.getInstance().getCoinName();
|
||||
mGoldCoinName = CommonAppConfig.getInstance().getGoldCoinName();
|
||||
mGiveString = context.getString(R.string.coin_give);
|
||||
mGiveString = WordUtil.getString(R.string.coin_give);
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
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.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
*/
|
||||
public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
|
||||
private final int GOOD_GIFTS = 1;
|
||||
private final int TASK_CENTER = 2;
|
||||
private final int FUN_GAMES = 3;
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private final int RECOMMEND = 5;
|
||||
private String liveId;
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
|
||||
public CustomDrawerPopupAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
|
||||
public CustomDrawerPopupAdapter setLiveId(String liveId) {
|
||||
this.liveId = liveId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupAdapter setList(List<AnchorRecommendItemModel> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
switch (viewType) {
|
||||
case GOOD_GIFTS:
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_good_gifts, parent, false);
|
||||
return new DrawerRecommendViewHolder(goodGiftsView);
|
||||
case TASK_CENTER:
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center, parent, false);
|
||||
return new DrawerTaskViewHolder(taskCenterView);
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_view, parent, false);
|
||||
return new FunGamesViewHolder(runGamesView);
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rights_interests, parent, false);
|
||||
return new RigtsInterestsViewHolder(rightsInterestsView);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof DrawerRecommendViewHolder) {
|
||||
DrawerRecommendViewHolder recommendViewHolder = (DrawerRecommendViewHolder) holder;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof DrawerTaskViewHolder) {
|
||||
DrawerTaskViewHolder taskViewHolder = (DrawerTaskViewHolder) holder;
|
||||
taskViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof FunGamesViewHolder) {
|
||||
FunGamesViewHolder funGamesViewHolder = (FunGamesViewHolder) holder;
|
||||
funGamesViewHolder.setData(infoModels.get(position));
|
||||
} 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;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
recommendViewHolder.updateData(list);
|
||||
|
||||
recommendViewHolder.setListener(new RecommendViewHolder.RecommendViewListener() {
|
||||
@Override
|
||||
public void changeOneBatch() {
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend("9", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
@Override
|
||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||
|
||||
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
|
||||
int userIndex = -1;
|
||||
for (int i = 0; i < models.size(); i++) {
|
||||
if (TextUtils.equals(models.get(i).getUid(), liveId)) {
|
||||
userIndex = i;
|
||||
}
|
||||
}
|
||||
if (userIndex != -1) {
|
||||
models.remove(userIndex);
|
||||
}
|
||||
recommendViewHolder.updateData(models);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(mContext.getString(R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
if (listener != null) {
|
||||
listener.goToLive(model);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return infoModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
CustomSidebarInfoModel model = infoModels.get(position);
|
||||
switch (model.getType()) {
|
||||
case "1":
|
||||
return GOOD_GIFTS;
|
||||
case "2":
|
||||
return TASK_CENTER;
|
||||
case "3":
|
||||
return FUN_GAMES;
|
||||
case "4":
|
||||
return RIGHTS_INTERESTS;
|
||||
case "5":
|
||||
return RECOMMEND;
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
|
||||
infoModels.clear();
|
||||
infoModels.addAll(mInfoModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private CustomDrawerListener listener;
|
||||
|
||||
public CustomDrawerPopupAdapter setListener(CustomDrawerListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface CustomDrawerListener {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
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.DrawerRecommendChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerRecommendAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerRecommendAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_drawer_recommend_child, parent, false);
|
||||
return new DrawerRecommendChildViewHolder(goodGiftsView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerRecommendChildViewHolder childViewHolder = (DrawerRecommendChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
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.DrawerTaskChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerTaskAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerTaskAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center_child, parent, false);
|
||||
return new DrawerTaskChildViewHolder(taskCenterView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerTaskChildViewHolder taskChildViewHolder = (DrawerTaskChildViewHolder) holder;
|
||||
taskChildViewHolder.setData(child.get(position), position);
|
||||
taskChildViewHolder.setListener(new DrawerTaskChildViewHolder.DrawerTaskChildListener() {
|
||||
@Override
|
||||
public void giftSuccess(CustomSidebarChildModel model, int index) {
|
||||
//将领取的任务移动至任务列表尾部
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(false).setRefresh(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (child.size()>3){
|
||||
return 3;
|
||||
}else {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
// for (CustomSidebarChildModel childModel : mChild) {
|
||||
// if (TextUtils.equals("1", childModel.getIsShow())) {
|
||||
// child.add(childModel);
|
||||
// }
|
||||
// }
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public FunGamesAdapter(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_fun_games_child_view, parent, false);
|
||||
return new FunGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
FunGamesChildViewHolder childViewHolder = (FunGamesChildViewHolder) 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();
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftAlreadyWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftAlreadyWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
private boolean sbWy;//是否正在直播
|
||||
|
||||
public GiftAlreadyWallAdapter(boolean sbWy) {
|
||||
this.sbWy = sbWy;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_already_wall, parent, false);
|
||||
return new GiftAlreadyWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftAlreadyWallViewHolder withoutWallViewHolder = (GiftAlreadyWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position), sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
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.GiftQuantityModel;
|
||||
import com.yunbao.common.views.GiftNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftNumberAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftQuantityModel> giftQuantityModels;
|
||||
|
||||
public GiftNumberAdapter(List<GiftQuantityModel> giftQuantityModels) {
|
||||
this.giftQuantityModels = giftQuantityModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_number, parent, false);
|
||||
return new GiftNumber(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftNumber giftNumber = (GiftNumber) holder;
|
||||
giftNumber.showData(giftQuantityModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftQuantityModels.size();
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftWithoutWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWithoutWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_without_wall, parent, false);
|
||||
return new GiftWithoutWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftWithoutWallViewHolder withoutWallViewHolder = (GiftWithoutWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.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;
|
||||
import com.yunbao.common.views.WeekWishItemViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishAdapter extends RecyclerView.Adapter {
|
||||
private int type = 0;
|
||||
private List<WishModel> wishList = new ArrayList<>();
|
||||
|
||||
public void addData(List<WishModel> wishModelList, int type) {
|
||||
this.type = type;
|
||||
wishList.clear();
|
||||
wishList.addAll(wishModelList);
|
||||
wishList.add(null);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addGiftListModel(WishModel model) {
|
||||
switch (type) {
|
||||
case 1:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
break;
|
||||
case 2:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
break;
|
||||
case 3:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
break;
|
||||
case 4:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
break;
|
||||
}
|
||||
boolean isAdd = false;
|
||||
for (int i = 0; i < wishList.size(); i++) {
|
||||
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(WordUtil.isNewZh()?"重複添加禮物":"Too many gifts");
|
||||
isAdd = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!isAdd) {
|
||||
wishList.add(0, model);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<WishModel> getWishList() {
|
||||
|
||||
return wishList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (type == 1) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_day_wish, parent, false);
|
||||
return new DayWishItemViewHolder(dayWish);
|
||||
} else if (type == 2) {
|
||||
View weekWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_week_wish, parent, false);
|
||||
return new WeekWishItemViewHolder(weekWish);
|
||||
} else if (type == 3) {
|
||||
View lunarWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_lunar_wish, parent, false);
|
||||
return new LunarWishItemViewHolder(lunarWish);
|
||||
} else {
|
||||
View seasonalWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_seasonal_wish, parent, false);
|
||||
return new SeasonalWishItemViewHolder(seasonalWish);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (position == wishList.size()) return;
|
||||
if (holder instanceof DayWishItemViewHolder) {
|
||||
DayWishItemViewHolder dayWishItemViewHolder = (DayWishItemViewHolder) holder;
|
||||
dayWishItemViewHolder.steDayWishData(wishList.get(position), position, new DayWishItemViewHolder.DayWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof WeekWishItemViewHolder) {
|
||||
WeekWishItemViewHolder weekWishItemViewHolder = (WeekWishItemViewHolder) holder;
|
||||
weekWishItemViewHolder.steWeekWishData(wishList.get(position), position, new WeekWishItemViewHolder.WeekWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof LunarWishItemViewHolder) {
|
||||
LunarWishItemViewHolder lunarWishItemViewHolder = (LunarWishItemViewHolder) holder;
|
||||
lunarWishItemViewHolder.steLunarWishData(wishList.get(position), position, new LunarWishItemViewHolder.LunarWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof SeasonalWishItemViewHolder) {
|
||||
SeasonalWishItemViewHolder seasonalWishItemViewHolder = (SeasonalWishItemViewHolder) holder;
|
||||
seasonalWishItemViewHolder.steSeasonalWish(wishList.get(position), position, new SeasonalWishItemViewHolder.SeasonalWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return wishList.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
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.GiftListModel;
|
||||
import com.yunbao.common.event.LiveNewWishGiftEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.LiveNewWishGiftViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishGiftAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftListModel> giftListModels = new ArrayList<>();
|
||||
|
||||
public LiveNewWishGiftAdapter(List<GiftListModel> giftListModels) {
|
||||
this.giftListModels = giftListModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gitf_wish, parent, false);
|
||||
return new LiveNewWishGiftViewHolder(dayWish);
|
||||
}
|
||||
|
||||
private int index = -1;
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
LiveNewWishGiftViewHolder wishGiftViewHolder = (LiveNewWishGiftViewHolder) holder;
|
||||
wishGiftViewHolder.setData(giftListModels.get(position), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
index = position;
|
||||
notifyDataSetChanged();
|
||||
Bus.get().post(new LiveNewWishGiftEvent().setModel(giftListModels.get(position)));
|
||||
}
|
||||
});
|
||||
wishGiftViewHolder.onSelect(index == position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftListModels.size();
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishListAdapter extends FragmentStateAdapter {
|
||||
private List<Fragment> list = new ArrayList<>();
|
||||
|
||||
public LiveNewWishListAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> list) {
|
||||
super(fragmentActivity);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
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.ListInfoMessageModel;
|
||||
import com.yunbao.common.views.LiveSystemMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主播消息中心适配器
|
||||
*/
|
||||
public class LiveSystemMessageAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private LayoutInflater mInflater;
|
||||
private List<ListInfoMessageModel> listInfoMessageModels = new ArrayList<>();
|
||||
|
||||
public LiveSystemMessageAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSystemMessageViewHolder(mInflater.inflate(R.layout.view_live_system_message, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSystemMessageViewHolder messageViewHolder = (LiveSystemMessageViewHolder) holder;
|
||||
messageViewHolder.setViewData(listInfoMessageModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listInfoMessageModels.size();
|
||||
}
|
||||
|
||||
public void addData(List<ListInfoMessageModel> list) {
|
||||
listInfoMessageModels.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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.UserMedalListModel;
|
||||
import com.yunbao.common.views.MedalAchievementViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MedalAchievementAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalListModel> medalData = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_medal_achievement, parent, false);
|
||||
return new MedalAchievementViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MedalAchievementViewHolder achievementViewHolder = (MedalAchievementViewHolder) holder;
|
||||
achievementViewHolder.showData(medalData.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return medalData.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<UserMedalListModel> mGiftWall) {
|
||||
|
||||
medalData.clear();
|
||||
medalData.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.MonthGiftNamingViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MonthGiftNamingAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_month_gift_naming, parent, false);
|
||||
return new MonthGiftNamingViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MonthGiftNamingViewHolder monthGiftNamingViewHolder = (MonthGiftNamingViewHolder) holder;
|
||||
monthGiftNamingViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||