Compare commits
186 Commits
6.4.7
...
live_ancho
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea9807dcdc | ||
| d6eddeb130 | |||
| bf4710470f | |||
| 5d2a246916 | |||
| cca8f43f61 | |||
|
|
1d66a9b7fb | ||
|
|
c1c4a7a38b | ||
|
|
b8a91a85e4 | ||
|
|
7cb7258210 | ||
|
|
8d823f7a07 | ||
| 6d458d0c7f | |||
| eaed7e448b | |||
| b2f779f58a | |||
| 79ded6bff4 | |||
|
|
d86e16c9f5 | ||
| f2cff3b93f | |||
|
|
e97a4e607c | ||
| 4d86317ec8 | |||
| d36ece4c54 | |||
| 11cf971514 | |||
|
|
3d5ac05d36 | ||
|
|
d3268e57bc | ||
|
|
3549c25cca | ||
|
|
859f54b1e1 | ||
| a808cd13c0 | |||
|
|
cd0067d77b | ||
|
|
894e264fb3 | ||
| 5dd5b2e0ea | |||
|
|
8f58c485c8 | ||
|
|
11e809a978 | ||
|
|
20aa6002f8 | ||
|
|
ffcb0e8790 | ||
|
|
3de7160538 | ||
|
|
1e595ec526 | ||
| 344bbcdfc8 | |||
| c1aeaa0e1b | |||
| e108494bd5 | |||
| bc0e698a77 | |||
| b82c87d5d6 | |||
| 80fe5271f6 | |||
| 944d703e36 | |||
| 911869ed9f | |||
| 543336af99 | |||
| 5d7cff6707 | |||
| 1bbab7ac9e | |||
|
|
16592aaecb | ||
|
|
3de9ff57c3 | ||
| e932238fc2 | |||
|
|
df436bbe1e | ||
|
|
49bd97f646 | ||
| 731f941298 | |||
|
|
c21df55c06 | ||
| 9acbc60db2 | |||
| 5f2dda021a | |||
| 1244010c3d | |||
| 7226d54277 | |||
| eaafcdd444 | |||
| 9f9c02b7e7 | |||
|
|
7bffdda6b9 | ||
| 50d01ccd92 | |||
|
|
420573736d | ||
|
|
aca98cb7e6 | ||
|
|
f26fb83fec | ||
| 1ad9effe91 | |||
| 418d306d72 | |||
| 3606815a41 | |||
| 518e57ee44 | |||
| 872245c9c9 | |||
| 749f756d58 | |||
|
|
a22dfb6214 | ||
|
|
652e569e2b | ||
| d480986485 | |||
| 2e6efc69e8 | |||
| e2761049e5 | |||
| ee6a4288b0 | |||
| 7070f5c1b4 | |||
| cc4cc2f746 | |||
| 93e2a8af02 | |||
| 207811c41d | |||
|
|
8730a6396f | ||
| 05ff51bd48 | |||
| 1904eeb3ba | |||
|
|
70126171c6 | ||
|
|
ee084d6f33 | ||
| bacf4fd32f | |||
|
|
eaae58db31 | ||
|
|
13146595bf | ||
| b3083cdd18 | |||
| cf85870810 | |||
| 182e46799a | |||
| 27bd65d3da | |||
|
|
9fcc04cef2 | ||
| a1f07b8c20 | |||
|
|
65efa88d4a | ||
| 01a2d66585 | |||
| 098e9bf6ba | |||
| ddf56963bb | |||
|
|
eadcaf826b | ||
|
|
36248eaeef | ||
| 04496c3888 | |||
| 494aa6b52d | |||
|
|
4bb51506e3 | ||
|
|
112bec58df | ||
| 0b7a3cc50e | |||
| 9f517199fe | |||
| 2393a53466 | |||
| 80993c7d2d | |||
| 8c0a23d39a | |||
| a0949f0903 | |||
|
|
42052b7465 | ||
| a37a92e211 | |||
|
|
c3ddc62b95 | ||
|
|
0a3409f98a | ||
|
|
d26a687385 | ||
| 2f413e260e | |||
| 6fcb194995 | |||
| 7cea6b4f8d | |||
| 16d02c6936 | |||
| 289c93d824 | |||
| 8f99d68b6f | |||
| e0d7137727 | |||
|
|
7a9ed22ec9 | ||
|
|
af58ec755d | ||
| 4ad2020b57 | |||
| 1db24dae4b | |||
| 76055543c3 | |||
| a1d95d6a94 | |||
| 2143e3eb77 | |||
|
|
4a0901ea93 | ||
|
|
488bee514d | ||
|
|
bafea09e44 | ||
|
|
54923304dc | ||
|
|
8b357233c2 | ||
| 06b5f99930 | |||
| 0b5598346e | |||
|
|
d81e6b9f04 | ||
| 87e3dddac5 | |||
| 55f3ac577b | |||
| 0c053a028e | |||
| df36529619 | |||
| 7555510d94 | |||
|
|
2e986db686 | ||
| 660853d5be | |||
| 956bef4b90 | |||
|
|
43c22fca7c | ||
| 5db84c1e61 | |||
| 00c3e0cb77 | |||
| f4b6c46075 | |||
| 181bb5b445 | |||
|
|
90f58054fa | ||
| 137dbc72d8 | |||
|
|
a7cef3c6f8 | ||
| 339d460c0f | |||
| c8ba78f39b | |||
|
|
d31af73479 | ||
|
|
874800c19d | ||
|
|
404d45893f | ||
| ed6e95f380 | |||
| c4cfa0becd | |||
|
|
a069562bbe | ||
|
|
9158424a25 | ||
| 7488143037 | |||
| 99938f6ed6 | |||
|
|
1bde99f6c9 | ||
|
|
e3a9a037ba | ||
| b1d342f791 | |||
| 7639a70887 | |||
| f690cf0b62 | |||
| 4dcb12eb4f | |||
|
|
af5d8dbf19 | ||
| 9cd1638d55 | |||
| dd1570c10e | |||
| 3af7ca5d94 | |||
| 2d2cc21e15 | |||
| f872029c9d | |||
| 6198489dd4 | |||
| cce8e43c24 | |||
| cae0599307 | |||
|
|
2c6e88500a | ||
| efc20c644a | |||
| bdc43baaa8 | |||
| dc529b6640 | |||
|
|
488cc192b2 | ||
|
|
269f6c64a9 | ||
|
|
51186169ca | ||
|
|
325e57d1d5 |
@@ -299,7 +299,7 @@
|
|||||||
<string name="beautify_hip_slim">Hip</string>
|
<string name="beautify_hip_slim">Hip</string>
|
||||||
<string name="beautify_head_slim">Head shrink</string>
|
<string name="beautify_head_slim">Head shrink</string>
|
||||||
<string name="beautify_leg_thin_slim">Thin leg</string>
|
<string name="beautify_leg_thin_slim">Thin leg</string>
|
||||||
<string name="toast_not_detect_body">No body tracking</string>
|
<string name="toast_not_detect_body">No message tracking</string>
|
||||||
<string name="pta_human_full_body">Body driver</string>
|
<string name="pta_human_full_body">Body driver</string>
|
||||||
<string name="pta_human_half_body">Bust driver</string>
|
<string name="pta_human_half_body">Bust driver</string>
|
||||||
|
|
||||||
|
|||||||
@@ -278,17 +278,17 @@ public class AppContext extends CommonAppContext {
|
|||||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//闪退后finish所有Activity并且杀死进程
|
//闪退后finish所有Activity并且杀死进程
|
||||||
for (WeakReference<Activity> activity : activities) {
|
/* for (WeakReference<Activity> activity : activities) {
|
||||||
if (activity != null && activity.get() != null) {
|
if (activity != null && activity.get() != null) {
|
||||||
activity.get().finish();
|
activity.get().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Process.killProcess(Process.myPid());
|
*//* Process.killProcess(Process.myPid());
|
||||||
System.exit(0);*/
|
System.exit(0);*//*
|
||||||
setFirebaseCrashData();
|
setFirebaseCrashData();
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}, 100);
|
}, 100);*/
|
||||||
})
|
})
|
||||||
.setUncaughtCrashHandler((t, e) -> {
|
.setUncaughtCrashHandler((t, e) -> {
|
||||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ public class NeverCrashUtils {
|
|||||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
|
Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -89,20 +89,23 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
|||||||
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||||
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||||
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
||||||
Activity activity = AppContext.activityWeakReference.get();
|
if (AppContext.activityWeakReference != null) {
|
||||||
if (activity != null) {
|
Activity activity = AppContext.activityWeakReference.get();
|
||||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
if (activity != null) {
|
||||||
@Override
|
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
@Override
|
||||||
Intent intent = new Intent();
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
Intent intent = new Intent();
|
||||||
intent.putExtra("app_package", context.getPackageName());
|
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
||||||
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
intent.putExtra("app_package", context.getPackageName());
|
||||||
// for Android 8 and above
|
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
||||||
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
// for Android 8 and above
|
||||||
activity.startActivity(intent);
|
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
||||||
}
|
activity.startActivity(intent);
|
||||||
});
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (notificationMessage.getExtra() == null) {
|
if (notificationMessage.getExtra() == null) {
|
||||||
|
|||||||
@@ -189,8 +189,5 @@ dependencies {
|
|||||||
api files('libs/Msc.jar')
|
api files('libs/Msc.jar')
|
||||||
|
|
||||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||||
//app-updater
|
|
||||||
api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3'
|
|
||||||
//app-dialog
|
|
||||||
api 'com.github.jenly1314.AppUpdater:app-dialog:1.1.3'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class Constants {
|
|||||||
public static final int LIVE_FUNC_WKS = 2014;//語音
|
public static final int LIVE_FUNC_WKS = 2014;//語音
|
||||||
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
||||||
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
|
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
|
||||||
|
public static final int LIVE_ROBOT= 2017;//机器人
|
||||||
|
|
||||||
//socket
|
//socket
|
||||||
public static final String SOCKET_CONN = "conn";
|
public static final String SOCKET_CONN = "conn";
|
||||||
@@ -171,6 +172,7 @@ public class Constants {
|
|||||||
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
||||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
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 STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||||
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
||||||
@@ -189,6 +191,7 @@ public class Constants {
|
|||||||
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
||||||
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
||||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
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_CONN = 0;
|
||||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
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.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.views.RobotMessageViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RobotMessageAdapter extends RecyclerView.Adapter {
|
||||||
|
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View robotMessageView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||||
|
return new RobotMessageViewHolder(robotMessageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
RobotMessageViewHolder messageViewHolder = (RobotMessageViewHolder) holder;
|
||||||
|
messageViewHolder.setData(messageList.get(position), position + 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return messageList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||||
|
messageList.clear();
|
||||||
|
messageList.addAll(messages);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除数据
|
||||||
|
public void removeData(int position) {
|
||||||
|
messageList.remove(position);
|
||||||
|
//删除动画
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
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.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.views.RobotSayHelloViewHoler;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RobotSayHelloAdapter extends RecyclerView.Adapter {
|
||||||
|
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||||
|
return new RobotSayHelloViewHoler(robotSayHelloView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
RobotSayHelloViewHoler robotSayHelloViewHoler = (RobotSayHelloViewHoler) holder;
|
||||||
|
robotSayHelloViewHoler.setData(messageList.get(position), position + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return messageList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||||
|
messageList.clear();
|
||||||
|
messageList.addAll(messages);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除数据
|
||||||
|
public void removeData(int position) {
|
||||||
|
messageList.remove(position);
|
||||||
|
//删除动画
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -475,6 +476,9 @@ public class EnterRoomInfoModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIsconnection() {
|
public String getIsconnection() {
|
||||||
|
if(StringUtil.isEmpty(isconnection)){
|
||||||
|
isconnection="0";
|
||||||
|
}
|
||||||
return isconnection;
|
return isconnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public class EnterRoomNewModel extends BaseModel {
|
|||||||
private String isUseHotCard = "";//是否使用热度卡
|
private String isUseHotCard = "";//是否使用热度卡
|
||||||
@SerializedName("liveRoomActivity")
|
@SerializedName("liveRoomActivity")
|
||||||
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
||||||
|
@SerializedName("clarityType")
|
||||||
|
private int clarityType;
|
||||||
|
|
||||||
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
||||||
return liveRoomActivityModels;
|
return liveRoomActivityModels;
|
||||||
@@ -109,4 +111,28 @@ public class EnterRoomNewModel extends BaseModel {
|
|||||||
this.isUseHotCard = isUseHotCard;
|
this.isUseHotCard = isUseHotCard;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getClarityType() {
|
||||||
|
return clarityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClarityType(int clarityType) {
|
||||||
|
this.clarityType = clarityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "EnterRoomNewModel{" +
|
||||||
|
"liveInfo=" + liveInfo +
|
||||||
|
", enterRoomInfo=" + enterRoomInfo +
|
||||||
|
", rankHour=" + rankHour +
|
||||||
|
", newPeopleTask=" + newPeopleTask +
|
||||||
|
", wishList=" + wishList +
|
||||||
|
", guardUserAvatar=" + guardUserAvatar +
|
||||||
|
", activeList=" + activeList +
|
||||||
|
", isUseHotCard='" + isUseHotCard + '\'' +
|
||||||
|
", liveRoomActivityModels=" + liveRoomActivityModels +
|
||||||
|
", clarityType=" + clarityType +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
|
||||||
public class HttpCallbackModel extends BaseModel{
|
public class HttpCallbackModel extends BaseModel {
|
||||||
private int code;
|
private int code;
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
|
public HttpCallbackModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpCallbackModel(int code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class ListInfoMessageModel extends BaseModel {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("title")
|
||||||
|
private String title;
|
||||||
|
@SerializedName("banner")
|
||||||
|
private String banner;
|
||||||
|
@SerializedName("content")
|
||||||
|
private String content;
|
||||||
|
@SerializedName("link")
|
||||||
|
private String link;
|
||||||
|
@SerializedName("addtime")
|
||||||
|
private String addtime;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBanner() {
|
||||||
|
return banner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setBanner(String banner) {
|
||||||
|
this.banner = banner;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddtime() {
|
||||||
|
return addtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setAddtime(String addtime) {
|
||||||
|
this.addtime = addtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会话列表展示时间
|
||||||
|
*/
|
||||||
|
public String getLastDate(String type) {
|
||||||
|
if (!TextUtils.isEmpty(addtime) && !TextUtils.equals(addtime, "0")) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
|
Date currenTimeZone;
|
||||||
|
if (TextUtils.equals(type, "-1")) {
|
||||||
|
currenTimeZone = new Date(Long.parseLong(addtime));
|
||||||
|
} else {
|
||||||
|
currenTimeZone = new Date(Long.parseLong(addtime + "000"));
|
||||||
|
}
|
||||||
|
return sdf.format(currenTimeZone);
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
138
common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人bean
|
||||||
|
*/
|
||||||
|
public class LiveAiRobotBean extends BaseModel {
|
||||||
|
@SerializedName("ai_name")
|
||||||
|
private String name;
|
||||||
|
@SerializedName("ai_state")
|
||||||
|
private int status;//1=开 0=关
|
||||||
|
@SerializedName("ai_time")
|
||||||
|
private int time;
|
||||||
|
@SerializedName("ai_sayhi")
|
||||||
|
private int autoSeyHiNumber;// 自动打招呼已配置数量
|
||||||
|
@SerializedName("ai_gz")
|
||||||
|
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||||
|
|
||||||
|
public LiveAiRobotBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(int time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAutoSeyHiNumber() {
|
||||||
|
return autoSeyHiNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoSeyHiNumber(int autoSeyHiNumber) {
|
||||||
|
this.autoSeyHiNumber = autoSeyHiNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAutoRequestFollowNumber() {
|
||||||
|
return autoRequestFollowNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoRequestFollowNumber(int autoRequestFollowNumber) {
|
||||||
|
this.autoRequestFollowNumber = autoRequestFollowNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveAiRobotBean{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", status=" + status +
|
||||||
|
", time=" + time +
|
||||||
|
", autoSeyHiNumber=" + autoSeyHiNumber +
|
||||||
|
", autoRequestFollowNumber=" + autoRequestFollowNumber +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人消息
|
||||||
|
*/
|
||||||
|
public static class Message {
|
||||||
|
public static final int TYPE_SAY_HI=1;//自动打招呼
|
||||||
|
public static final int TYPE_FOLLOW=3;//自动求关注
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private int uid;
|
||||||
|
@SerializedName("type")
|
||||||
|
private int type;
|
||||||
|
@SerializedName("content")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
public Message() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Message{" +
|
||||||
|
"id=" + id +
|
||||||
|
", uid=" + uid +
|
||||||
|
", type=" + type +
|
||||||
|
", content='" + content + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -493,6 +493,44 @@ public class LiveBean implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "uid: " + uid + " , userNiceName: " + userNiceName + " ,playUrl: " + pull;
|
return "LiveBean{" +
|
||||||
|
"uid='" + uid + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", title='" + title + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", stream='" + stream + '\'' +
|
||||||
|
", pull='" + pull + '\'' +
|
||||||
|
", thumb='" + thumb + '\'' +
|
||||||
|
", nums='" + nums + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", distance='" + distance + '\'' +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", type=" + type +
|
||||||
|
", typeVal='" + typeVal + '\'' +
|
||||||
|
", goodNum='" + goodNum + '\'' +
|
||||||
|
", gameAction=" + gameAction +
|
||||||
|
", game='" + game + '\'' +
|
||||||
|
", islive='" + islive + '\'' +
|
||||||
|
", isTop='" + isTop + '\'' +
|
||||||
|
", pk_avatar_thumb='" + pk_avatar_thumb + '\'' +
|
||||||
|
", landscape=" + landscape +
|
||||||
|
", hot_num='" + hot_num + '\'' +
|
||||||
|
", content_pic_size_one='" + content_pic_size_one + '\'' +
|
||||||
|
", content_pic_size_two='" + content_pic_size_two + '\'' +
|
||||||
|
", content_pic_size_three='" + content_pic_size_three + '\'' +
|
||||||
|
", is_week='" + is_week + '\'' +
|
||||||
|
", img='" + img + '\'' +
|
||||||
|
", url='" + url + '\'' +
|
||||||
|
", drpk_status='" + drpk_status + '\'' +
|
||||||
|
", is_rong=" + is_rong +
|
||||||
|
", isattention='" + isattention + '\'' +
|
||||||
|
", recommendCardtype='" + recommendCardtype + '\'' +
|
||||||
|
", recommendCardIconSizeTwo='" + recommendCardIconSizeTwo + '\'' +
|
||||||
|
", recommendCardIconSizeThree='" + recommendCardIconSizeThree + '\'' +
|
||||||
|
", params=" + params +
|
||||||
|
", mWeekList=" + mWeekList +
|
||||||
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播数据
|
||||||
|
*/
|
||||||
|
public class LiveDataInfoModel extends BaseModel{
|
||||||
|
@SerializedName("totalCoin")
|
||||||
|
private long totalCoin;//钻石数量
|
||||||
|
@SerializedName("totalGold")
|
||||||
|
private long totalGold;//金币数量
|
||||||
|
@SerializedName("acceptNum")
|
||||||
|
private long acceptNum;//送礼人数
|
||||||
|
@SerializedName("enterNum")
|
||||||
|
private long enterNum;//进场人数
|
||||||
|
@SerializedName("attentionNum")
|
||||||
|
private long attentionNum;//关注人数
|
||||||
|
@SerializedName("fanGroupNum")
|
||||||
|
private long fanGroupNum;//粉丝团人数
|
||||||
|
@SerializedName("attentionNumRate")
|
||||||
|
private double attentionNumRate;//关注转化率
|
||||||
|
@SerializedName("fanGroupNumRate")
|
||||||
|
private double fanGroupNumRate;//粉丝团转化率
|
||||||
|
|
||||||
|
public LiveDataInfoModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalCoin() {
|
||||||
|
return totalCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCoin(long totalCoin) {
|
||||||
|
this.totalCoin = totalCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalGold() {
|
||||||
|
return totalGold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalGold(long totalGold) {
|
||||||
|
this.totalGold = totalGold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAcceptNum() {
|
||||||
|
return acceptNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAcceptNum(long acceptNum) {
|
||||||
|
this.acceptNum = acceptNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getEnterNum() {
|
||||||
|
return enterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterNum(long enterNum) {
|
||||||
|
this.enterNum = enterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAttentionNum() {
|
||||||
|
return attentionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttentionNum(long attentionNum) {
|
||||||
|
this.attentionNum = attentionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFanGroupNum() {
|
||||||
|
return fanGroupNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFanGroupNum(long fanGroupNum) {
|
||||||
|
this.fanGroupNum = fanGroupNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAttentionNumRate() {
|
||||||
|
return attentionNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttentionNumRate(double attentionNumRate) {
|
||||||
|
this.attentionNumRate = attentionNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getFanGroupNumRate() {
|
||||||
|
return fanGroupNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFanGroupNumRate(double fanGroupNumRate) {
|
||||||
|
this.fanGroupNumRate = fanGroupNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveDataInfoModel{" +
|
||||||
|
"totalCoin=" + totalCoin +
|
||||||
|
", totalGold=" + totalGold +
|
||||||
|
", acceptNum=" + acceptNum +
|
||||||
|
", enterNum=" + enterNum +
|
||||||
|
", attentionNum=" + attentionNum +
|
||||||
|
", fanGroupNum=" + fanGroupNum +
|
||||||
|
", attentionNumRate=" + attentionNumRate +
|
||||||
|
", fanGroupNumRate=" + fanGroupNumRate +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.yunbao.live.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LiveStetUpStatusModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("wishList")
|
||||||
|
private String wishList;
|
||||||
|
@SerializedName("ai_state")
|
||||||
|
private String aiState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wishList 1设置 0 未设置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getWishListState() {
|
||||||
|
return TextUtils.equals(wishList, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* aiState 1打开机器人 0 未设置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getAiStateState() {
|
||||||
|
return TextUtils.equals(aiState, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishList() {
|
||||||
|
return wishList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveStetUpStatusModel setWishList(String wishList) {
|
||||||
|
this.wishList = wishList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAiState() {
|
||||||
|
return aiState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveStetUpStatusModel setAiState(String aiState) {
|
||||||
|
this.aiState = aiState;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
259
common/src/main/java/com/yunbao/common/bean/LiveTaskModel.java
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播任务
|
||||||
|
*/
|
||||||
|
public class LiveTaskModel extends BaseModel {
|
||||||
|
public static final int TASK_TYPE_TIP = 0;
|
||||||
|
public static final int TASK_TYPE_ITEM = 1;
|
||||||
|
|
||||||
|
int type;
|
||||||
|
@SerializedName("new")
|
||||||
|
NewUser user;
|
||||||
|
@SerializedName("list")
|
||||||
|
List<List<Task>> list;
|
||||||
|
|
||||||
|
public LiveTaskModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewUser getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(NewUser user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<Task>> getList() {
|
||||||
|
if (user != null && user.isNew()) {
|
||||||
|
for (List<Task> tasks : list) {
|
||||||
|
for (Task task : tasks) {
|
||||||
|
task.isNewUser = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setList(List<List<Task>> list) {
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveTaskModel{" +
|
||||||
|
"type=" + type +
|
||||||
|
", user=" + user +
|
||||||
|
", list=" + list +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class NewUser {
|
||||||
|
@SerializedName("isNew")
|
||||||
|
private int isNew;
|
||||||
|
@SerializedName("endTime")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
public NewUser() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNew() {
|
||||||
|
return isNew == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNew(int aNew) {
|
||||||
|
isNew = aNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
if (!StringUtil.isEmpty(endTime)) {
|
||||||
|
endTime = WordUtil.getString(R.string.live_task_new_user_timer) + new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault()).format(new Date(Long.parseLong(endTime) * 1000));
|
||||||
|
}
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NewUser{" +
|
||||||
|
"isNew=" + isNew +
|
||||||
|
", endTime='" + endTime + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Task implements Serializable {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("type")
|
||||||
|
private int type;
|
||||||
|
@SerializedName("task_type")
|
||||||
|
private int taskType;
|
||||||
|
@SerializedName("task_name")
|
||||||
|
private String taskName;
|
||||||
|
@SerializedName("task_num")
|
||||||
|
private int taskNum;
|
||||||
|
@SerializedName("hot")
|
||||||
|
private long hot;
|
||||||
|
@SerializedName("exp")
|
||||||
|
private long exp;
|
||||||
|
@SerializedName("new_hot")
|
||||||
|
private long newUserHot;
|
||||||
|
@SerializedName("new_exp")
|
||||||
|
private long newUserExp;
|
||||||
|
@SerializedName("sort")
|
||||||
|
private int sort;
|
||||||
|
@SerializedName("status")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
@SerializedName("now_num")
|
||||||
|
private int nowValue;
|
||||||
|
|
||||||
|
private boolean isNewUser = false;
|
||||||
|
|
||||||
|
public Task() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTaskType() {
|
||||||
|
return taskType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskType(int taskType) {
|
||||||
|
this.taskType = taskType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTaskNum() {
|
||||||
|
return taskNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskNum(int taskNum) {
|
||||||
|
this.taskNum = taskNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getHot() {
|
||||||
|
if (isNewUser) {
|
||||||
|
hot = newUserHot;
|
||||||
|
}
|
||||||
|
return hot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHot(long hot) {
|
||||||
|
this.hot = hot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getExp() {
|
||||||
|
if (isNewUser) {
|
||||||
|
exp = newUserExp;
|
||||||
|
}
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExp(long exp) {
|
||||||
|
this.exp = exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNewUserHot() {
|
||||||
|
return newUserHot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewUserHot(long newUserHot) {
|
||||||
|
this.newUserHot = newUserHot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNewUserExp() {
|
||||||
|
return newUserExp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewUserExp(long newUserExp) {
|
||||||
|
this.newUserExp = newUserExp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(int sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getStatus() {
|
||||||
|
return status == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNowValue() {
|
||||||
|
return nowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNowValue(int nowValue) {
|
||||||
|
this.nowValue = nowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Task{" +
|
||||||
|
"id=" + id +
|
||||||
|
", type=" + type +
|
||||||
|
", taskType=" + taskType +
|
||||||
|
", taskName='" + taskName + '\'' +
|
||||||
|
", taskNum=" + taskNum +
|
||||||
|
", hot=" + hot +
|
||||||
|
", exp=" + exp +
|
||||||
|
", newUserHot=" + newUserHot +
|
||||||
|
", newUserExp=" + newUserExp +
|
||||||
|
", sort=" + sort +
|
||||||
|
", status=" + status +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2017/8/14.
|
* Created by cxf on 2017/8/14.
|
||||||
@@ -116,6 +117,9 @@ public class UserBean implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIs_bind() {
|
public String getIs_bind() {
|
||||||
|
if(StringUtil.isEmpty(is_bind)){
|
||||||
|
is_bind="0";
|
||||||
|
}
|
||||||
return is_bind;
|
return is_bind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCurPosition() {
|
||||||
|
return mCurPosition;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
public AbsDialogPopupWindow(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void buildDialog(XPopup.Builder builder);
|
||||||
|
public abstract int bindLayoutId();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return bindLayoutId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showDialog() {
|
||||||
|
XPopup.Builder builder = new XPopup.Builder(mContext);
|
||||||
|
builder.isDestroyOnDismiss(true);
|
||||||
|
buildDialog(builder);
|
||||||
|
builder.asCustom(this).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
public class AnchorInfoEvent {
|
||||||
|
protected boolean clear;
|
||||||
|
protected String id;
|
||||||
|
protected String userNiceName;
|
||||||
|
protected String avatar;
|
||||||
|
|
||||||
|
public AnchorInfoEvent(boolean clears,String ids, String userNiceNames,String avatars) {
|
||||||
|
clear = clears;
|
||||||
|
id = ids;
|
||||||
|
userNiceName = userNiceNames;
|
||||||
|
avatar = avatars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNiceName() {
|
||||||
|
return userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserNiceName(String userNiceName) {
|
||||||
|
this.userNiceName = userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClear() {
|
||||||
|
return clear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClear(boolean clear) {
|
||||||
|
this.clear = clear;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LivePushRyEvent extends BaseModel {
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LiveRobotMessageEvent extends BaseModel {
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotMessageEvent setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LiveRobotSayHelloEvent extends BaseModel {
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotSayHelloEvent setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -239,6 +239,7 @@ public class ImgLoader {
|
|||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.onLoadSuccess(resource);
|
callback.onLoadSuccess(resource);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.yunbao.common.activity.ErrorActivity;
|
|||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
import com.yunbao.common.event.FollowEvent;
|
import com.yunbao.common.event.FollowEvent;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
|
import com.yunbao.common.manager.APKManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.NewLevelManager;
|
import com.yunbao.common.manager.NewLevelManager;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
@@ -199,6 +200,24 @@ public class CommonHttpUtil {
|
|||||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||||
}
|
}
|
||||||
|
if (obj.containsKey("apk_ver")) {
|
||||||
|
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("apk_url")) {
|
||||||
|
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("apk_des")) {
|
||||||
|
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("google_isup")) {
|
||||||
|
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("isup")) {
|
||||||
|
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("clarity")) {
|
||||||
|
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||||
|
|||||||
@@ -9,19 +9,25 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
|
|||||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
import com.yunbao.common.bean.FaceBookUpModel;
|
import com.yunbao.common.bean.FaceBookUpModel;
|
||||||
import com.yunbao.common.bean.HourRank;
|
import com.yunbao.common.bean.HourRank;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||||
import com.yunbao.common.bean.LiveInfoModel;
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||||
|
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||||
|
import com.yunbao.common.bean.LiveTaskModel;
|
||||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
import com.yunbao.common.bean.NewPeopleInfo;
|
import com.yunbao.common.bean.NewPeopleInfo;
|
||||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||||
import com.yunbao.common.bean.PkRankBean;
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
import com.yunbao.common.bean.RandomPkUserBean;
|
|
||||||
import com.yunbao.common.bean.RankPkInfoBean;
|
|
||||||
import com.yunbao.common.bean.PrankGiftBean;
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
import com.yunbao.common.bean.SearchModel;
|
import com.yunbao.common.bean.SearchModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.SlideInBannerModel;
|
import com.yunbao.common.bean.SlideInBannerModel;
|
||||||
@@ -29,6 +35,7 @@ import com.yunbao.common.bean.StarChallengeStatusModel;
|
|||||||
import com.yunbao.common.bean.VipModel;
|
import com.yunbao.common.bean.VipModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -36,6 +43,7 @@ import retrofit2.http.FormUrlEncoded;
|
|||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
import retrofit2.http.QueryMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDLive网络接口访问
|
* PDLive网络接口访问
|
||||||
@@ -354,42 +362,51 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置随机PK开关
|
* 设置随机PK开关
|
||||||
|
*
|
||||||
* @param pk 1=开,0=关
|
* @param pk 1=开,0=关
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.setRandomPKType")
|
@GET("/api/public/?service=Livepk.setRandomPKType")
|
||||||
Observable<ResponseModel<List<BaseModel>>> changeRandomPkSwitch(@Query("random_pk") int pk);
|
Observable<ResponseModel<List<BaseModel>>> changeRandomPkSwitch(@Query("random_pk") int pk);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取自由PK次数
|
* 获取自由PK次数
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.getActivePkNum")
|
@GET("/api/public/?service=Livepk.getActivePkNum")
|
||||||
Observable<ResponseModel<Integer>> getFreePkNumber();
|
Observable<ResponseModel<Integer>> getFreePkNumber();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发起随机PK
|
* 发起随机PK
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.setRandomPK")
|
@GET("/api/public/?service=Livepk.setRandomPK")
|
||||||
Observable<ResponseModel<String>> randomPK();
|
Observable<ResponseModel<String>> randomPK();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 随机PK后调用接口给后台记录
|
* 随机PK后调用接口给后台记录
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.startRandomPK")
|
@GET("/api/public/?service=Livepk.startRandomPK")
|
||||||
Observable<ResponseModel<BaseModel>> startRandomPK(@Query("pkuid")String pkuid);
|
Observable<ResponseModel<BaseModel>> startRandomPK(@Query("pkuid") String pkuid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自由PK开始后调用接口扣掉次数
|
* 自由PK开始后调用接口扣掉次数
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.setActivePkNum")
|
@GET("/api/public/?service=Livepk.setActivePkNum")
|
||||||
Observable<ResponseModel<BaseModel>> setFreePkNum();
|
Observable<ResponseModel<BaseModel>> setFreePkNum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 随机PK搜索用户
|
* 随机PK搜索用户
|
||||||
|
*
|
||||||
* @param cs 简体关键字/uid
|
* @param cs 简体关键字/uid
|
||||||
* @param ct 繁体关键字/uid
|
* @param ct 繁体关键字/uid
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.searchUser")
|
@GET("/api/public/?service=Livepk.searchUser")
|
||||||
Observable<ResponseModel<List<RandomPkUserBean>>> randomPkSearchUser(@Query("jian_key")String cs,@Query("fan_key")String ct);
|
Observable<ResponseModel<List<RandomPkUserBean>>> randomPkSearchUser(@Query("jian_key") String cs, @Query("fan_key") String ct);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拒绝随机PK
|
* 拒绝随机PK
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Livepk.setBanRandomPK")
|
@GET("/api/public/?service=Livepk.setBanRandomPK")
|
||||||
Observable<ResponseModel<BaseModel>> setBanRandomPK();
|
Observable<ResponseModel<BaseModel>> setBanRandomPK();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拒绝随机PK
|
* 拒绝随机PK
|
||||||
*/
|
*/
|
||||||
@@ -403,6 +420,7 @@ public interface PDLiveApi {
|
|||||||
Observable<ResponseModel<PrankHttpTurntableBean>> getAnchorPrankTurntable(
|
Observable<ResponseModel<PrankHttpTurntableBean>> getAnchorPrankTurntable(
|
||||||
@Query("anchor_id") String anchor_id
|
@Query("anchor_id") String anchor_id
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交整蛊
|
* 提交整蛊
|
||||||
*/
|
*/
|
||||||
@@ -418,6 +436,7 @@ public interface PDLiveApi {
|
|||||||
@Query("turntable_six") String turntable_six,
|
@Query("turntable_six") String turntable_six,
|
||||||
@Query("status") String status
|
@Query("status") String status
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转盘整蛊结束后调用的接口
|
* 转盘整蛊结束后调用的接口
|
||||||
*/
|
*/
|
||||||
@@ -431,7 +450,7 @@ public interface PDLiveApi {
|
|||||||
* 获取整蛊列表
|
* 获取整蛊列表
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Prank.prankList")
|
@GET("/api/public/?service=Prank.prankList")
|
||||||
Observable<ResponseModel<List<PrankGiftBean>>> prankList( @Query("anchor_id") String anchor_id);
|
Observable<ResponseModel<List<PrankGiftBean>>> prankList(@Query("anchor_id") String anchor_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置礼物整蛊
|
* 设置礼物整蛊
|
||||||
@@ -443,6 +462,7 @@ public interface PDLiveApi {
|
|||||||
@Query("gift_num") String gift_num,
|
@Query("gift_num") String gift_num,
|
||||||
@Query("prank_content") String prank_content
|
@Query("prank_content") String prank_content
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除礼物整蛊
|
* 删除礼物整蛊
|
||||||
*/
|
*/
|
||||||
@@ -452,4 +472,107 @@ public interface PDLiveApi {
|
|||||||
@Query("prank_index") String prank_index
|
@Query("prank_index") String prank_index
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置机器人开关
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||||
|
Observable<ResponseModel<HttpCallbackModel>> setAnchorAiState(
|
||||||
|
@Query("ai_state") String ai_state
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取机器人信息
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getAnchorAiState")
|
||||||
|
Observable<ResponseModel<LiveAiRobotBean>> getAnchorAiState(
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改机器人信息
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||||
|
Observable<ResponseModel<Integer>> setAnchorAiState(
|
||||||
|
@QueryMap Map<String, Object> map
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取机器人自定义话术
|
||||||
|
*
|
||||||
|
* @param type 1(自定义打招呼) 3(自定义求关注)
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<LiveAiRobotBean.Message>>> getAiAutomaticSpeech(
|
||||||
|
@Query("type") String type
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人添加话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.addAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<String>>> addAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("content") String content
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人删除话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.delAiAutomaticSpeech ")
|
||||||
|
Observable<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("id") String id
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人修改话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.updateAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<String>>> updateAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("id") String id,
|
||||||
|
@Query("content") String content
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开播获取机器人状态和心愿单状态
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveStetUpStatus")
|
||||||
|
Observable<ResponseModel<LiveStetUpStatusModel>> getLiveStetUpStatus(
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=live.jieshuDRPK")
|
||||||
|
Observable<ResponseModel<BaseModel>> jieshuDRPK(
|
||||||
|
@Query("roomid") String roomId,
|
||||||
|
@Query("uid") String uid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Message.getListInfo")
|
||||||
|
Observable<ResponseModel<List<ListInfoMessageModel>>> getListInfo(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("p") int p);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主播任务列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveTaskStatus")
|
||||||
|
Observable<ResponseModel<LiveTaskModel>> getLiveTaskList(
|
||||||
|
@Query("type") int type,
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveStatisticalData")
|
||||||
|
Observable<ResponseModel<LiveDataInfoModel>> getLiveDataInfo(
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Message.getAnchorMsg")
|
||||||
|
Observable<ResponseModel<List<ListInfoMessageModel>>> getAnchorMsg(
|
||||||
|
@Query("liveuid") String liveUid, @Query("page") int page, @Query("limit") int limit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,18 @@ import com.yunbao.common.bean.EnterRoomNewModel;
|
|||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.LinkMicUserBean;
|
import com.yunbao.common.bean.LinkMicUserBean;
|
||||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||||
import com.yunbao.common.bean.LiveInfoModel;
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||||
|
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||||
|
import com.yunbao.common.bean.LiveTaskModel;
|
||||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||||
import com.yunbao.common.bean.PkRankBean;
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
import com.yunbao.common.bean.PrankGiftBean;
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
import com.yunbao.common.bean.PrankTurntableBean;
|
|
||||||
import com.yunbao.common.bean.RandomPkUserBean;
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
import com.yunbao.common.bean.RankPkInfoBean;
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
@@ -33,13 +37,14 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
|
|||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.functions.Consumer;
|
import io.reactivex.functions.Consumer;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import retrofit2.http.Query;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -879,7 +884,7 @@ public class LiveNetManager {
|
|||||||
/**
|
/**
|
||||||
* 整蛊结束
|
* 整蛊结束
|
||||||
*/
|
*/
|
||||||
public void endPrankTurntable(String mLiveUid,HttpCallback<BaseModel> callback){
|
public void endPrankTurntable(String mLiveUid, HttpCallback<BaseModel> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.endPrankTurntable(mLiveUid)
|
.endPrankTurntable(mLiveUid)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -898,6 +903,248 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getAiRobotStatus(HttpCallback<LiveAiRobotBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAnchorAiState()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAiRobotStatus(String status, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setAnchorAiState(status)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAiRobotDate(String name, String value, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put(name, value);
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setAnchorAiState(map)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAiRobotBody(int type, HttpCallback<List<LiveAiRobotBean.Message>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAiAutomaticSpeech(type + "")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addAiRobotBody(int type, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.addAiAutomaticSpeech(type + "", content)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateAiRobotBody(int type, int id, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.updateAiAutomaticSpeech(type + "", id + "", content)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delAiRobotBody(int type, int id, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.delAiAutomaticSpeech(type + "", id + "")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开播设置数据获取
|
||||||
|
*
|
||||||
|
* @param liveUid
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getLiveStetUpStatus(String liveUid, HttpCallback<LiveStetUpStatusModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveStetUpStatus(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<LiveStetUpStatusModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<LiveStetUpStatusModel> liveStetUpStatusModelResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(liveStetUpStatusModelResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void jieshuDRPK(String uID) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.jieshuDRPK(uID, uID)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(baseModelResponseModel -> {
|
||||||
|
|
||||||
|
}, throwable -> {
|
||||||
|
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getListInfo(String type, int p, HttpCallback<List<ListInfoMessageModel>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getListInfo(type, p)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播任务
|
||||||
|
*
|
||||||
|
* @param type 1 直播任务 2粉丝任务
|
||||||
|
*/
|
||||||
|
public void getLiveTask(int type, String liveUid, HttpCallback<LiveTaskModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveTaskList(type, liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
public void getLiveData(String liveUid, HttpCallback<LiveDataInfoModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveDataInfo(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主播消息
|
||||||
|
*
|
||||||
|
* @param liveUid 直播间id
|
||||||
|
* @param page 页码
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void getAnchorMsg(String liveUid, int page, HttpCallback<List<ListInfoMessageModel>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAnchorMsg(liveUid, page, 10)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间取消网络请求
|
* 直播间取消网络请求
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
import com.yunbao.common.utils.VersionUtil;
|
||||||
|
|
||||||
|
public class APKManager extends BaseCacheManager {
|
||||||
|
private static APKManager manager;
|
||||||
|
private final String APK_VER = "apk_ver";
|
||||||
|
private final String APK_URL = "apk_url";
|
||||||
|
private final String APK_DES = "apk_des";
|
||||||
|
private final String APK_IS_UP = "isup";
|
||||||
|
private final String APK_GOOGLE_IS_UP = "google_isup";
|
||||||
|
|
||||||
|
public APKManager(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单利
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static APKManager get() {
|
||||||
|
if (null == manager) {
|
||||||
|
manager = new APKManager(CommonAppContext.sInstance.getBaseContext());
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKUrl(String apkUrl) {
|
||||||
|
put(APK_URL, apkUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKDes(String apkDes) {
|
||||||
|
put(APK_DES, apkDes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAPKUrl() {
|
||||||
|
return getString(APK_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAPKDes() {
|
||||||
|
return getString(APK_DES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApkVer(String apkVer) {
|
||||||
|
put(APK_VER, apkVer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getApkVerNew() {
|
||||||
|
|
||||||
|
return VersionUtil.isLatest(getString(APK_VER));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKIsUp(int apkIsUp) {
|
||||||
|
put(APK_IS_UP, apkIsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKGoogleIsUp(int apkGoogleIsUp) {
|
||||||
|
put(APK_GOOGLE_IS_UP, apkGoogleIsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApkIsUp() {
|
||||||
|
return getInt(APK_IS_UP, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAPKGoogleIsUp() {
|
||||||
|
return getInt(APK_GOOGLE_IS_UP, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.cosmos.baseutil.app.AppContext;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
@@ -39,8 +38,43 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
private final String IS_FLOAT = "is_float";
|
private final String IS_FLOAT = "is_float";
|
||||||
private final String IS_HINT = "is_hint";
|
private final String IS_HINT = "is_hint";
|
||||||
private final String IS_HINT2 = "is_hint2";
|
private final String IS_HINT2 = "is_hint2";
|
||||||
|
private final String SELECT_CLARITY = "selectClarity";
|
||||||
|
private final String CLARITY = "clarity";
|
||||||
|
|
||||||
|
|
||||||
|
public void setClarity(String clarity) {
|
||||||
|
put(CLARITY, clarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1080p开播分辨率:clarity 0关闭 1开启
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getClarity() {
|
||||||
|
return TextUtils.equals(getString(CLARITY), "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置清晰度
|
||||||
|
*
|
||||||
|
* @param selectClarity
|
||||||
|
*/
|
||||||
|
public void setSelectClarity(int selectClarity) {
|
||||||
|
put(SELECT_CLARITY, selectClarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取清晰度
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getSelectClarity() {
|
||||||
|
|
||||||
|
return getInt(SELECT_CLARITY, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isHint() {
|
public boolean isHint() {
|
||||||
return 1 == getInt(IS_HINT, 0);
|
return 1 == getInt(IS_HINT, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class RandomPkManager {
|
|||||||
private String pkUid;//对方房间ID
|
private String pkUid;//对方房间ID
|
||||||
public static String debugUid;
|
public static String debugUid;
|
||||||
private RankPkInfoBean rankPkInfoBean;//排位赛信息
|
private RankPkInfoBean rankPkInfoBean;//排位赛信息
|
||||||
|
private int exitTimer;//退出倒计时
|
||||||
|
private TimerTask exitTask = null;//退出任务
|
||||||
Handler handler = new Handler(Looper.getMainLooper());
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
private RandomPkManager() {
|
private RandomPkManager() {
|
||||||
@@ -118,6 +120,8 @@ public class RandomPkManager {
|
|||||||
return String.format(Locale.CHINA, "%02d:%02d", min, sec);
|
return String.format(Locale.CHINA, "%02d:%02d", min, sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Runnable pkRunnable = this::next;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对方拒绝,开始下一轮匹配
|
* 对方拒绝,开始下一轮匹配
|
||||||
*/
|
*/
|
||||||
@@ -125,11 +129,11 @@ public class RandomPkManager {
|
|||||||
if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) {
|
if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(this::next, 5000);
|
handler.postDelayed(pkRunnable, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void next() {
|
private void next() {
|
||||||
if (task==null) {
|
if (task == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
status = PK_STATUS_REQUEST;
|
status = PK_STATUS_REQUEST;
|
||||||
@@ -243,19 +247,9 @@ public class RandomPkManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int exitTimer;
|
|
||||||
|
|
||||||
/**
|
private TimerTask createExitTask() {
|
||||||
* 退出匹配
|
return new TimerTask() {
|
||||||
*/
|
|
||||||
public void exitPk() {
|
|
||||||
if (status == PK_STATUS_EXIT_ING) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
callEndPkStart();
|
|
||||||
status = PK_STATUS_EXIT_ING;
|
|
||||||
exitTimer = 11;
|
|
||||||
new Timer().schedule(new TimerTask() {
|
|
||||||
|
|
||||||
Handler handler = new Handler(Looper.getMainLooper());
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@@ -269,10 +263,25 @@ public class RandomPkManager {
|
|||||||
end();
|
end();
|
||||||
callEndPkSuccess();
|
callEndPkSuccess();
|
||||||
cancel();
|
cancel();
|
||||||
|
exitTask = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, 0, 1000);
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出匹配
|
||||||
|
*/
|
||||||
|
public void exitPk() {
|
||||||
|
if (status == PK_STATUS_EXIT_ING) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callEndPkStart();
|
||||||
|
status = PK_STATUS_EXIT_ING;
|
||||||
|
exitTimer = 11;
|
||||||
|
exitTask = createExitTask();
|
||||||
|
new Timer().schedule(exitTask, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -387,6 +396,23 @@ public class RandomPkManager {
|
|||||||
return exitTimer + "";
|
return exitTimer + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空状态,下播时调用
|
||||||
|
*/
|
||||||
|
public void release() {
|
||||||
|
status = PK_STATUS_REQUEST;
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
}
|
||||||
|
if (exitTask != null) {
|
||||||
|
exitTask.cancel();
|
||||||
|
}
|
||||||
|
randomPkTimer.clear();
|
||||||
|
rankPkInfoBean = null;
|
||||||
|
pkUid = null;
|
||||||
|
handler.removeCallbacks(pkRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static abstract class OnRandomPkTimer {
|
public static abstract class OnRandomPkTimer {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ public class MessageIMManager {
|
|||||||
public void getSystemMessages() {
|
public void getSystemMessages() {
|
||||||
systemNumber = 0;
|
systemNumber = 0;
|
||||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||||
|
if (userInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||||
.params("uid", userInfo.getId())
|
.params("uid", userInfo.getId())
|
||||||
.params("token", userInfo.getToken())
|
.params("token", userInfo.getToken())
|
||||||
|
|||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class APKDownloadUtil {
|
||||||
|
/**
|
||||||
|
* APK文件下载
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
*/
|
||||||
|
public void downloadAPK(Activity context, String url, OnUpdateListener listener) {
|
||||||
|
Request request = new Request.Builder().url(url)
|
||||||
|
.addHeader("Accept-Encoding", "identity").build();
|
||||||
|
File downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||||
|
try {
|
||||||
|
if (!downloadFile.exists()
|
||||||
|
&& !downloadFile.createNewFile()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
showDialod(context);
|
||||||
|
new OkHttpClient().newCall(request).enqueue(new Callback() {
|
||||||
|
private Handler handler = new Handler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
// 下载失败
|
||||||
|
handler.post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
progressDialog.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) {
|
||||||
|
Looper.prepare();
|
||||||
|
byte[] buf = new byte[2048];
|
||||||
|
int len;
|
||||||
|
try (InputStream inputStream = response.body().byteStream();
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||||
|
long total = response.body().contentLength();
|
||||||
|
long sum = 0;
|
||||||
|
while ((len = inputStream.read(buf)) != -1) {
|
||||||
|
outputStream.write(buf, 0, len);
|
||||||
|
sum += len;
|
||||||
|
int progress = (int) (sum * 1.0f / total * 100);
|
||||||
|
// 下载中
|
||||||
|
handler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
tvProgress.setText(progress + "%");
|
||||||
|
progressBar.setProgress(progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
outputStream.flush();
|
||||||
|
//启动安装app
|
||||||
|
installApk(context, downloadFile, context.getPackageName() + ".fileprovider");
|
||||||
|
handler.post(() -> progressDialog.dismiss());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
new Handler().post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
progressDialog.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新监听
|
||||||
|
*/
|
||||||
|
public interface OnUpdateListener {
|
||||||
|
void updateFailure(int code, String error);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 启动app安装
|
||||||
|
// *
|
||||||
|
// * @param context
|
||||||
|
// * @param filePath
|
||||||
|
// */
|
||||||
|
// private static void startInstall(Context context, File filePath) {
|
||||||
|
//
|
||||||
|
// Intent install = new Intent(Intent.ACTION_VIEW);
|
||||||
|
// install.setDataAndType(Uri.parse("file://" + filePath.getAbsolutePath()),
|
||||||
|
// "application/vnd.android.package-archive");
|
||||||
|
// install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
// context.startActivity(install);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装apk
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
*/
|
||||||
|
public void installApk(Context context, File file, String authority) {
|
||||||
|
Intent intent = getInstallIntent(context, file, authority);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取安装Intent
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
* @param authority
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Intent getInstallIntent(Context context, File file, String authority) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
Uri uriData;
|
||||||
|
String type = "application/vnd.android.package-archive";
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||||
|
} else {
|
||||||
|
uriData = Uri.fromFile(file);
|
||||||
|
}
|
||||||
|
intent.setDataAndType(uriData, type);
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView tvProgress;
|
||||||
|
public ProgressBar progressBar;
|
||||||
|
public Dialog progressDialog;
|
||||||
|
|
||||||
|
private void showDialod(Activity context) {
|
||||||
|
if (progressDialog == null) {
|
||||||
|
progressDialog = new Dialog(context, R.style.dialog);
|
||||||
|
View view = LayoutInflater.from(context).inflate(R.layout.dialog_progress, null);
|
||||||
|
tvProgress = view.findViewById(R.id.tvProgress);
|
||||||
|
progressBar = view.findViewById(R.id.progressBar);
|
||||||
|
progressDialog.setContentView(view);
|
||||||
|
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
Display display = wm.getDefaultDisplay();
|
||||||
|
int width = display.getWidth();
|
||||||
|
Window window = progressDialog.getWindow();// 这部分是设置dialog宽高的,宽高是我从sharedpreferences里面获取到的。之前程序启动的时候有获取
|
||||||
|
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||||
|
WindowManager.LayoutParams lp = window.getAttributes();
|
||||||
|
lp.width = width / 4 * 3;
|
||||||
|
window.setAttributes(lp);
|
||||||
|
}
|
||||||
|
progressDialog.setCancelable(false);
|
||||||
|
progressDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,10 +6,15 @@ import android.content.Context;
|
|||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
|
import android.net.TrafficStats;
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备通用类
|
* 设备通用类
|
||||||
*/
|
*/
|
||||||
@@ -97,10 +102,40 @@ public class DeviceUtils {
|
|||||||
return mi.lowMemory;
|
return mi.lowMemory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getMemory(Context context) {
|
/**
|
||||||
|
* 获取可用内存 格式化
|
||||||
|
*/
|
||||||
|
public static String getMemoryToFormat(Context context) {
|
||||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||||
am.getMemoryInfo(mi);
|
am.getMemoryInfo(mi);
|
||||||
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
|
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可用内存
|
||||||
|
*/
|
||||||
|
public static String getMemory(Context context) {
|
||||||
|
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||||
|
am.getMemoryInfo(mi);
|
||||||
|
return mi.availMem + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static long lastTotalRxBytes = 0;
|
||||||
|
private static long lastTimeStamp = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上传网速
|
||||||
|
*/
|
||||||
|
public static long getNetSpeed(Context context) {
|
||||||
|
long nowTotalRxBytes = TrafficStats.getUidTxBytes(context.getApplicationInfo().uid) == TrafficStats.UNSUPPORTED ? 0 : (TrafficStats.getTotalTxBytes() / 1024);
|
||||||
|
long nowTimeStamp = System.currentTimeMillis();
|
||||||
|
long speed = ((nowTotalRxBytes - lastTotalRxBytes) * 1000 / (nowTimeStamp - lastTimeStamp));//毫秒转换
|
||||||
|
lastTimeStamp = nowTimeStamp;
|
||||||
|
lastTotalRxBytes = nowTotalRxBytes;
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ import android.app.Activity;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
@@ -68,6 +70,21 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
public static void showToast(Context context,String content,long delayMillis){
|
||||||
|
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||||
|
dialog.setContentView(R.layout.dialog_toast);
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
dialog.setCanceledOnTouchOutside(false);
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
TextView titleView = (TextView) dialog.findViewById(R.id.text);
|
||||||
|
if (titleView != null) {
|
||||||
|
titleView.setGravity(Gravity.CENTER);
|
||||||
|
titleView.setText(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.show();
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog loadingDialog(Context context) {
|
public static Dialog loadingDialog(Context context) {
|
||||||
@@ -494,8 +511,12 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnConfirm.setOnClickListener(listener);
|
if(btnConfirm!=null) {
|
||||||
btnCancel.setOnClickListener(listener);
|
btnConfirm.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
if(btnCancel!=null) {
|
||||||
|
btnCancel.setOnClickListener(listener);
|
||||||
|
}
|
||||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onShow(DialogInterface dialogInterface) {
|
public void onShow(DialogInterface dialogInterface) {
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
package com.yunbao.common.utils;
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
@@ -38,6 +44,39 @@ public class ToastUtil {
|
|||||||
show(WordUtil.getString(res));
|
show(WordUtil.getString(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示黑底白字的提示
|
||||||
|
*
|
||||||
|
* @param res 内容
|
||||||
|
* @param delayMillis 显示时间 毫秒
|
||||||
|
*/
|
||||||
|
public static void showStyle(int res, long delayMillis) {
|
||||||
|
showStyle(WordUtil.getString(res), delayMillis);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示黑底白字的提示
|
||||||
|
*
|
||||||
|
* @param content 内容
|
||||||
|
* @param delayMillis 显示时间 毫秒
|
||||||
|
*/
|
||||||
|
public static void showStyle(String content, long delayMillis) {
|
||||||
|
Dialog dialog = new Dialog(CommonAppContext.getTopActivity(), R.style.dialog);
|
||||||
|
dialog.setContentView(R.layout.dialog_toast);
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
dialog.setCanceledOnTouchOutside(false);
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
TextView titleView = (TextView) dialog.findViewById(R.id.text);
|
||||||
|
if (titleView != null) {
|
||||||
|
titleView.setTextColor(Color.WHITE);
|
||||||
|
titleView.setGravity(Gravity.CENTER);
|
||||||
|
titleView.setText(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.show();
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss, delayMillis);
|
||||||
|
}
|
||||||
|
|
||||||
public static void show(String s) {
|
public static void show(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,37 +2,26 @@ package com.yunbao.common.utils;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Handler;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.king.app.dialog.AppDialog;
|
|
||||||
import com.king.app.updater.AppUpdater;
|
|
||||||
import com.king.app.updater.UpdateConfig;
|
|
||||||
import com.king.app.updater.callback.UpdateCallback;
|
|
||||||
import com.king.app.updater.http.OkHttpManager;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class VersionUtil {
|
public class VersionUtil {
|
||||||
|
|
||||||
private static String sVersion;
|
private static String sVersion;
|
||||||
|
|
||||||
public TextView tvProgress;
|
public TextView tvProgress;
|
||||||
public ProgressBar progressBar;
|
public ProgressBar progressBar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是最新版本
|
* 是否是最新版本
|
||||||
*/
|
*/
|
||||||
@@ -49,176 +38,122 @@ public class VersionUtil {
|
|||||||
else return false;
|
else return false;
|
||||||
// return curVersion.equal(version);
|
// return curVersion.equal(version);
|
||||||
}
|
}
|
||||||
public void updateProgress(long progress, long total){
|
|
||||||
if(tvProgress == null || progressBar == null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(progress > 0){
|
|
||||||
int currProgress = (int)(progress * 1.0f / total * 100.0f);
|
|
||||||
tvProgress.setText(currProgress + "%");
|
|
||||||
progressBar.setProgress(currProgress);
|
|
||||||
}else{
|
|
||||||
tvProgress.setText("稍等");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void upd( Activity context, ConfigBean configBean, String downloadUrl){
|
|
||||||
UpdateConfig config = new UpdateConfig();
|
|
||||||
config.setUrl(downloadUrl);
|
|
||||||
config.addHeader("token","xxxxxx");
|
|
||||||
AppUpdater mAppUpdater = new AppUpdater(context,config)
|
|
||||||
.setHttpManager(OkHttpManager.getInstance())
|
|
||||||
.setUpdateCallback(new UpdateCallback() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDownloading(boolean isDownloading) {
|
|
||||||
if(isDownloading){
|
|
||||||
ToastUtil.show("已经在下载中,请勿重复下载。");
|
|
||||||
}else{
|
|
||||||
// showToast("开始下载…");
|
|
||||||
View view = LayoutInflater.from(context).inflate(R.layout.dialog_progress,null);
|
|
||||||
tvProgress = view.findViewById(R.id.tvProgress);
|
|
||||||
progressBar = view.findViewById(R.id.progressBar);
|
|
||||||
AppDialog.INSTANCE.showDialog(context,view,false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart(String url) {
|
|
||||||
updateProgress(0,100);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onProgress(long progress, long total, boolean isChange) {
|
|
||||||
if(isChange){
|
|
||||||
updateProgress(progress,total);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish(File file) {
|
|
||||||
AppDialog.INSTANCE.dismissDialog();
|
|
||||||
ToastUtil.show("下载完成");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception e) {
|
|
||||||
AppDialog.INSTANCE.dismissDialog();
|
|
||||||
ToastUtil.show("下载失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCancel() {
|
|
||||||
AppDialog.INSTANCE.dismissDialog();
|
|
||||||
ToastUtil.show("取消下载");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAppUpdater.start();
|
|
||||||
}
|
|
||||||
//是否是谷歌版本
|
//是否是谷歌版本
|
||||||
public void showDialog( Activity context, ConfigBean configBean, String downloadUrl) {
|
public void showDialog(Activity context, ConfigBean configBean, String downloadUrl) {
|
||||||
//不是谷歌
|
//不是谷歌
|
||||||
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
||||||
//不强更
|
//不强更
|
||||||
if(configBean.getForceUpdate()!=1){
|
if (configBean.getForceUpdate() != 1) {
|
||||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||||
builder.setTitle(WordUtil.getString(R.string.version_update))
|
builder.setTitle(WordUtil.getString(R.string.version_update))
|
||||||
.setContent(configBean.getUpdateDes())
|
.setContent(configBean.getUpdateDes())
|
||||||
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
||||||
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||||
public void onCancelClick() {
|
public void onCancelClick() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
context.runOnUiThread(new Runnable() {
|
context.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
upd(context,configBean,downloadUrl);
|
// upd(context,configBean,downloadUrl);
|
||||||
}
|
new APKDownloadUtil().downloadAPK(context, configBean.getDownloadApkUrl(), new APKDownloadUtil.OnUpdateListener() {
|
||||||
});
|
@Override
|
||||||
|
public void updateFailure(int code, String error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.build()
|
}
|
||||||
.show();
|
});
|
||||||
}else{
|
|
||||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
|
||||||
builder.setTitle(WordUtil.getString(R.string.version_update))
|
|
||||||
.setContent(configBean.getUpdateDes())
|
|
||||||
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
|
||||||
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
|
||||||
public void onCancelClick() {
|
|
||||||
context.finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
})
|
||||||
upd(context,configBean,downloadUrl);
|
.build()
|
||||||
}
|
.show();
|
||||||
})
|
} else {
|
||||||
.build()
|
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||||
.show();
|
builder.setTitle(WordUtil.getString(R.string.version_update))
|
||||||
}
|
.setContent(configBean.getUpdateDes())
|
||||||
|
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
||||||
|
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||||
|
public void onCancelClick() {
|
||||||
|
context.finish();
|
||||||
|
}
|
||||||
|
|
||||||
//谷歌版本
|
@Override
|
||||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
//谷歌强制更新
|
// upd(context,configBean,downloadUrl);
|
||||||
if(configBean.getGoogle_isup().equals("1")) {
|
new APKDownloadUtil().downloadAPK(context, configBean.getDownloadApkUrl(), new APKDownloadUtil.OnUpdateListener() {
|
||||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
@Override
|
||||||
builder.setTitle(WordUtil.getString(R.string.version_update))
|
public void updateFailure(int code, String error) {
|
||||||
.setContent(configBean.getUpdateDes())
|
|
||||||
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
|
||||||
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
|
||||||
public void onCancelClick() {
|
|
||||||
context.finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
});
|
||||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
}
|
||||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
})
|
||||||
context.startActivity(i);
|
.build()
|
||||||
context.finish();
|
.show();
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.build()
|
|
||||||
.show();
|
|
||||||
//谷歌不强制
|
|
||||||
}else {
|
|
||||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
|
||||||
builder.setTitle(WordUtil.getString(R.string.version_update))
|
|
||||||
.setContent(configBean.getUpdateDes())
|
|
||||||
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
|
||||||
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
|
||||||
public void onCancelClick() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
//谷歌版本
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
//谷歌强制更新
|
||||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
if (configBean.getGoogle_isup().equals("1")) {
|
||||||
context.startActivity(i);
|
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||||
context.finish();
|
builder.setTitle(WordUtil.getString(R.string.version_update))
|
||||||
}
|
.setContent(configBean.getUpdateDes())
|
||||||
})
|
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
||||||
.build()
|
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
||||||
.show();
|
.setCancelable(false)
|
||||||
}
|
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||||
|
public void onCancelClick() {
|
||||||
|
context.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||||
|
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||||
|
context.startActivity(i);
|
||||||
|
context.finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build()
|
||||||
|
.show();
|
||||||
|
//谷歌不强制
|
||||||
|
} else {
|
||||||
|
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||||
|
builder.setTitle(WordUtil.getString(R.string.version_update))
|
||||||
|
.setContent(configBean.getUpdateDes())
|
||||||
|
.setConfrimString(WordUtil.getString(R.string.version_immediate_use))
|
||||||
|
.setCancelString(WordUtil.getString(R.string.version_not_update))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||||
|
public void onCancelClick() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||||
|
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||||
|
context.startActivity(i);
|
||||||
|
context.finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build()
|
||||||
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.manager.APKManager;
|
||||||
|
import com.yunbao.common.utils.APKDownloadUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* apk更新弹窗
|
||||||
|
*/
|
||||||
|
public class APKUpdateCustomPopup extends CenterPopupView {
|
||||||
|
private TextView updateText, versionImmediateUse;
|
||||||
|
private LinearLayout updateLine;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
private Activity mContext;
|
||||||
|
private boolean mInside;
|
||||||
|
|
||||||
|
public APKUpdateCustomPopup(@NonNull Activity context, boolean inside) {
|
||||||
|
super(context);
|
||||||
|
mContext = context;
|
||||||
|
mInside = inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.apk_update_custom_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initView();
|
||||||
|
initData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
if (!mInside) {
|
||||||
|
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||||
|
findViewById(R.id.dialog_close).setVisibility(GONE);
|
||||||
|
}
|
||||||
|
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||||
|
findViewById(R.id.dialog_close).setVisibility(GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateText = findViewById(R.id.update_text);
|
||||||
|
versionImmediateUse = findViewById(R.id.version_immediate_use);
|
||||||
|
updateLine = findViewById(R.id.update_line);
|
||||||
|
progressBar = findViewById(R.id.progressBar);
|
||||||
|
versionImmediateUse.setVisibility(VISIBLE);
|
||||||
|
updateLine.setVisibility(GONE);
|
||||||
|
updateText.setText(APKManager.get().getAPKDes());
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dialog_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
if (mInside){
|
||||||
|
dismiss();
|
||||||
|
}else {
|
||||||
|
if (CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() != 1) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getApkIsUp() != 1) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(versionImmediateUse, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
//不是谷歌
|
||||||
|
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||||
|
versionImmediateUse.setVisibility(GONE);
|
||||||
|
updateLine.setVisibility(VISIBLE);
|
||||||
|
downloadAPK(mContext, APKManager.get().getAPKUrl(), new APKDownloadUtil.OnUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void updateFailure(int code, String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||||
|
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||||
|
mContext.startActivity(i);
|
||||||
|
mContext.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadAPK(Activity context, String url, APKDownloadUtil.OnUpdateListener listener) {
|
||||||
|
Request request = new Request.Builder().url(url)
|
||||||
|
.addHeader("Accept-Encoding", "identity").build();
|
||||||
|
File downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||||
|
try {
|
||||||
|
if (!downloadFile.exists()
|
||||||
|
&& !downloadFile.createNewFile()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
new OkHttpClient().newCall(request).enqueue(new Callback() {
|
||||||
|
private Handler handler = new Handler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
// 下载失败
|
||||||
|
handler.post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) {
|
||||||
|
Looper.prepare();
|
||||||
|
byte[] buf = new byte[2048];
|
||||||
|
int len;
|
||||||
|
try (InputStream inputStream = response.body().byteStream();
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||||
|
long total = response.body().contentLength();
|
||||||
|
long sum = 0;
|
||||||
|
while ((len = inputStream.read(buf)) != -1) {
|
||||||
|
outputStream.write(buf, 0, len);
|
||||||
|
sum += len;
|
||||||
|
int progress = (int) (sum * 1.0f / total * 100);
|
||||||
|
// 下载中
|
||||||
|
handler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
progressBar.setProgress(progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
outputStream.flush();
|
||||||
|
//启动安装app
|
||||||
|
installApk(context, downloadFile, context.getPackageName() + ".fileprovider");
|
||||||
|
handler.post(() -> dismiss());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
new Handler().post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装apk
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
*/
|
||||||
|
public void installApk(Context context, File file, String authority) {
|
||||||
|
Intent intent = getInstallIntent(context, file, authority);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取安装Intent
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
* @param authority
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Intent getInstallIntent(Context context, File file, String authority) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
Uri uriData;
|
||||||
|
String type = "application/vnd.android.package-archive";
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||||
|
} else {
|
||||||
|
uriData = Uri.fromFile(file);
|
||||||
|
}
|
||||||
|
intent.setDataAndType(uriData, type);
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -128,6 +128,9 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
dismiss();
|
dismiss();
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.changeVideo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -195,6 +198,8 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
|||||||
|
|
||||||
void systemNotice();
|
void systemNotice();
|
||||||
|
|
||||||
|
void changeVideo();
|
||||||
|
|
||||||
void online();
|
void online();
|
||||||
|
|
||||||
void reportLayout();
|
void reportLayout();
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
public class HintCustomPopup extends CenterPopupView {
|
||||||
|
private String title, contest;
|
||||||
|
|
||||||
|
public HintCustomPopup(@NonNull Context context, String title, String contest) {
|
||||||
|
super(context);
|
||||||
|
this.title = title;
|
||||||
|
this.contest = contest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HintCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.hint_custom_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
TextView titleText = findViewById(R.id.title);
|
||||||
|
TextView contestText = findViewById(R.id.contest);
|
||||||
|
if (!TextUtils.isEmpty(title)) {
|
||||||
|
titleText.setText(title);
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(contest)) {
|
||||||
|
contestText.setText(contest);
|
||||||
|
}
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.onSure();
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.onCancel();
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private HintCustomCallBack callBack;
|
||||||
|
|
||||||
|
public HintCustomPopup setCallBack(HintCustomCallBack callBack) {
|
||||||
|
this.callBack = callBack;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HintCustomCallBack {
|
||||||
|
void onSure();
|
||||||
|
|
||||||
|
void onCancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.animator.PopupAnimator;
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输入弹窗
|
||||||
|
*/
|
||||||
|
public class InputCustomPopup extends CenterPopupView {
|
||||||
|
private String message = "";
|
||||||
|
private int title = R.string.dialog_tip;
|
||||||
|
|
||||||
|
public InputCustomPopup(@NonNull Context context, String message, int title) {
|
||||||
|
super(context);
|
||||||
|
this.message = message;
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InputCustomPopup(@NonNull Context context,int title) {
|
||||||
|
super(context);
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.input_custom_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
EditText content = findViewById(R.id.content);
|
||||||
|
TextView titleText = findViewById(R.id.title);
|
||||||
|
content.setText(message);
|
||||||
|
titleText.setText(title);
|
||||||
|
findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss(); // 关闭弹窗
|
||||||
|
}
|
||||||
|
});
|
||||||
|
findViewById(R.id.btn_confirm).setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
String textContent = content.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(textContent)) {
|
||||||
|
ToastUtil.show("输入内容不可为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onConfirm(textContent);
|
||||||
|
}
|
||||||
|
dismiss(); // 关闭弹窗
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置最大宽度,看需要而定,
|
||||||
|
@Override
|
||||||
|
protected int getMaxWidth() {
|
||||||
|
return super.getMaxWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置最大高度,看需要而定
|
||||||
|
@Override
|
||||||
|
protected int getMaxHeight() {
|
||||||
|
return super.getMaxHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置自定义动画器,看需要而定
|
||||||
|
@Override
|
||||||
|
protected PopupAnimator getPopupAnimator() {
|
||||||
|
return super.getPopupAnimator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface InputCustomListener {
|
||||||
|
void onConfirm(String text);
|
||||||
|
}
|
||||||
|
|
||||||
|
private InputCustomListener listener;
|
||||||
|
|
||||||
|
public InputCustomPopup setListener(InputCustomListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.LiveSystemMessageAdapter;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.views.weight.OnRecyclerViewScrollListener;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播消息中心
|
||||||
|
*/
|
||||||
|
public class LiveAnchorMessageCustomPopup extends BottomPopupView {
|
||||||
|
private LiveSystemMessageAdapter adapter;
|
||||||
|
private RecyclerView liveMessage;
|
||||||
|
private String liveUid;
|
||||||
|
private int page = 1, size = 0;
|
||||||
|
|
||||||
|
public LiveAnchorMessageCustomPopup(@NonNull Context context, String liveUid) {
|
||||||
|
super(context);
|
||||||
|
this.liveUid = liveUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAnchorMessageCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_live_anchor_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDate() {
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.getAnchorMsg(liveUid, page, new HttpCallback<List<ListInfoMessageModel>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<ListInfoMessageModel> data) {
|
||||||
|
size = data.size();
|
||||||
|
adapter.addData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
liveMessage = findViewById(R.id.live_message);
|
||||||
|
liveMessage.setHasFixedSize(false);
|
||||||
|
liveMessage.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||||
|
adapter = new LiveSystemMessageAdapter(getContext());
|
||||||
|
liveMessage.setAdapter(adapter);
|
||||||
|
liveMessage.addOnScrollListener(new OnRecyclerViewScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onBottom() {
|
||||||
|
if (size > 0) {
|
||||||
|
page = page + 1;
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,256 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.text.format.Formatter;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.DoubleSummaryStatistics;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveClarityCustomPopup extends BottomPopupView implements View.OnClickListener {
|
||||||
|
public static final int BAN_720 = 1;
|
||||||
|
public static final int BAN_1080 = 2;
|
||||||
|
private int selectClarity = 1;
|
||||||
|
private RelativeLayout lineSd, lineHd, lineFhd;
|
||||||
|
private ImageView iconSd, iconHd, iconFhd;
|
||||||
|
private ImageView titleSDImg, titleHDImg, titleFHDImg;
|
||||||
|
private TextView titleSDText, titleHDText, titleFHDText, mTips;
|
||||||
|
private int banSelect;
|
||||||
|
private boolean isUser = false;
|
||||||
|
|
||||||
|
public int getSelectClarity() {
|
||||||
|
return selectClarity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param banSelect 禁止选项,{@link #BAN_720} 禁止高清和超高清。 {@link #BAN_1080} 禁止超高清
|
||||||
|
* @param isUser 是否为观众,true 观众,false 主播
|
||||||
|
*/
|
||||||
|
public LiveClarityCustomPopup(@NonNull Context context, int selectClarity, int banSelect, boolean isUser) {
|
||||||
|
super(context);
|
||||||
|
this.banSelect = banSelect;
|
||||||
|
if (selectClarity == -1) {
|
||||||
|
selectClarity = 0;
|
||||||
|
}
|
||||||
|
this.isUser = isUser;
|
||||||
|
if (banSelect == BAN_720) {
|
||||||
|
selectClarity = 0;
|
||||||
|
} else if (banSelect == BAN_1080 && selectClarity == 3) {
|
||||||
|
selectClarity = 2;
|
||||||
|
}
|
||||||
|
this.selectClarity = selectClarity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveClarityCustomPopup(@NonNull Context context, int selectClarity) {
|
||||||
|
super(context);
|
||||||
|
if (selectClarity == -1) {
|
||||||
|
selectClarity = 0;
|
||||||
|
}
|
||||||
|
this.selectClarity = selectClarity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveClarityCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_live_clarity;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
lineSd = findViewById(R.id.line_sd);
|
||||||
|
lineHd = findViewById(R.id.line_hd);
|
||||||
|
lineFhd = findViewById(R.id.line_fhd);
|
||||||
|
iconSd = findViewById(R.id.icon_sd);
|
||||||
|
iconHd = findViewById(R.id.icon_hd);
|
||||||
|
iconFhd = findViewById(R.id.icon_fhd);
|
||||||
|
titleSDImg = findViewById(R.id.sd);
|
||||||
|
titleHDImg = findViewById(R.id.hd);
|
||||||
|
titleFHDImg = findViewById(R.id.fhd);
|
||||||
|
titleSDText = findViewById(R.id.sd_text);
|
||||||
|
titleHDText = findViewById(R.id.hd_text);
|
||||||
|
titleFHDText = findViewById(R.id.fhd_text);
|
||||||
|
mTips = findViewById(R.id.tips);
|
||||||
|
if (isUser) {
|
||||||
|
mTips.setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
|
selectClarity(selectClarity);
|
||||||
|
//流畅
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(lineSd, () -> {
|
||||||
|
selectClarity = 0;
|
||||||
|
selectClarity(selectClarity);
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
//高清
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(lineHd, () -> {
|
||||||
|
if (lineHd.getTag() != null) {
|
||||||
|
if (isUser) {//用户端
|
||||||
|
ToastUtil.show(R.string.live_user_ban_hd);
|
||||||
|
} else {//主播端
|
||||||
|
ToastUtil.show(R.string.function_is_suspended);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String memorg = formateFileSize(Long.parseLong(DeviceUtils.getMemory(getContext())));
|
||||||
|
if ((Double.parseDouble(memorg) > 7 && netAverage > 100) || isUser) {
|
||||||
|
selectClarity = 1;
|
||||||
|
selectClarity(selectClarity);
|
||||||
|
dismiss();
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.asCustom(new HintCustomPopup(getContext(), getContext().getString(R.string.net_hint), getContext().getString(R.string.net_hint2)).setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSure() {
|
||||||
|
selectClarity = 1;
|
||||||
|
selectClarity(selectClarity);
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
//超高清
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(lineFhd, () -> {
|
||||||
|
if (lineFhd.getTag() != null) {
|
||||||
|
if (isUser) {//用户端
|
||||||
|
ToastUtil.show(R.string.live_user_ban_fhd);
|
||||||
|
} else {//主播端
|
||||||
|
ToastUtil.show(R.string.function_is_suspended);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.asCustom(new HintCustomPopup(getContext()).setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSure() {
|
||||||
|
selectClarity = 2;
|
||||||
|
selectClarity(selectClarity);
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
if (banSelect == BAN_720) {
|
||||||
|
lineFhd.setTag(false);
|
||||||
|
lineHd.setTag(false);
|
||||||
|
titleHDImg.setImageAlpha(40);
|
||||||
|
titleFHDImg.setImageAlpha(40);
|
||||||
|
titleHDText.setAlpha(0.2f);
|
||||||
|
titleFHDText.setAlpha(0.2f);
|
||||||
|
} else if (banSelect == BAN_1080) {
|
||||||
|
lineFhd.setTag(false);
|
||||||
|
titleFHDText.setAlpha(0.2f);
|
||||||
|
titleFHDImg.setImageAlpha(20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用系统函数,字符串转换 long -String KB/MB
|
||||||
|
private String formateFileSize(long size) {
|
||||||
|
String fileSize = Formatter.formatFileSize(getContext(), size);
|
||||||
|
return fileSize.substring(0, fileSize.length() - 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态选择
|
||||||
|
*
|
||||||
|
* @param selectClarity
|
||||||
|
*/
|
||||||
|
private void selectClarity(int selectClarity) {
|
||||||
|
switch (selectClarity) {
|
||||||
|
case 0:
|
||||||
|
lineSd.setSelected(true);
|
||||||
|
lineHd.setSelected(false);
|
||||||
|
lineFhd.setSelected(false);
|
||||||
|
iconSd.setVisibility(VISIBLE);
|
||||||
|
iconHd.setVisibility(GONE);
|
||||||
|
iconFhd.setVisibility(GONE);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
lineSd.setSelected(false);
|
||||||
|
lineHd.setSelected(true);
|
||||||
|
lineFhd.setSelected(false);
|
||||||
|
iconSd.setVisibility(GONE);
|
||||||
|
iconHd.setVisibility(VISIBLE);
|
||||||
|
iconFhd.setVisibility(GONE);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
lineSd.setSelected(false);
|
||||||
|
lineHd.setSelected(false);
|
||||||
|
lineFhd.setSelected(true);
|
||||||
|
iconSd.setVisibility(GONE);
|
||||||
|
iconHd.setVisibility(GONE);
|
||||||
|
iconFhd.setVisibility(VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Handler netHandler = new Handler();
|
||||||
|
private Runnable netRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (netSpeeds.size() < 11) {
|
||||||
|
netSpeeds.add(DeviceUtils.getNetSpeed(getContext()));
|
||||||
|
netHandler.postDelayed(netRunnable, 100);
|
||||||
|
} else {
|
||||||
|
long min = Collections.min(netSpeeds);
|
||||||
|
long max = Collections.max(netSpeeds);
|
||||||
|
|
||||||
|
DoubleSummaryStatistics statistics = netSpeeds.stream().mapToDouble(Number::doubleValue).summaryStatistics();
|
||||||
|
netAverage = statistics.getAverage();
|
||||||
|
Log.e("网络速度", "最大值:" + max + " 最小值:" + min + " 平均值:" + netAverage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private List<Long> netSpeeds = new ArrayList<>();
|
||||||
|
private double netAverage = 0;
|
||||||
|
|
||||||
|
private void initDate() {
|
||||||
|
netHandler.postDelayed(netRunnable, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.LiveClassBean;
|
||||||
|
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||||
|
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||||
|
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.ToastUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
public class LiveOpenCustomPopup extends CenterPopupView {
|
||||||
|
//清晰度
|
||||||
|
private int selectClarity;
|
||||||
|
//直播类型
|
||||||
|
private LiveClassBean classBean;
|
||||||
|
//房间类型
|
||||||
|
private LiveRoomTypeBean liveRoomTypeBean;
|
||||||
|
|
||||||
|
private TextView textClarity, textLiveRoomType, textLiveClass, textLiveWishlist, textRobot;
|
||||||
|
|
||||||
|
public LiveOpenCustomPopup setClassBean(LiveClassBean classBean) {
|
||||||
|
this.classBean = classBean;
|
||||||
|
textLiveClass.setText(classBean.getName());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveOpenCustomPopup setLiveRoomTypeBean(LiveRoomTypeBean liveRoomTypeBean) {
|
||||||
|
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||||
|
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveOpenCustomPopup(@NonNull Context context, int selectClarity, LiveClassBean classBean, LiveRoomTypeBean liveRoomTypeBean) {
|
||||||
|
super(context);
|
||||||
|
this.selectClarity = selectClarity;
|
||||||
|
this.classBean = classBean;
|
||||||
|
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.view_live_open;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
textClarity = findViewById(R.id.text_clarity);
|
||||||
|
textLiveRoomType = findViewById(R.id.text_live_room_type);
|
||||||
|
textLiveClass = findViewById(R.id.text_live_class);
|
||||||
|
textLiveWishlist = findViewById(R.id.text_live_wishlist);
|
||||||
|
textRobot = findViewById(R.id.text_robot);
|
||||||
|
if (classBean != null) {
|
||||||
|
textLiveClass.setText(classBean.getName());
|
||||||
|
}
|
||||||
|
if (liveRoomTypeBean != null) {
|
||||||
|
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||||
|
}
|
||||||
|
setSelectClarity(selectClarity);
|
||||||
|
//關閉彈窗
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), () -> dismiss());
|
||||||
|
//開播
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.startLive(liveRoomTypeBean, classBean);
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
//設置直播類型
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_class), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.openLiveClass(classBean);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//設置清晰度
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_clarity), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.selectClarity(selectClarity);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//設置房間類型
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_room_type), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.openLiveRoomType(liveRoomTypeBean);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//打開心願單
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_wishlist), () -> {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.openWishlist();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//設置機器人
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_robot), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.openRobot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectClarity(int selectClarity) {
|
||||||
|
switch (selectClarity) {
|
||||||
|
case 0:
|
||||||
|
textClarity.setText(R.string.standard_clear);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
textClarity.setText(R.string.high_definition);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
textClarity.setText(R.string.ultra_hd);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initDate() {
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()),
|
||||||
|
new HttpCallback<LiveStetUpStatusModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveStetUpStatusModel data) {
|
||||||
|
textLiveWishlist.setText(data.getWishListState() ? R.string.do_set : R.string.not_set);
|
||||||
|
textRobot.setText(data.getAiStateState() ? R.string.robot_yes : R.string.robot_no);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private LiveOpenCallBack callBack;
|
||||||
|
|
||||||
|
public LiveOpenCustomPopup setCallBack(LiveOpenCallBack callBack) {
|
||||||
|
this.callBack = callBack;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface LiveOpenCallBack {
|
||||||
|
//開播
|
||||||
|
void startLive(LiveRoomTypeBean liveRoomTypeBean, LiveClassBean classBean);
|
||||||
|
|
||||||
|
//選擇清晰度
|
||||||
|
void selectClarity(int selectClarity);
|
||||||
|
|
||||||
|
//打開機器人
|
||||||
|
void openRobot();
|
||||||
|
|
||||||
|
//打開直播間類型
|
||||||
|
void openLiveRoomType(LiveRoomTypeBean liveRoomTypeBean);
|
||||||
|
|
||||||
|
//打開直播類型
|
||||||
|
void openLiveClass(LiveClassBean classBean);
|
||||||
|
|
||||||
|
//打開心願單
|
||||||
|
void openWishlist();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.RobotMessageAdapter;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.event.LiveRobotMessageEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveRobotMessageCustomPopup extends BottomPopupView {
|
||||||
|
private static String TAG = "AI机器人";
|
||||||
|
private RecyclerView robotMessages;
|
||||||
|
private RobotMessageAdapter robotMessageAdapter;
|
||||||
|
|
||||||
|
private EditText robotNameSetting;
|
||||||
|
private TextView robotTime;
|
||||||
|
private String robotTimeString = "";
|
||||||
|
|
||||||
|
public LiveRobotMessageCustomPopup(@NonNull Context context, String robotTime) {
|
||||||
|
super(context);
|
||||||
|
this.robotTimeString = robotTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotMessageCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_live_robot_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
Bus.getOn(this);
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onLiveRobotMessageEvent(LiveRobotMessageEvent event) {
|
||||||
|
if (event.getIndex() > 0) {
|
||||||
|
robotMessageAdapter.removeData(event.getIndex());
|
||||||
|
} else {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Bus.getOff(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
robotMessages = (RecyclerView) findViewById(R.id.robot_messages);
|
||||||
|
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||||
|
robotTime = findViewById(R.id.robot_time);
|
||||||
|
robotMessageAdapter = new RobotMessageAdapter();
|
||||||
|
robotMessages.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||||
|
robotMessages.setAdapter(robotMessageAdapter);
|
||||||
|
robotTime.setText(robotTimeString);
|
||||||
|
findViewById(R.id.bt_cancel).setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
robotTime.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
robotTime.setVisibility(GONE);
|
||||||
|
robotNameSetting.setVisibility(VISIBLE);
|
||||||
|
robotNameSetting.setText(robotTime.getText().toString());
|
||||||
|
//输入框,获取焦点 不然无法弹出键盘
|
||||||
|
robotNameSetting.requestFocus();
|
||||||
|
//键盘输入法管理器
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.showSoftInput(robotNameSetting, 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
String time = robotNameSetting.getText().toString();
|
||||||
|
int timeInt = Integer.parseInt(time);
|
||||||
|
if (timeInt > 5) {
|
||||||
|
// 修改助手名字
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.setAiRobotDate("ai_time", time, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
robotNameSetting.setVisibility(GONE);
|
||||||
|
robotTime.setVisibility(VISIBLE);
|
||||||
|
robotTime.setText(robotNameSetting.getText().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(R.string.robot_minimum_interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//添加消息语
|
||||||
|
findViewById(R.id.robot_add_content).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.asCustom(new InputCustomPopup(getContext(), R.string.automatic_message_sending).setListener(new InputCustomPopup.InputCustomListener() {
|
||||||
|
@Override
|
||||||
|
public void onConfirm(String text) {
|
||||||
|
//添加消息语
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.addAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, text, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDate() {
|
||||||
|
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.getAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, new HttpCallback<List<LiveAiRobotBean.Message>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<LiveAiRobotBean.Message> data) {
|
||||||
|
Log.i(TAG, "onSuccess: " + data.size());
|
||||||
|
for (LiveAiRobotBean.Message message : data) {
|
||||||
|
Log.i(TAG, "onSuccess: message=" + message.toString());
|
||||||
|
}
|
||||||
|
robotMessageAdapter.setDataAll(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.RobotSayHelloAdapter;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.event.LiveRobotSayHelloEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveRobotSayHelloCustomPopup extends BottomPopupView {
|
||||||
|
private RecyclerView robotMessages;
|
||||||
|
private RobotSayHelloAdapter robotMessageAdapter;
|
||||||
|
private static String TAG = "AI机器人";
|
||||||
|
|
||||||
|
public LiveRobotSayHelloCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_live_robot_say_hello;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
Bus.getOn(this);
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onLiveRobotSayHelloEvent(LiveRobotSayHelloEvent event) {
|
||||||
|
if (event.getIndex() > 0) {
|
||||||
|
robotMessageAdapter.removeData(event.getIndex());
|
||||||
|
} else {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Bus.getOff(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
robotMessages = (RecyclerView) findViewById(R.id.robot_messages);
|
||||||
|
robotMessageAdapter = new RobotSayHelloAdapter();
|
||||||
|
robotMessages.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||||
|
robotMessages.setAdapter(robotMessageAdapter);
|
||||||
|
findViewById(R.id.bt_cancel).setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//添加消息语
|
||||||
|
findViewById(R.id.robot_add_content).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.asCustom(new InputCustomPopup(getContext(), R.string.automatic_greeting_setting).setListener(new InputCustomPopup.InputCustomListener() {
|
||||||
|
@Override
|
||||||
|
public void onConfirm(String text) {
|
||||||
|
//添加消息语
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.addAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, text, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initDate() {
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.getAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, new HttpCallback<List<LiveAiRobotBean.Message>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<LiveAiRobotBean.Message> data) {
|
||||||
|
Log.i(TAG, "onSuccess 自动打招呼 : " + data.size());
|
||||||
|
for (LiveAiRobotBean.Message message : data) {
|
||||||
|
Log.i(TAG, "onSuccess: message=" + message.toString());
|
||||||
|
}
|
||||||
|
robotMessageAdapter.setDataAll(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BasePopupView;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
public class LiveRobotSettingCustomPopup extends BottomPopupView implements View.OnClickListener {
|
||||||
|
private static String TAG = "AI机器人";
|
||||||
|
private EditText robotNameSetting;
|
||||||
|
private AppCompatTextView automaticGreetingNumber, automaticMessageNumber;
|
||||||
|
private TextView robotNameText;
|
||||||
|
private String time = "";
|
||||||
|
private ImageView robotState;
|
||||||
|
|
||||||
|
private int robotStateInt = 1;
|
||||||
|
|
||||||
|
public int getRobotStateInt() {
|
||||||
|
return robotStateInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotSettingCustomPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_live_robot_setting;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
intiView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void intiView() {
|
||||||
|
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||||
|
robotNameText = findViewById(R.id.robot_name_text);
|
||||||
|
robotState = findViewById(R.id.robot_state);
|
||||||
|
automaticGreetingNumber = findViewById(R.id.automatic_greeting_number);
|
||||||
|
automaticMessageNumber = findViewById(R.id.automatic_message_number);
|
||||||
|
findViewById(R.id.automatic_message_sending).setOnClickListener(this);
|
||||||
|
findViewById(R.id.automatic_greeting_setting).setOnClickListener(this);
|
||||||
|
robotNameText.setOnClickListener(this);
|
||||||
|
robotState.setOnClickListener(this);
|
||||||
|
|
||||||
|
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
|
// 修改助手名字
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
robotNameSetting.setVisibility(GONE);
|
||||||
|
robotNameText.setVisibility(VISIBLE);
|
||||||
|
robotNameText.setText(robotNameSetting.getText().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int viewID = v.getId();
|
||||||
|
if (viewID == R.id.automatic_message_sending) {
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.setPopupCallback(new XPopupCallback() {
|
||||||
|
@Override
|
||||||
|
public void onCreated(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeShow(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShow(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(BasePopupView popupView) {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeDismiss(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBackPressed(BasePopupView popupView) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClickOutside(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asCustom(new LiveRobotMessageCustomPopup(getContext(), time))
|
||||||
|
.show();
|
||||||
|
} else if (viewID == R.id.robot_name_text) {
|
||||||
|
robotNameText.setVisibility(GONE);
|
||||||
|
robotNameSetting.setVisibility(VISIBLE);
|
||||||
|
robotNameSetting.setText(robotNameText.getText().toString());
|
||||||
|
//输入框,获取焦点 不然无法弹出键盘
|
||||||
|
robotNameSetting.requestFocus();
|
||||||
|
//键盘输入法管理器
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.showSoftInput(robotNameSetting, 0);
|
||||||
|
} else if (viewID == R.id.robot_state) {
|
||||||
|
int state = 0;
|
||||||
|
if (robotStateInt == 1) {
|
||||||
|
state = 0;
|
||||||
|
} else {
|
||||||
|
state = 1;
|
||||||
|
}
|
||||||
|
// 修改助手名字
|
||||||
|
int finalState = state;
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.setAiRobotDate("ai_state", String.valueOf(state), new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
if (finalState == 1) {
|
||||||
|
robotState.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
robotStateInt = 1;
|
||||||
|
} else {
|
||||||
|
robotState.setImageResource(R.mipmap.special_icon_off);
|
||||||
|
robotStateInt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (viewID == R.id.automatic_greeting_setting) {
|
||||||
|
new XPopup.Builder(getContext())
|
||||||
|
.setPopupCallback(new XPopupCallback() {
|
||||||
|
@Override
|
||||||
|
public void onCreated(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeShow(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShow(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(BasePopupView popupView) {
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeDismiss(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBackPressed(BasePopupView popupView) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClickOutside(BasePopupView popupView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asCustom(new LiveRobotSayHelloCustomPopup(getContext()))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDate() {
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.getAiRobotStatus(new com.yunbao.common.http.base.HttpCallback<LiveAiRobotBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveAiRobotBean data) {
|
||||||
|
robotNameText.setText(data.getName());
|
||||||
|
automaticGreetingNumber.setText(String.valueOf(data.getAutoSeyHiNumber()));
|
||||||
|
automaticMessageNumber.setText(String.valueOf(data.getAutoRequestFollowNumber()));
|
||||||
|
time = String.valueOf(data.getTime());
|
||||||
|
robotStateInt = data.getStatus();
|
||||||
|
if (data.getStatus() == 1) {
|
||||||
|
robotState.setImageResource(R.mipmap.special_icon_on);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
initListType1();
|
||||||
|
initListType2();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initListType1() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initListType2() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
|
||||||
|
public class LiveSystemMessageViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private TextView titleText, timeText, contextLayout, toView;
|
||||||
|
private CardView bannerCard;
|
||||||
|
private ImageView bannerImage;
|
||||||
|
|
||||||
|
public LiveSystemMessageViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
titleText = itemView.findViewById(R.id.title_text);
|
||||||
|
timeText = itemView.findViewById(R.id.time_text);
|
||||||
|
contextLayout = itemView.findViewById(R.id.context_layout);
|
||||||
|
toView = itemView.findViewById(R.id.to_view);
|
||||||
|
bannerCard = itemView.findViewById(R.id.banner_card);
|
||||||
|
bannerImage = itemView.findViewById(R.id.banner_image);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViewData(ListInfoMessageModel model) {
|
||||||
|
titleText.setText(model.getTitle());
|
||||||
|
timeText.setText(model.getLastDate("1"));
|
||||||
|
if (TextUtils.isEmpty(model.getBanner())) {
|
||||||
|
bannerCard.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
bannerCard.setVisibility(View.VISIBLE);
|
||||||
|
ImgLoader.display(itemView.getContext(), model.getBanner(), bannerImage);
|
||||||
|
}
|
||||||
|
contextLayout.setText(model.getContent());
|
||||||
|
if (TextUtils.isEmpty(model.getLink())) {
|
||||||
|
toView.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
toView.setVisibility(View.VISIBLE);
|
||||||
|
toView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
RouteUtil.forwardLiveZhuangBanActivity(model.getLink(), false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.event.LiveRobotMessageEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
|
||||||
|
public class RobotMessageViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private TextView serialNumber, messageText;
|
||||||
|
private ImageView btnDelete;
|
||||||
|
|
||||||
|
public RobotMessageViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
serialNumber = itemView.findViewById(R.id.serial_number);
|
||||||
|
messageText = itemView.findViewById(R.id.message_text);
|
||||||
|
btnDelete = itemView.findViewById(R.id.btn_delete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(LiveAiRobotBean.Message message, int index) {
|
||||||
|
serialNumber.setText(String.valueOf(index));
|
||||||
|
messageText.setText(message.getContent());
|
||||||
|
btnDelete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LiveNetManager.get(itemView.getContext())
|
||||||
|
.delAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, message.getId(), new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Bus.get().post(new LiveRobotMessageEvent().setIndex(index - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
messageText.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
new XPopup.Builder(itemView.getContext())
|
||||||
|
.asCustom(new InputCustomPopup(itemView.getContext(), message.getContent(), R.string.automatic_message_sending).setListener(new InputCustomPopup.InputCustomListener() {
|
||||||
|
@Override
|
||||||
|
public void onConfirm(String text) {
|
||||||
|
LiveNetManager.get(itemView.getContext())
|
||||||
|
.updateAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, message.getId(), text, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Bus.get().post(new LiveRobotMessageEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.event.LiveRobotSayHelloEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
public class RobotSayHelloViewHoler extends RecyclerView.ViewHolder {
|
||||||
|
private TextView serialNumber, messageText;
|
||||||
|
private ImageView btnDelete;
|
||||||
|
|
||||||
|
public RobotSayHelloViewHoler(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
serialNumber = itemView.findViewById(R.id.serial_number);
|
||||||
|
messageText = itemView.findViewById(R.id.message_text);
|
||||||
|
btnDelete = itemView.findViewById(R.id.btn_delete);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setData(LiveAiRobotBean.Message message, int index) {
|
||||||
|
serialNumber.setText(String.valueOf(index));
|
||||||
|
messageText.setText(message.getContent());
|
||||||
|
btnDelete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LiveNetManager.get(itemView.getContext())
|
||||||
|
.delAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, message.getId(), new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Bus.get().post(new LiveRobotSayHelloEvent().setIndex(index - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
messageText.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
new XPopup.Builder(itemView.getContext())
|
||||||
|
.asCustom(new InputCustomPopup(itemView.getContext(), message.getContent(), R.string.automatic_greeting_setting).setListener(new InputCustomPopup.InputCustomListener() {
|
||||||
|
@Override
|
||||||
|
public void onConfirm(String text) {
|
||||||
|
LiveNetManager.get(itemView.getContext())
|
||||||
|
.updateAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, message.getId(), text, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Bus.get().post(new LiveRobotSayHelloEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
12
common/src/main/res/drawable/app_dialog_bg.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="10dp"
|
||||||
|
android:bottomRightRadius="10dp"
|
||||||
|
android:topLeftRadius="10dp"
|
||||||
|
android:topRightRadius="10dp" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1.2dp"
|
||||||
|
android:color="#FFAE05" />
|
||||||
|
<corners android:radius="21dp" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#FFC621" />
|
||||||
|
<corners android:radius="21dp" />
|
||||||
|
</shape>
|
||||||
9
common/src/main/res/drawable/background_81c16d.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?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="11.67dp" />
|
||||||
|
<solid android:color="#81C16D" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
5
common/src/main/res/drawable/bg_apk_update_btn.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="13.33dp" />
|
||||||
|
<solid android:color="#0D0D0D" />
|
||||||
|
</shape>
|
||||||
15
common/src/main/res/drawable/bg_btn_definition.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
<solid android:color="#20FFB2B2" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_selected="false">
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
<solid android:color="#407792D0" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
5
common/src/main/res/drawable/bg_live_anchor.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="13dp"/>
|
||||||
|
<solid android:color="#b3000000"/>
|
||||||
|
</shape>
|
||||||
7
common/src/main/res/drawable/bg_live_anchor_message.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="8dp"
|
||||||
|
android:topRightRadius="8dp" />
|
||||||
|
<solid android:color="#F4F7FC" />
|
||||||
|
</shape>
|
||||||
10
common/src/main/res/drawable/bg_robot_shape.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item >
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="13.33dp"/>
|
||||||
|
<solid android:color="#00B8EB"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
BIN
common/src/main/res/drawable/icon_robot.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
21
common/src/main/res/drawable/progress_bg.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!--设置ProgressBar背景色-->
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
<shape>
|
||||||
|
<!--设置ProgressBar进度条圆角半径-->
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<solid android:color="#E6E6E6" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!--设置ProgressBar进度条颜色-->
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<clip android:clipOrientation="horizontal">
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<solid android:color="#0D0D0D" />
|
||||||
|
</shape>
|
||||||
|
</clip>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
5
common/src/main/res/drawable/selector_protocol_check.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@mipmap/icon_protocol_check" android:state_selected="true" />
|
||||||
|
<item android:drawable="@mipmap/icon_protocol_uncheck" android:state_selected="false" />
|
||||||
|
</selector>
|
||||||
@@ -67,5 +67,5 @@
|
|||||||
<WebView
|
<WebView
|
||||||
android:id="@+id/webView"
|
android:id="@+id/webView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="match_parent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
83
common/src/main/res/layout/apk_update_custom_popup.xml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="310dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="310dp"
|
||||||
|
android:src="@mipmap/update_tip_box" />
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:layout_marginTop="135dp"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/update_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="更新內容:
|
||||||
|
1、內容內容內容內容內容內容
|
||||||
|
2、內容內容內容內容內容內容
|
||||||
|
3、內容內容內容內容內容
|
||||||
|
4、內容內容內容內容內容"
|
||||||
|
android:textColor="#1B1B1B"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/version_immediate_use"
|
||||||
|
android:layout_width="153.33dp"
|
||||||
|
android:layout_height="26.67dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:background="@drawable/bg_apk_update_btn"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/version_immediate_use"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/update_line"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="9dp"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="0"
|
||||||
|
android:progressDrawable="@drawable/progress_bg" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:text="@string/updating"
|
||||||
|
android:textColor="#8C8C8C"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/dialog_close"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginTop="60dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:src="@mipmap/icon_close_tip" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:id="@+id/system_notice"
|
android:id="@+id/system_notice"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
21
common/src/main/res/layout/dialog_live_anchor_message.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="400dp"
|
||||||
|
android:background="@drawable/bg_live_anchor_message"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="18dp"
|
||||||
|
android:text="@string/message"
|
||||||
|
android:textColor="@color/black3"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/live_message"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</LinearLayout>
|
||||||
143
common/src/main/res/layout/dialog_live_clarity.xml
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="249dp"
|
||||||
|
android:background="@drawable/bg_live_tota"
|
||||||
|
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/line_sd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="137dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_btn_definition"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/icon_sd"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:src="@mipmap/icon_selected" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sd"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="39dp"
|
||||||
|
android:src="@mipmap/icon_sd" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sd_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/sd"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="@string/standard_clear"
|
||||||
|
android:textColor="#F6F7FB"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/line_hd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="137dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_btn_definition"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/icon_hd"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:src="@mipmap/icon_selected" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/hd"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="39dp"
|
||||||
|
android:src="@mipmap/icon_hd" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/hd_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/hd"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="@string/high_definition"
|
||||||
|
android:textColor="#F6F7FB"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/line_fhd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="137dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_btn_definition"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/icon_fhd"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:src="@mipmap/icon_selected" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/fhd"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="39dp"
|
||||||
|
android:src="@mipmap/icon_fhd" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/fhd_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/fhd"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="@string/ultra_hd"
|
||||||
|
android:textColor="#F6F7FB"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tips"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginBottom="30dp"
|
||||||
|
android:text="@string/clarity_hint"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,307 +1,458 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/bg_live_tota"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<TextView
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginTop="30dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/value_added_benefits"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:background="@drawable/bg_live_anchor"
|
||||||
android:paddingEnd="16dp">
|
android:gravity="center"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/live_tool_wish"
|
android:layout_width="6dp"
|
||||||
|
android:layout_height="6dp"
|
||||||
|
app:cardBackgroundColor="#FF4E4E"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="0dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_marginStart="5dp"
|
||||||
android:orientation="vertical">
|
android:text="00:00"
|
||||||
|
android:textColor="@color/white"
|
||||||
<ImageView
|
android:textSize="12sp" />
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_xinyuandan" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_wishlist"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/live_tool_prank"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="28dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_zhenggu" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_zg"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/live_tool_wks"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="28dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_weekstar" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_wks"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
|
<View
|
||||||
<TextView
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="1dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="1" />
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:text="@string/live_config"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/broadcast_data"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:background="@drawable/bg_live_anchor"
|
||||||
android:layout_marginBottom="20dp"
|
android:gravity="center_vertical"
|
||||||
android:paddingEnd="16dp">
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
|
||||||
<LinearLayout
|
android:paddingEnd="6dp"
|
||||||
android:id="@+id/live_tool_beauty"
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:src="@mipmap/live_icon_data" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_marginStart="6dp"
|
||||||
android:orientation="vertical">
|
android:text="@string/broadcast_data"
|
||||||
|
android:textColor="@color/white"
|
||||||
<ImageView
|
android:textSize="10sp" />
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_beauty" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_beauty"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/live_tool_camera"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="23dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_live_ready_camera" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_camera"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/live_tool_leave"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="23dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/live_tool_leave_img"
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_leave" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/live_tool_leave_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:text="@string/live_zslk"
|
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</HorizontalScrollView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:text="@string/basic_tools"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
|
|
||||||
android:scrollbars="none">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/message_linear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_live_anchor"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:src="@mipmap/live_icon_news" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:text="@string/message"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_live_tota"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="30dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:text="@string/value_added_benefits"
|
||||||
android:paddingEnd="16dp">
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/live_tool_one_pk"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_marginStart="16dp"
|
||||||
android:orientation="vertical">
|
android:layout_marginTop="10dp"
|
||||||
|
android:paddingEnd="16dp">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="40dp"
|
android:id="@+id/anchor_task"
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_danrenpk" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:gravity="center"
|
||||||
android:text="@string/live_link_pk"
|
android:orientation="vertical">
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/live_more_icon_task" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/anchor_task"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_wish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_xinyuandan" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_wishlist"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_prank"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_zhenggu" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_zg"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_wks"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_weekstar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_wks"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_robot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/live_more_icon_robot" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/robot_setup"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="@string/live_config"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/live_tool_multi_pk"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="23dp"
|
android:layout_marginStart="16dp"
|
||||||
android:gravity="center"
|
android:layout_marginTop="10dp"
|
||||||
android:orientation="vertical">
|
android:layout_marginBottom="20dp"
|
||||||
|
android:paddingEnd="16dp">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="40dp"
|
android:id="@+id/live_tool_beauty"
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_duorenpk" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:gravity="center"
|
||||||
android:text="@string/live_dr"
|
android:orientation="vertical">
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/live_tool_random_pk"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="23dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@mipmap/icon_live_random_pk" />
|
android:src="@mipmap/icon_beauty" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_beauty"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_camera"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginStart="23dp"
|
||||||
android:text="@string/live_random"
|
android:gravity="center"
|
||||||
android:textColor="#FF9A9A9A"
|
android:orientation="vertical">
|
||||||
android:textSize="12sp" />
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_live_ready_camera" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_camera"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_leave"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="23dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/live_tool_leave_img"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_leave" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_tool_leave_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_zslk"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:text="@string/basic_tools"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/live_tool_mic"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="23dp"
|
android:layout_marginStart="16dp"
|
||||||
android:gravity="center"
|
android:layout_marginTop="10dp"
|
||||||
android:orientation="vertical"
|
android:layout_marginBottom="20dp"
|
||||||
android:visibility="visible">
|
android:paddingEnd="16dp">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="40dp"
|
android:id="@+id/live_tool_one_pk"
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@mipmap/icon_microphone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:gravity="center"
|
||||||
android:text="@string/live_mic"
|
android:orientation="vertical">
|
||||||
android:textColor="#FF9A9A9A"
|
|
||||||
android:textSize="12sp" />
|
<ImageView
|
||||||
</LinearLayout>
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_danrenpk" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_link_pk"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_multi_pk"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="23dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_duorenpk" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_dr"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_random_pk"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="23dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_live_random_pk" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_random"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/live_tool_mic"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="23dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_microphone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/live_mic"
|
||||||
|
android:textColor="#FF9A9A9A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
174
common/src/main/res/layout/dialog_live_robot_message.xml
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="400dp"
|
||||||
|
android:background="#000002">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/bt_cancel"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginTop="7.76dp"
|
||||||
|
android:layout_marginBottom="6.33dp"
|
||||||
|
android:src="@mipmap/icon_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="6.67dp"
|
||||||
|
android:text="@string/automatic_message_sending"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/robot_add_content"
|
||||||
|
android:layout_width="67.67dp"
|
||||||
|
android:layout_height="23.33dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="11dp"
|
||||||
|
android:background="@drawable/background_81c16d"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/robot_add_content"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/line1"
|
||||||
|
android:layout_marginStart="10.33dp"
|
||||||
|
android:layout_marginEnd="10.67dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="8.67dp"
|
||||||
|
android:paddingBottom="7.67dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="26dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="13.67dp"
|
||||||
|
android:src="@mipmap/icon_tip" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8.33dp"
|
||||||
|
android:text="@string/robot_add_content_hint1"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8.33dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/robot_add_content_hint2"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/robot_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/line2"
|
||||||
|
android:layout_marginTop="11dp"
|
||||||
|
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:text="@string/robot_automatic_speech_interval"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:text="@string/robot_minimum_interval"
|
||||||
|
android:textColor="#B3B3B3"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/robot_time"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/robot_name_setting"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:gravity="center"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/robot_messages"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/robot_name" />
|
||||||
|
</RelativeLayout>
|
||||||
106
common/src/main/res/layout/dialog_live_robot_say_hello.xml
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="400dp"
|
||||||
|
android:background="#000002">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/bt_cancel"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginTop="7.76dp"
|
||||||
|
android:layout_marginBottom="6.33dp"
|
||||||
|
android:src="@mipmap/icon_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="6.67dp"
|
||||||
|
android:text="@string/automatic_greeting_setting"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/robot_add_content"
|
||||||
|
android:layout_width="67.67dp"
|
||||||
|
android:layout_height="23.33dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="11dp"
|
||||||
|
android:background="@drawable/background_81c16d"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/robot_add_content"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/line1"
|
||||||
|
android:layout_marginStart="10.33dp"
|
||||||
|
android:layout_marginEnd="10.67dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="8.67dp"
|
||||||
|
android:paddingBottom="7.67dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="26dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="13.67dp"
|
||||||
|
android:src="@mipmap/icon_tip" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8.33dp"
|
||||||
|
android:text="@string/robot_add_content_hint3"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8.33dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/robot_add_content_hint4"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/robot_messages"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/line2" />
|
||||||
|
</RelativeLayout>
|
||||||
266
common/src/main/res/layout/dialog_live_robot_setting.xml
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#000"
|
||||||
|
android:paddingBottom="23dp">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView6"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:text="@string/speech_robot_setup"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/robot_status"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/textView6"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/robot_switch"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/robot_state"
|
||||||
|
android:layout_width="46dp"
|
||||||
|
android:layout_height="23dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
app:srcCompat="@mipmap/special_icon_off" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/robot_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/robot_status"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:text="@string/robot_name_setting"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:text="@string/word_limit"
|
||||||
|
android:textColor="#B3B3B3"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/robot_name_setting"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:gravity="center"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/robot_name_text"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:gravity="center"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/robot_say_hello"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/robot_name"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:text="@string/automatic_greeting_setting"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:text="@string/configured_items"
|
||||||
|
android:textColor="#B3B3B3"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/automatic_greeting_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4.67dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:textColor="#00B8EB"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/automatic_greeting_setting"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_robot_shape"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/robot_go_setting"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/robot_message"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/robot_say_hello"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:text="@string/automatic_message_sending"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:text="@string/configured_items"
|
||||||
|
android:textColor="#B3B3B3"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/automatic_message_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4.67dp"
|
||||||
|
android:layout_marginTop="3.67dp"
|
||||||
|
android:textColor="#00B8EB"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/automatic_message_sending"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/bg_robot_shape"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/robot_go_setting"
|
||||||
|
android:textColor="#FFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/robot_message"
|
||||||
|
android:layout_marginStart="10.33dp"
|
||||||
|
android:layout_marginTop="29dp"
|
||||||
|
android:layout_marginEnd="10.67dp"
|
||||||
|
android:background="@drawable/bg_prank_coin"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="8.67dp"
|
||||||
|
android:paddingBottom="7.67dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="13.67dp"
|
||||||
|
android:src="@mipmap/icon_tip" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8.33dp"
|
||||||
|
android:text="@string/robot_hint"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@+id/ivIcon"
|
android:layout_toRightOf="@+id/ivIcon"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/app_dialog_title_color"
|
android:textColor="#333333"
|
||||||
android:text="更新中"/>
|
android:text="更新中"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:lineSpacingMultiplier="1.2"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:text="正在下載中......"
|
android:text="正在下載中......"
|
||||||
android:textColor="@color/app_dialog_content_color"
|
android:textColor="#333333"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
|||||||
18
common/src/main/res/layout/dialog_toast.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_loading_dialog"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="@string/loading"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_margin="15dp"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
71
common/src/main/res/layout/hint_custom_popup.xml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="270dp"
|
||||||
|
android:layout_height="180dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardCornerRadius="18dp"
|
||||||
|
app:cardElevation="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/ultra_hd_hint"
|
||||||
|
android:textColor="#161616"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/contest"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:text="@string/ultra_hd_hint2"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_open_cancel"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:background="@drawable/backgroud_live_open_lfet"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/back"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_open_ok"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@drawable/backgroud_live_open_right"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/stick_to_choice"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
69
common/src/main/res/layout/input_custom_popup.xml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_dialog"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/dialog_tip"
|
||||||
|
android:textColor="#161616"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/bg_dialog_input"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginBottom="23dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_cancel"
|
||||||
|
android:layout_width="87dp"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
android:background="@drawable/backgroud_live_open_lfet"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/cancel"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_confirm"
|
||||||
|
|
||||||
|
android:layout_width="87dp"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:layout_marginLeft="7dp"
|
||||||
|
android:background="@mipmap/tipbox_btn_orange"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
245
common/src/main/res/layout/view_live_open.xml
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="280dp"
|
||||||
|
android:layout_height="340dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/confirmation_of_broadcast"
|
||||||
|
android:textColor="#161616"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line_clarity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="29dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:layout_marginEnd="29dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/clarity"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_clarity"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/clarity"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:src="@mipmap/icon_more_open" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line_live_room_type"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="29dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="29dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/live_room_type"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_live_room_type"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/clarity"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:src="@mipmap/icon_more_open" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line_live_class"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="29dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="29dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/live_class1"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_live_class"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/live_class1"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:src="@mipmap/icon_more_open" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line_live_wishlist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="29dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="29dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/live_wishlist"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_live_wishlist"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/clarity"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:src="@mipmap/icon_more_open" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/line_robot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="29dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="29dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/robot"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_robot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/clarity"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:src="@mipmap/icon_more_open" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_open_cancel"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:background="@drawable/backgroud_live_open_lfet"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/back"
|
||||||
|
android:textColor="#FFC621"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/live_open_ok"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@drawable/backgroud_live_open_right"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/broadcast"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
94
common/src/main/res/layout/view_live_system_message.xml
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="15dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="通知標題標題通知標題標題"
|
||||||
|
android:textColor="#ff161616"
|
||||||
|
android:textSize="17sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/time_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginTop="19dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:text="2-24 17:00"
|
||||||
|
android:textColor="#ff8c8c8c"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/banner_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="102dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/banner_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/context_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:text="內容內容內容內容內容內容內容內容內容內容內容
|
||||||
|
內容內容內容內容內容內容內容內容內容內容內容內容內容內容內容
|
||||||
|
內容內容內容內容內容內容內容內容內容內容內容內容
|
||||||
|
內容內容內容內容內容內容內容。"
|
||||||
|
android:textColor="#B1B1B1"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/to_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:drawableEnd="@mipmap/icon_more"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/click_to_view"
|
||||||
|
android:textColor="#ff8c8c8c"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
43
common/src/main/res/layout/view_robot_message.xml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_prank_coin">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/serial_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="13dp"
|
||||||
|
android:text="1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/message_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="19dp"
|
||||||
|
android:text="测试文字"
|
||||||
|
android:textColor="#80CEF2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btn_delete"
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="9dp"
|
||||||
|
android:layout_marginEnd="10.67dp"
|
||||||
|
android:src="@mipmap/icon_close" />
|
||||||
|
</LinearLayout>
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 18 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_close.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_close_tip.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_fhd.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_hd.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 955 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 603 B |
BIN
common/src/main/res/mipmap-xxhdpi/icon_more_open.png
Normal file
|
After Width: | Height: | Size: 632 B |
BIN
common/src/main/res/mipmap-xxhdpi/icon_protocol_check.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_protocol_uncheck.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_robot.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_sd.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |