Compare commits

..

2 Commits

Author SHA1 Message Date
18401019693
283de1047c 悬浮窗关闭 2022-11-01 16:12:16 +08:00
18401019693
06079c7e9c 红点通知 2022-11-01 14:47:58 +08:00
285 changed files with 4277 additions and 10966 deletions

View File

@@ -71,7 +71,7 @@ public class FaceManager implements SensorEventListener {
* 配置美颜SDK
*/
public void initFURender(Context context) {
initFaceUnity(context);
mFURenderer = FURenderer.getInstance();
mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE);
mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT);
@@ -105,11 +105,9 @@ public class FaceManager implements SensorEventListener {
}
});
}
public void loadConfig(){
initFaceBeauty();
}
public void initFaceBeauty() {
FaceBeautyDataFactory faceBeautyDataFactory;
faceBeautyDataFactory = new FaceBeautyDataFactory();
@@ -279,7 +277,6 @@ public class FaceManager implements SensorEventListener {
} catch (Exception e) {
e.printStackTrace();
}
isInit = false;
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FF8D41</color>
<color name="colorPrimaryDark">#FF8D41</color>
<color name="colorAccent">#FF8D41</color>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<!--fulive demo 主配色-->
<color name="primary_background">#050F14</color>

View File

@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'img-optimizer'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.alibaba.arouter'
android {
dexOptions {
jumboMode = true

View File

@@ -81,8 +81,7 @@
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<!-- Android11新增 -->
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<application
android:name="com.shayu.phonelive.AppContext"
android:allowBackup="true"

View File

@@ -28,7 +28,6 @@ import com.fm.openinstall.OpenInstall;
import com.google.firebase.FirebaseApp;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.shayu.phonelive.utils.LogUtils;
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
@@ -138,7 +137,6 @@ public class AppContext extends CommonAppContext {
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
registerError();
registerFirebaseCrash();
LogUtils.start(this);
sInstance = this;
L.setDeBug(BuildConfig.DEBUG);
AppEventsLogger.activateApp(this);
@@ -270,11 +268,10 @@ public class AppContext extends CommonAppContext {
mSocketHandler.sendMessage(msg);
}
}
});
configSPApp();
//初始化美颜SDK
// FaceManager.initFaceUnity(this);
FaceManager.initFaceUnity(this);
}
/**

View File

@@ -3,8 +3,6 @@ package com.shayu.phonelive.activity;
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import android.Manifest;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@@ -23,7 +21,6 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationManagerCompat;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent;
@@ -50,7 +47,6 @@ import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DownloadUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LogUtil;
@@ -144,7 +140,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
};
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
LogUtil.uploadErrorLog(AppContext.sInstance);
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
}

View File

@@ -2,9 +2,7 @@ package com.shayu.phonelive.utils;
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -19,7 +17,6 @@ import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.ImageView;
@@ -37,8 +34,6 @@ import com.makeramen.roundedimageview.RoundedImageView;
import com.shayu.phonelive.activity.LauncherActivity;
import com.yunbao.common.bean.NotificationMsgBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.main.activity.MainActivity;
import org.json.JSONException;
@@ -86,20 +81,6 @@ public class CustomMessageReceiver extends PushMessageReceiver {
@Override
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
if(!SpUtil.getInstance().getBooleanValue("NOTIFICATION")){
DialogUitl.showSimpleDialog(context, "应用需要通知权限", new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
Intent intent = new Intent();
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
intent.putExtra("app_package", context.getPackageName());
intent.putExtra("app_uid", context.getApplicationInfo().uid);
// for Android 8 and above
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
context.startActivity(intent);
}
});
}
if (notificationMessage.getExtra() == null) {
msg.setImg("" + notificationMessage.getSenderPortrait());
msg.setTitle(notificationMessage.getPushTitle());

View File

@@ -1,89 +0,0 @@
package com.shayu.phonelive.utils;
import static java.text.DateFormat.DEFAULT;
import android.content.Context;
import com.yunbao.common.CommonAppConfig;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.Objects;
public class LogUtils {
/**
* 采集所有日志
*/
public static void start(Context context) {
new Thread(new Runnable() {
@Override
public void run() {
try {
String[] exec = new String[]{"logcat", "-c"};
Runtime.getRuntime().exec(exec).waitFor();
exec = new String[]{"logcat", "-v", "UTC", "-D"};
Process process = Runtime.getRuntime().exec(exec);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
PrintWriter writer = null;
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
if (dir.listFiles() != null) {
for (File file : dir.listFiles()) {
if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) {
String fileName = file.getName().replace(".log", "").split("_")[1];
if (isDelLog(fileName)) {
file.delete();
}
}
}
}
File saveFile = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".log");
FileOutputStream os = new FileOutputStream(saveFile, true);
writer = new PrintWriter(os);
while ((line = bufferedReader.readLine()) != null) {
writer.append(line).write("\n");
}
writer.flush();
writer.close();
exec = new String[]{"logcat", "-c"};
Runtime.getRuntime().exec(exec).waitFor();
bufferedReader.close();
start(context);
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
/**
* 判断是否是要删除的日志
**/
private static boolean isDelLog(String time) {
try {
Calendar timeCal = Calendar.getInstance(Locale.CHINA);
timeCal.setTime(Objects.requireNonNull(SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).parse(time)));
Calendar calendar = Calendar.getInstance(Locale.CHINA);
calendar.setTime(new Date());
calendar.add(Calendar.DATE, -3);
return calendar.after(timeCal);
} catch (ParseException e) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -22,7 +22,6 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath "com.alibaba:arouter-register:1.0.2"
}

View File

@@ -188,6 +188,4 @@ dependencies {
api 'com.github.princekin-f:EasyFloat:2.0.4'
api files('libs/Msc.jar')
api 'com.github.li-xiaojun:XPopup:2.9.1'
}

View File

@@ -168,8 +168,6 @@ public class Constants {
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
public static final String SUPER_VISION = "supervision";//超级发言警告
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
//游戏socket
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花

View File

@@ -10,7 +10,6 @@ import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
@@ -359,15 +358,4 @@ public abstract class AbsActivity extends AppCompatActivity {
return result;
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
Log.i("memory", "onTrimMemory: " + level);
switch (level) {
case TRIM_MEMORY_RUNNING_CRITICAL://内存低值危险值
break;
case TRIM_MEMORY_RUNNING_LOW://内存过低
break;
}
}
}

View File

@@ -7,9 +7,12 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
@@ -20,22 +23,16 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import androidx.annotation.RequiresApi;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.R;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.utils.AndroidBug5497Workaround;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* Created by cxf on 2018/9/25.
*/
@@ -139,7 +136,7 @@ public class WebViewActivity extends AbsActivity {
}
});
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
@@ -168,6 +165,58 @@ public class WebViewActivity extends AbsActivity {
}
}
//js调用原生
public class JsInteration {
@JavascriptInterface
public void onBack() {
finish();
}
@JavascriptInterface
public void modifyMydata() {
indexInto = 1;
RouteUtil.forwardEditProfileActivity();
}
@JavascriptInterface
public void reportUser(String touid) {
RouteUtil.forwardLiveReportActivity(touid);
}
@JavascriptInterface
public void gotoHomePage(String indexStr) {
Log.e("tgasss","indexStr4"+indexStr);
if (!"".equals(indexStr) && indexStr != null) {
int index = -1;
if ("0".equals(indexStr)) {
index = 0;
} else if ("1".equals(indexStr)) {
index = 1;
} else if ("2".equals(indexStr)) {
index = 2;
} else if ("3".equals(indexStr)) {
index = 3;
}
if (index != -1) {
finish();
Constants.isShowPage = index;
}
}
}
@JavascriptInterface
public void openWebView(String url) {
Constants.isTitle = false;
RouteUtil.forwardZhuangBanActivity(url);
}
@JavascriptInterface
public void openWebViewTitle(String url) {
Constants.isTitle = true;
RouteUtil.forwardZhuangBanActivity(url);
}
}
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
mValueCallback = valueCallback;
@@ -299,10 +348,11 @@ public class WebViewActivity extends AbsActivity {
if (Constants.isShowPage != -1) {
finish();
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
indexInto = event.getIndexInto();
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// mWebView.reload();
// }
// }, 100);
}
}

View File

@@ -1,179 +0,0 @@
package com.yunbao.common.adapter;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.views.DrawerRecommendViewHolder;
import com.yunbao.common.views.DrawerTaskViewHolder;
import com.yunbao.common.views.FunGamesViewHolder;
import com.yunbao.common.views.RecommendViewHolder;
import com.yunbao.common.views.RigtsInterestsViewHolder;
import java.util.ArrayList;
import java.util.List;
/**
* 新侧边栏适配器
*/
public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
private Context mContext;
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
private final int GOOD_GIFTS = 1;
private final int TASK_CENTER = 2;
private final int FUN_GAMES = 3;
private final int RIGHTS_INTERESTS = 4;
private final int RECOMMEND = 5;
private String liveId;
private List<AnchorRecommendItemModel> list = new ArrayList<>();
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
public CustomDrawerPopupAdapter(Context mContext) {
this.mContext = mContext;
}
public CustomDrawerPopupAdapter setLiveId(String liveId) {
this.liveId = liveId;
return this;
}
public CustomDrawerPopupAdapter setList(List<AnchorRecommendItemModel> list) {
this.list = list;
return this;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
switch (viewType) {
case GOOD_GIFTS:
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_good_gifts, parent, false);
return new DrawerRecommendViewHolder(goodGiftsView);
case TASK_CENTER:
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center, parent, false);
return new DrawerTaskViewHolder(taskCenterView);
case FUN_GAMES:
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_view, parent, false);
return new FunGamesViewHolder(runGamesView);
case RIGHTS_INTERESTS:
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rights_interests, parent, false);
return new RigtsInterestsViewHolder(rightsInterestsView);
default:
View recommendView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_recommend, parent, false);
return new RecommendViewHolder(recommendView);
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (holder instanceof DrawerRecommendViewHolder) {
DrawerRecommendViewHolder recommendViewHolder = (DrawerRecommendViewHolder) holder;
recommendViewHolder.setData(infoModels.get(position));
} else if (holder instanceof DrawerTaskViewHolder) {
DrawerTaskViewHolder taskViewHolder = (DrawerTaskViewHolder) holder;
taskViewHolder.setData(infoModels.get(position));
} else if (holder instanceof FunGamesViewHolder) {
FunGamesViewHolder funGamesViewHolder = (FunGamesViewHolder) holder;
funGamesViewHolder.setData(infoModels.get(position));
} else if (holder instanceof RigtsInterestsViewHolder) {
RigtsInterestsViewHolder rigtsInterestsViewHolder = (RigtsInterestsViewHolder) holder;
rigtsInterestsViewHolder.setData(infoModels.get(position));
} else if (holder instanceof RecommendViewHolder) {
RecommendViewHolder recommendViewHolder = (RecommendViewHolder) holder;
recommendViewHolder.setData(infoModels.get(position));
recommendViewHolder.updateData(list);
recommendViewHolder.setListener(new RecommendViewHolder.RecommendViewListener() {
@Override
public void changeOneBatch() {
//推荐位
MainNetManager.get((Activity) mContext)
.anchorRecommend("9", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
int userIndex = -1;
for (int i = 0; i < models.size(); i++) {
if (TextUtils.equals(models.get(i).getUid(), liveId)) {
userIndex = i;
}
}
if (userIndex != -1) {
models.remove(userIndex);
}
recommendViewHolder.updateData(models);
}
@Override
public void onError(String error) {
}
});
}
@Override
public void goToLive(AnchorRecommendItemModel model) {
if (listener != null) {
listener.goToLive(model);
}
}
});
}
}
@Override
public int getItemCount() {
return infoModels.size();
}
@Override
public int getItemViewType(int position) {
CustomSidebarInfoModel model = infoModels.get(position);
switch (model.getType()) {
case "1":
return GOOD_GIFTS;
case "2":
return TASK_CENTER;
case "3":
return FUN_GAMES;
case "4":
return RIGHTS_INTERESTS;
case "5":
return RECOMMEND;
}
return super.getItemViewType(position);
}
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
infoModels.clear();
infoModels.addAll(mInfoModels);
notifyDataSetChanged();
}
private CustomDrawerListener listener;
public CustomDrawerPopupAdapter setListener(CustomDrawerListener listener) {
this.listener = listener;
return this;
}
public interface CustomDrawerListener {
void goToLive(AnchorRecommendItemModel model);
}
}

View File

@@ -1,49 +0,0 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.views.DrawerRecommendChildViewHolder;
import java.util.ArrayList;
import java.util.List;
public class DrawerRecommendAdapter extends RecyclerView.Adapter {
private Context mContext;
private List<CustomSidebarChildModel> child = new ArrayList<>();
public DrawerRecommendAdapter(Context mContext) {
this.mContext = mContext;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_drawer_recommend_child, parent, false);
return new DrawerRecommendChildViewHolder(goodGiftsView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
DrawerRecommendChildViewHolder childViewHolder = (DrawerRecommendChildViewHolder) holder;
childViewHolder.setData(child.get(position));
}
@Override
public int getItemCount() {
return child.size();
}
public void updateData(List<CustomSidebarChildModel> mChild) {
child.clear();
child.addAll(mChild);
notifyDataSetChanged();
}
}

View File

@@ -1,59 +0,0 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.DrawerTaskChildViewHolder;
import java.util.ArrayList;
import java.util.List;
public class DrawerTaskAdapter extends RecyclerView.Adapter {
private Context mContext;
private List<CustomSidebarChildModel> child = new ArrayList<>();
public DrawerTaskAdapter(Context mContext) {
this.mContext = mContext;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center_child, parent, false);
return new DrawerTaskChildViewHolder(taskCenterView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
DrawerTaskChildViewHolder taskChildViewHolder = (DrawerTaskChildViewHolder) holder;
taskChildViewHolder.setData(child.get(position), position);
taskChildViewHolder.setListener(new DrawerTaskChildViewHolder.DrawerTaskChildListener() {
@Override
public void giftSuccess(CustomSidebarChildModel model, int index) {
//将领取的任务移动至任务列表尾部
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(false).setRefresh(true));
}
});
}
@Override
public int getItemCount() {
return 2;
}
public void updateData(List<CustomSidebarChildModel> mChild) {
child.clear();
child.addAll(mChild);
notifyDataSetChanged();
}
}

View File

@@ -1,63 +0,0 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.views.FunGamesChildViewHolder;
import java.util.ArrayList;
import java.util.List;
public class FunGamesAdapter extends RecyclerView.Adapter {
private Context mContext;
private boolean rigts;
private List<CustomSidebarChildModel> child = new ArrayList<>();
public FunGamesAdapter(Context mContext, boolean rigts) {
this.mContext = mContext;
this.rigts = rigts;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_child_view, parent, false);
return new FunGamesChildViewHolder(runGamesView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
FunGamesChildViewHolder childViewHolder = (FunGamesChildViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
}
@Override
public int getItemCount() {
return child.size();
}
public void updateData(List<CustomSidebarChildModel> mChild) {
child.clear();
if (mChild.size() > 8) {
for (int i = 0; i < 8; i++) {
child.add(mChild.get(i));
}
} else {
child.addAll(mChild);
}
notifyDataSetChanged();
}
public void selectAll(List<CustomSidebarChildModel> mChild){
child.clear();
child.addAll(mChild);
notifyDataSetChanged();
}
}

View File

@@ -1,67 +0,0 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.views.RecommendChildViewHolder;
import java.util.ArrayList;
import java.util.List;
public class RecommendAdapter extends RecyclerView.Adapter {
private List<AnchorRecommendItemModel> list = new ArrayList<>();
private Context mContext;
public RecommendAdapter(Context mContext) {
this.mContext = mContext;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new RecommendChildViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_sidebar_lives_new, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
RecommendChildViewHolder itemViewHolder = (RecommendChildViewHolder) holder;
itemViewHolder.setData(list.get(position));
itemViewHolder.setListener(new RecommendChildViewHolder.RecommendChildListener() {
@Override
public void goToLive(AnchorRecommendItemModel model) {
if (callback != null) {
callback.goToLive(model);
}
}
});
}
@Override
public int getItemCount() {
return list.size();
}
public void updateData(List<AnchorRecommendItemModel> mList) {
list.clear();
list.addAll(mList);
notifyDataSetChanged();
}
private RecommendCallback callback;
public RecommendAdapter setCallback(RecommendCallback callback) {
this.callback = callback;
return this;
}
public interface RecommendCallback {
void goToLive(AnchorRecommendItemModel model);
}
}

View File

@@ -95,7 +95,7 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
return position;
}
protected static boolean canClick() {
protected boolean canClick() {
return ClickUtil.canClick();
}

View File

@@ -62,12 +62,8 @@ public class CrashSaveBean {
public String getActivitySize() {
StringBuilder builder=new StringBuilder();
for (WeakReference<Activity> activity : activities) {
try {
if(activity.get()!=null){
builder.append(activity.get().getClass().getSimpleName()).append(",");
}
} catch (Exception ignored) {
builder.append(activity.get()).append(",");
}
}
return builder.toString();

View File

@@ -1,172 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class CustomSidebarChildModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("parent_id")
private String parentId;
@SerializedName("title")
private String title;
@SerializedName("subtitle")
private String subtitle;
@SerializedName("icon")
private String icon;
@SerializedName("src")
private String src;
@SerializedName("show_type")
private String showType;
@SerializedName("sort")
private String sort;
@SerializedName("english")
private String english;
//奖励领取状态 0未达到领取要求 1已领取 2未领取
@SerializedName("status")
private String status;
@SerializedName("need_num")
private String needNum;
@SerializedName("now_num")
private String nowNum;
@SerializedName("activity_id")
private String activityId;
@SerializedName("flag")
private String flag;
public String getFlag() {
return flag;
}
public CustomSidebarChildModel setFlag(String flag) {
this.flag = flag;
return this;
}
public String getActivityId() {
return activityId;
}
public CustomSidebarChildModel setActivityId(String activityId) {
this.activityId = activityId;
return this;
}
private int resIcon;
public int getResIcon() {
return resIcon;
}
public CustomSidebarChildModel setResIcon(int resIcon) {
this.resIcon = resIcon;
return this;
}
public String getId() {
return id;
}
public CustomSidebarChildModel setId(String id) {
this.id = id;
return this;
}
public String getParentId() {
return parentId;
}
public CustomSidebarChildModel setParentId(String parentId) {
this.parentId = parentId;
return this;
}
public String getTitle() {
return title;
}
public CustomSidebarChildModel setTitle(String title) {
this.title = title;
return this;
}
public String getSubtitle() {
return subtitle;
}
public CustomSidebarChildModel setSubtitle(String subtitle) {
this.subtitle = subtitle;
return this;
}
public String getIcon() {
return icon;
}
public CustomSidebarChildModel setIcon(String icon) {
this.icon = icon;
return this;
}
public String getSrc() {
return src;
}
public CustomSidebarChildModel setSrc(String src) {
this.src = src;
return this;
}
public String getShowType() {
return showType;
}
public CustomSidebarChildModel setShowType(String showType) {
this.showType = showType;
return this;
}
public String getSort() {
return sort;
}
public CustomSidebarChildModel setSort(String sort) {
this.sort = sort;
return this;
}
public String getEnglish() {
return english;
}
public CustomSidebarChildModel setEnglish(String english) {
this.english = english;
return this;
}
public String getStatus() {
return status;
}
public CustomSidebarChildModel setStatus(String status) {
this.status = status;
return this;
}
public String getNeedNum() {
return needNum;
}
public CustomSidebarChildModel setNeedNum(String needNum) {
this.needNum = needNum;
return this;
}
public String getNowNum() {
return nowNum;
}
public CustomSidebarChildModel setNowNum(String nowNum) {
this.nowNum = nowNum;
return this;
}
}

View File

@@ -1,103 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* 新版自定义侧边栏
*/
public class CustomSidebarInfoModel extends BaseModel {
@SerializedName("id")
private String id;
//一级标题
@SerializedName("title")
private String title;
//二级标题
@SerializedName("subtitle")
private String subtitle;
@SerializedName("sort")
private String sort;
//1全屏 2半屏
@SerializedName("show_type")
private String showType;
//跳转链接
@SerializedName("src")
private String src;
@SerializedName("type")
private String type;
@SerializedName("child")
private List<CustomSidebarChildModel> child;
public String getId() {
return id;
}
public CustomSidebarInfoModel setId(String id) {
this.id = id;
return this;
}
public String getTitle() {
return title;
}
public CustomSidebarInfoModel setTitle(String title) {
this.title = title;
return this;
}
public String getSubtitle() {
return subtitle;
}
public CustomSidebarInfoModel setSubtitle(String subtitle) {
this.subtitle = subtitle;
return this;
}
public String getSort() {
return sort;
}
public CustomSidebarInfoModel setSort(String sort) {
this.sort = sort;
return this;
}
public String getShowType() {
return showType;
}
public CustomSidebarInfoModel setShowType(String showType) {
this.showType = showType;
return this;
}
public String getSrc() {
return src;
}
public CustomSidebarInfoModel setSrc(String src) {
this.src = src;
return this;
}
public String getType() {
return type;
}
public CustomSidebarInfoModel setType(String type) {
this.type = type;
return this;
}
public List<CustomSidebarChildModel> getChild() {
return child;
}
public CustomSidebarInfoModel setChild(List<CustomSidebarChildModel> child) {
this.child = child;
return this;
}
}

View File

@@ -1,7 +1,5 @@
package com.yunbao.common.bean;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;
import java.util.List;
@@ -681,15 +679,6 @@ public class IMLoginModel extends BaseModel {
return usersType;
}
/**
* usersType ==C 是主播身份
*
* @return
*/
public boolean anchorUserType() {
return TextUtils.equals("C", usersType);
}
public IMLoginModel setUsersType(String usersType) {
this.usersType = usersType;
return this;

View File

@@ -378,9 +378,9 @@ public class LiveBean implements Parcelable {
*/
public String getLiangNameTip() {
if (!TextUtils.isEmpty(this.goodNum) && !"0".equals(this.goodNum)) {
return this.goodNum;
return WordUtil.getString(R.string.live_liang) + ":" + this.goodNum;
}
return this.uid;
return "ID:" + this.uid;
}
public LiveBean() {

View File

@@ -68,17 +68,7 @@ public class MsgModel extends BaseModel {
private String taskName1;
@SerializedName("taskName2")
private String taskName2;
@SerializedName("activityUrl")
private String activityUrl;
public String getActivityUrl() {
return activityUrl;
}
public MsgModel setActivityUrl(String activityUrl) {
this.activityUrl = activityUrl;
return this;
}
/**
* 星级挑战成功IM消息

View File

@@ -1,70 +0,0 @@
package com.yunbao.common.bean;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;
/**
* 新用户等级牌
*/
public class NewLevelModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("levelmin")
private String levemin;
@SerializedName("levelmax")
private String levemax;
@SerializedName("thumb")
private String thumb;
public String getId() {
return id;
}
public NewLevelModel setId(String id) {
this.id = id;
return this;
}
public String getLevemin() {
return levemin;
}
public int getLeveMin() {
if (TextUtils.isEmpty(levemin)) {
levemin = "0";
}
return Integer.parseInt(levemin);
}
public int getLeveMax() {
if (TextUtils.isEmpty(levemax)) {
levemax = "0";
}
return Integer.parseInt(levemax);
}
public NewLevelModel setLevemin(String levemin) {
this.levemin = levemin;
return this;
}
public String getLevemax() {
return levemax;
}
public NewLevelModel setLevemax(String levemax) {
this.levemax = levemax;
return this;
}
public String getThumb() {
return thumb;
}
public NewLevelModel setThumb(String thumb) {
this.thumb = thumb;
return this;
}
}

View File

@@ -1,110 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.utils.StringUtil;
/**
* 直播间PK排位赛
*/
public class PkRankBean extends BaseModel {
@SerializedName("anchor_id")
public int id;
@SerializedName("rank_name")
public String name;
@SerializedName("rank_img")
public String img;
@SerializedName("win_continuity1")
public String redVal;
@SerializedName("win_continuity2")
public String blueVal;
@SerializedName("pktt_img")
public String pkTopImgUrl;
@SerializedName("link")
public String clickUrl;
@SerializedName("vs_img")
public String vsImgUrl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getRedVal() {
if (StringUtil.isEmpty(redVal)) {
redVal = "0";
}
return redVal;
}
public void setRedVal(String redVal) {
this.redVal = redVal;
}
public String getBlueVal() {
if (StringUtil.isEmpty(blueVal)) {
blueVal = "0";
}
return blueVal;
}
public void setBlueVal(String blueVal) {
this.blueVal = blueVal;
}
public String getPkTopImgUrl() {
return pkTopImgUrl;
}
public void setPkTopImgUrl(String pkTopImgUrl) {
this.pkTopImgUrl = pkTopImgUrl;
}
public String getClickUrl() {
return clickUrl;
}
public void setClickUrl(String clickUrl) {
this.clickUrl = clickUrl;
}
public String getVsImgUrl() {
return vsImgUrl;
}
public void setVsImgUrl(String vsImgUrl) {
this.vsImgUrl = vsImgUrl;
}
@Override
public String toString() {
return "PkRankBean{" +
"id=" + id +
", name='" + name + '\'' +
", img='" + img + '\'' +
", redVal='" + redVal + '\'' +
", blueVal='" + blueVal + '\'' +
", pkTopImgUrl='" + pkTopImgUrl + '\'' +
", clickUrl='" + clickUrl + '\'' +
", vsImgUrl='" + vsImgUrl + '\'' +
'}';
}
}

View File

@@ -5,7 +5,6 @@ import android.os.Parcelable;
import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
/**
* Created by cxf on 2017/8/14.
@@ -57,8 +56,6 @@ public class UserBean implements Parcelable {
private String mobile;
private String front_task;
private String is_admin;
@SerializedName("user_love_num")
private int praise;
//是否隐藏
private boolean isHide = false;
@@ -366,14 +363,6 @@ public class UserBean implements Parcelable {
return level;
}
public int getPraise() {
return praise;
}
public void setPraise(int praise) {
this.praise = praise;
}
public void setLevel(int level) {
this.level = level;
}

View File

@@ -7,11 +7,6 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.yunbao.common.R;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DpUtil;
@@ -82,15 +77,6 @@ public class HintDialog extends AbsDialogFragment {
}
@Override
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
try {
super.show(manager, tag);
} catch (Exception e) {
e.printStackTrace();
}
}
private HintListener listener;
public HintDialog setListener(HintListener listener) {

View File

@@ -1,105 +0,0 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class CustomDrawerPopupEvent extends BaseModel {
//是否关闭弹窗
private boolean isDisMiss = false;
//权益的名字
private String rightsInterests = "";
//活动的id
private int activityId = 0;
//跳转网页地址
private String htmlUrl;
//是否半屏展示
private boolean screen = false;
//系统消息
private boolean systemNotice = false;
//在线客服
private boolean online = false;
//举报
private boolean reportLayout = false;
//刷新
private boolean refresh = false;
public boolean isRefresh() {
return refresh;
}
public CustomDrawerPopupEvent setRefresh(boolean refresh) {
this.refresh = refresh;
return this;
}
public boolean isSystemNotice() {
return systemNotice;
}
public CustomDrawerPopupEvent setSystemNotice(boolean systemNotice) {
this.systemNotice = systemNotice;
return this;
}
public boolean isOnline() {
return online;
}
public CustomDrawerPopupEvent setOnline(boolean online) {
this.online = online;
return this;
}
public boolean isReportLayout() {
return reportLayout;
}
public CustomDrawerPopupEvent setReportLayout(boolean reportLayout) {
this.reportLayout = reportLayout;
return this;
}
public String getHtmlUrl() {
return htmlUrl;
}
public CustomDrawerPopupEvent setHtmlUrl(String htmlUrl) {
this.htmlUrl = htmlUrl;
return this;
}
public boolean isScreen() {
return screen;
}
public CustomDrawerPopupEvent setScreen(boolean screen) {
this.screen = screen;
return this;
}
public int getActivityId() {
return activityId;
}
public CustomDrawerPopupEvent setActivityId(int activityId) {
this.activityId = activityId;
return this;
}
public String getRightsInterests() {
return rightsInterests;
}
public CustomDrawerPopupEvent setRightsInterests(String rightsInterests) {
this.rightsInterests = rightsInterests;
return this;
}
public boolean isDisMiss() {
return isDisMiss;
}
public CustomDrawerPopupEvent setDisMiss(boolean disMiss) {
isDisMiss = disMiss;
return this;
}
}

View File

@@ -1,170 +0,0 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.VideoBean;
import java.util.ArrayList;
import java.util.List;
public class JavascriptInterfaceEvent extends BaseModel {
private String method = "";
private String svg = "";
private String postsId = "";
private String isClose;
private List<VideoBean> videoBeanList = new ArrayList<>();
private int position;
private String liveId;
private String userId;
private int indexInto;
private String productId;
private String orderNumber;
private String moneyUsd;
private boolean isUpdataUser;
private String data;
private String name;
private String image;
public String getName() {
return name;
}
public JavascriptInterfaceEvent setName(String name) {
this.name = name;
return this;
}
public String getImage() {
return image;
}
public JavascriptInterfaceEvent setImage(String image) {
this.image = image;
return this;
}
public String getUserId() {
return userId;
}
public JavascriptInterfaceEvent setUserId(String userId) {
this.userId = userId;
return this;
}
public String getData() {
return data;
}
public JavascriptInterfaceEvent setData(String data) {
this.data = data;
return this;
}
public boolean isUpdataUser() {
return isUpdataUser;
}
public JavascriptInterfaceEvent setUpdataUser(boolean updataUser) {
isUpdataUser = updataUser;
return this;
}
public String getProductId() {
return productId;
}
public JavascriptInterfaceEvent setProductId(String productId) {
this.productId = productId;
return this;
}
public String getOrderNumber() {
return orderNumber;
}
public JavascriptInterfaceEvent setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
return this;
}
public String getMoneyUsd() {
return moneyUsd;
}
public JavascriptInterfaceEvent setMoneyUsd(String moneyUsd) {
this.moneyUsd = moneyUsd;
return this;
}
public int getIndexInto() {
return indexInto;
}
public JavascriptInterfaceEvent setIndexInto(int indexInto) {
this.indexInto = indexInto;
return this;
}
public String getLiveId() {
return liveId;
}
public JavascriptInterfaceEvent setLiveId(String liveId) {
this.liveId = liveId;
return this;
}
public List<VideoBean> getVideoBeanList() {
return videoBeanList;
}
public JavascriptInterfaceEvent setVideoBeanList(List<VideoBean> videoBeanList) {
this.videoBeanList = videoBeanList;
return this;
}
public int getPosition() {
return position;
}
public JavascriptInterfaceEvent setPosition(int position) {
this.position = position;
return this;
}
public String getIsClose() {
return isClose;
}
public JavascriptInterfaceEvent setIsClose(String isClose) {
this.isClose = isClose;
return this;
}
public String getPostsId() {
return postsId;
}
public JavascriptInterfaceEvent setPostsId(String postsId) {
this.postsId = postsId;
return this;
}
public String getSvg() {
return svg;
}
public JavascriptInterfaceEvent setSvg(String svg) {
this.svg = svg;
return this;
}
public String getMethod() {
return method;
}
public JavascriptInterfaceEvent setMethod(String method) {
this.method = method;
return this;
}
}

View File

@@ -29,7 +29,7 @@ public class ImgLoader {
private static final boolean SKIP_MEMORY_CACHE = true;
private static BlurTransformation sBlurTransformation;
private final static float thumbnail = 1.0f;
private final static float thumbnail = 0.1f;
static {
sBlurTransformation = new BlurTransformation(25);
@@ -72,6 +72,7 @@ public class ImgLoader {
.load(url)
.thumbnail(thumbnail)
.dontAnimate()
.placeholder(imageView.getDrawable());
if (width != -1 && height != -1) {
builder = builder.override(width, height);
@@ -94,20 +95,6 @@ public class ImgLoader {
.into(imageView);
}
public static void display2(Context context, Drawable drawable, ImageView imageView) {
if (!contextIsExist(context)) {
return;
}
Glide.with(context)
.asDrawable()
.load(drawable)
.thumbnail(thumbnail)
.placeholder(imageView.getDrawable())
.dontAnimate()
.skipMemoryCache(SKIP_MEMORY_CACHE)
.into(imageView);
}
public static void displayWithError(Context context, String url, ImageView imageView, int errorRes) {
displayWithError(context, url, imageView, errorRes, -1, -1);
}

View File

@@ -6,7 +6,6 @@ import android.util.Log;
import com.adjust.sdk.Adjust;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
@@ -19,7 +18,6 @@ import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.SpUtil;
@@ -192,10 +190,6 @@ public class CommonHttpUtil {
if (obj.containsKey("is_chat")) {
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
}
if (obj.containsKey("level_new")) {//缓存等级数据
JSONArray levelArray = obj.getJSONArray("level_new");
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
}
} catch (Exception e) {
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
ErrorActivity.forward("GetConfig接口返回数据异常", error);

View File

@@ -4,7 +4,6 @@ import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.ContributeModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.IMLoginModel;
@@ -14,7 +13,6 @@ import com.yunbao.common.bean.MsgSwitchDetailModel;
import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
@@ -239,7 +237,6 @@ public interface PDLiveApi {
/**
*获取当前星级
*
* @param liveUid
* @return
*/
@@ -251,22 +248,4 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Live.getLiveRoomActivtyBanner")
Observable<ResponseModel<List<LiveRoomActivityBanner>>> getLiveRoomActivityBanner();
/**
* 新侧边栏请求
*/
@GET("/api/public/?service=Live.getCustomSidebarInfo")
Observable<ResponseModel<List<CustomSidebarInfoModel>>> getCustomSidebarInfo();
/**
* 任务领取接口
*/
@GET("/api/public/?service=Task.sendTaskGift")
Observable<ResponseModel<List<Observable>>> sendTaskGift(@Query("flag") String flag, @Query("type") String type);
/**
* PK排位赛接口
*/
@GET("/api/public/?service=Ranking.getAnchorRankData")
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId,@Query("anchor_id2")String pkUid);
}

View File

@@ -6,7 +6,6 @@ import android.text.TextUtils;
import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.NobleRankHideUserListModel;
@@ -20,7 +19,6 @@ import com.yunbao.common.http.base.HttpCallback;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
@@ -65,7 +63,6 @@ public class LiveNetManager {
if (callback != null)
callback.onError(throwable.getMessage());
}).isDisposed();
}
/**
@@ -240,6 +237,7 @@ public class LiveNetManager {
/**
* 获取 【新人特惠】【趣味游戏】【幸运天使】
*
*/
public void getLiveRoomActivityBanner(HttpCallback<List<LiveRoomActivityBanner>> callback) {
API.get().pdLiveApi(mContext)
@@ -255,40 +253,4 @@ public class LiveNetManager {
throwable.printStackTrace();
}).isDisposed();
}
/**
* 获取新侧边数据
*
* @param callback
*/
public void getCustomSidebarInfo(HttpCallback<List<CustomSidebarInfoModel>> callback) {
API.get().pdLiveApi(mContext)
.getCustomSidebarInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> callback.onSuccess(listResponseModel.getData().getInfo()), throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
throwable.printStackTrace();
}).isDisposed();
}
/**
* 任务领取接口
*/
public void sendTaskGift(String flag, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.sendTaskGift(flag, "2")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(observableResponseModel -> {
if (observableResponseModel.getData().getCode() == 0) {
callback.onSuccess("");
} else {
callback.onError(observableResponseModel.getData().getMsg());
}
}, throwable -> callback.onError(throwable.getMessage())).isDisposed();
}
}

View File

@@ -7,10 +7,8 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.cosmos.baseutil.app.AppContext;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.DataUserInfoEvent;
import com.yunbao.common.http.HttpCallback;
@@ -27,18 +25,18 @@ import org.greenrobot.eventbus.EventBus;
* 登录者信息管理
*/
public class IMLoginManager extends BaseCacheManager {
private final String KEY_USER_INFO = "keyUserInfo";
private final static String KEY_USER_INFO = "keyUserInfo";
private static IMLoginManager manager;
private IMLoginModel userInfo;
private final String isNewUserGif = "isNewUserGif";
private final String isNewUserOne = "isNewUserOne";
private final String GiftEffect = "giftEffect";
private final String MountEffect = "mountEffect";
private final String IS_CHAT = "isChat";
private final String IS_SLIDE = "isSlide";
private final String IS_FLOAT = "is_float";
private final String IS_HINT = "is_hint";
private final String IS_HINT2 = "is_hint2";
private final static String isNewUserGif = "isNewUserGif";
private final static String isNewUserOne = "isNewUserOne";
private final static String GiftEffect = "giftEffect";
private final static String MountEffect = "mountEffect";
private final static String IS_CHAT = "isChat";
private final static String IS_SLIDE = "isSlide";
private final static String IS_FLOAT = "is_float";
private final static String IS_HINT = "is_hint";
private final static String IS_HINT2 = "is_hint2";
public boolean isHint() {
@@ -153,7 +151,7 @@ public class IMLoginManager extends BaseCacheManager {
*/
public static IMLoginManager get(Context context) {
if (null == manager) {
manager = new IMLoginManager(CommonAppContext.sInstance.getBaseContext());
manager = new IMLoginManager(context);
}
return manager;
}

View File

@@ -1,45 +0,0 @@
package com.yunbao.common.manager;
import android.content.Context;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.manager.base.BaseCacheManager;
import java.util.ArrayList;
import java.util.List;
/**
* 新粉丝牌管理
*/
public class NewLevelManager extends BaseCacheManager {
private final String KEY_USER_LEVEL = "keyUserLevel";
private List<NewLevelModel> newLevelModels = new ArrayList<>();
public NewLevelManager(Context context) {
super(context);
}
/**
* 缓存等级图标
*
* @param json
*/
public void UpDataLevel(String json) {
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
}.getType());
put(KEY_USER_LEVEL, newLevelModels);
}
/**
* 获取等级数据
*
* @return
*/
public List<NewLevelModel> getNewLevelModels() {
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
}.getType());
}
}

View File

@@ -271,6 +271,7 @@ public class ACache {
JSONArray obj = new JSONArray(JSONString);
return obj;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}

View File

@@ -6,11 +6,9 @@ import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.provider.MediaStore;
import com.bumptech.glide.Glide;
@@ -197,24 +195,4 @@ public class BitmapUtil {
canvas.drawBitmap(bitmap, 0, 0, paint);
return bm;
}
/**
* 镜像Bitmap
*
* @param bitmap
* @return
*/
public Bitmap convertMirror(Bitmap bitmap) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Bitmap newb = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);// 创建一个新的和SRC长度宽度一样的位图
Canvas cv = new Canvas(newb);
Matrix m = new Matrix();
//m.postScale(1, -1); //镜像垂直翻转
m.postScale(-1, 1); //镜像水平翻转
//m.postRotate(-90); //旋转-90度
Bitmap new2 = Bitmap.createBitmap(bitmap, 0, 0, w, h, m, true);
cv.drawBitmap(new2, new Rect(0, 0, new2.getWidth(), new2.getHeight()), new Rect(0, 0, w, h), null);
return newb;
}
}

View File

@@ -11,8 +11,5 @@ public class CommonIconUtil {
public static int getSexIcon(int key) {
return key == 1 ? R.mipmap.icon_sex_male_1 : R.mipmap.icon_sex_female_1;
}
public static int getSexIconForUserCard(int key) {
return key == 1 ? R.mipmap.user_card_man : R.mipmap.user_card_woman;
}
}

View File

@@ -1,11 +1,9 @@
package com.yunbao.common.utils;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.text.format.Formatter;
import android.util.DisplayMetrics;
/**
@@ -71,20 +69,4 @@ public class DeviceUtils {
return "0";
}
/**
* 当前是否处于低内存状态
*/
public static boolean isLowMemory(Context context) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
am.getMemoryInfo(mi);
return mi.lowMemory;
}
public static String getMemory(Context context) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
am.getMemoryInfo(mi);
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
}
}

View File

@@ -19,8 +19,6 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import com.yunbao.common.R;
import java.util.ArrayList;
@@ -322,7 +320,6 @@ public class DialogUitl {
private int mLength;
private SimpleCallback mClickCallback;
private SimpleCallback3 mClickCallback3;
private int mView = 0;
public Builder(Context context) {
mContext = context;
@@ -388,18 +385,9 @@ public class DialogUitl {
return this;
}
public Builder setView(@LayoutRes int layoutRes) {
mView = layoutRes;
return this;
}
public Dialog build() {
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
if (mView != 0) {
dialog.setContentView(mView);
} else {
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
}
dialog.setCancelable(mCancelable);
dialog.setCanceledOnTouchOutside(mCancelable);
TextView titleView = (TextView) dialog.findViewById(R.id.title);

View File

@@ -33,24 +33,6 @@ public class FileUtil {
}
}
}
/**
* 把字符串追加保存成文件
*/
public static void saveAddStringToFile(File dir, String content, String fileName) {
PrintWriter writer = null;
try {
FileOutputStream os = new FileOutputStream(new File(dir, fileName));
writer = new PrintWriter(os);
writer.append(content);
writer.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
if (writer != null) {
writer.close();
}
}
}
/**
* 从文件读取字符串

View File

@@ -1,483 +0,0 @@
package com.yunbao.common.utils;
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.ReportCommunityBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.VideoBean;
import com.yunbao.common.bean.VideoListBean;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import org.greenrobot.eventbus.EventBus;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
//网页调用Android工具类
public class JavascriptInterfaceUtils {
private Activity mContext;
private WebView mWebView;
//判断是页面关闭还是网页回退
private boolean pageClose = false;
private boolean dialogClose = false;
//同名activity跳转问题
private boolean LiveZhuangBana = true;
private static JavascriptInterfaceUtils sInstance;
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
this.pageClose = pageClose;
return this;
}
public JavascriptInterfaceUtils setDialogClose(boolean dialogClose) {
this.dialogClose = dialogClose;
return this;
}
public JavascriptInterfaceUtils setLiveZhuangBana(boolean liveZhuangBana) {
LiveZhuangBana = liveZhuangBana;
return this;
}
public JavascriptInterfaceUtils setmContext(Activity mContext, WebView mWebView) {
this.mContext = mContext;
this.mWebView = mWebView;
return this;
}
public static JavascriptInterfaceUtils getInstance() {
if (sInstance == null) {
synchronized (CityUtil.class) {
if (sInstance == null) {
sInstance = new JavascriptInterfaceUtils();
}
}
}
return sInstance;
}
@JavascriptInterface
public void androidOpeningNoble(String svg) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidOpeningNoble")
.setSvg(svg));
}
@JavascriptInterface
public void androidGoBack() {
if (pageClose) {
mContext.finish();
} else {
if (dialogClose) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidGoBack"));
} else {
mContext.runOnUiThread(() -> mWebView.goBack());
}
}
}
@JavascriptInterface
public void AndroidAdjustConsume() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("AndroidAdjustConsume"));
}
@JavascriptInterface
public void androidGoToRe() {
ARouter.getInstance().build(PATH_COIN).withInt("p", 1).navigation();
}
@JavascriptInterface
public void onBack() {
mContext.finish();
}
@JavascriptInterface
public void androidClickToNewH5PageView(String url) {
url = CommonAppConfig.HOST + url;
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken();
if (LiveZhuangBana) {
RouteUtil.forwardLiveZhuangBanActivity(url, false);
} else {
RouteUtil.forwardZhuangBanActivity(url, false);
}
}
/**
* 新跳转
*
* @param url 跳转的url
* @param title 有标题的展示标题
*/
@JavascriptInterface
public void androidClickToNewH5PageView(String url, String title) {
url = CommonAppConfig.HOST + url;
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken();
if (LiveZhuangBana) {
RouteUtil.forwardLiveZhuangBanActivity(url, title);
} else {
RouteUtil.forwardZhuangBanActivity(url, title);
}
}
/**
* 设置超皇字体颜色
*
* @param startColor 渐变色
* @param endColor 渐变色
* @param contentColor 内容颜色
*/
@JavascriptInterface
public void androidSetColor(String startColor, String endColor, String contentColor) {
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
model.setStartColor("#" + startColor)
.setEndColor("#" + endColor)
.setContentColor("#" + contentColor);
IMLoginManager.get(mContext).upDataUserInfo(model);
}
@JavascriptInterface
public void androidCommunityGift(String postsId) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidCommunityGift")
.setPostsId(postsId));
}
@JavascriptInterface
public void reportCommunity(String info) {
ReportCommunityBean reportCommunityBean = JSON.parseObject(info, ReportCommunityBean.class);
RouteUtil.forwardLiveReportActivity(reportCommunityBean.getDynamic_id(), 1, reportCommunityBean.getCommunity_type(), reportCommunityBean.getComment_id());
}
@JavascriptInterface
public void reportUser(String touid) {
RouteUtil.forwardLiveReportActivity(touid);
}
@JavascriptInterface
public void isCloseNavigation(String isClose) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("isCloseNavigation")
.setIsClose(isClose));
}
@JavascriptInterface
public void androidPlayVideo(String list) {
list.toString();
if (!"undefined".equals(list)) {
JSONObject obj = JSON.parseObject(list);
int position = obj.getIntValue("video_index");
String videoListString = obj.getString("video_list");
List<VideoListBean> videoList = JSON.parseArray(videoListString, VideoListBean.class);
List<VideoBean> videoBeanList = new ArrayList<>();
for (VideoListBean videoListBean : videoList) {
JSONObject obj2 = JSON.parseObject(videoListBean.getContent());
String msg = obj2.getString("msg");
VideoBean videoBean = new VideoBean();
videoBean.setHref(videoListBean.getVideo());
videoBean.setCity("");
videoBean.setCommentNum(videoListBean.getComment_num());
videoBean.setAddtime(videoListBean.getCreate_time());
videoBean.setDatetime("");
videoBean.setDistance("");
videoBean.setId(videoListBean.getId());
videoBean.setLat("");
videoBean.setLike(0);
videoBean.setTitle(msg);
if ("2".endsWith(videoListBean.getIs_attention()) || "0".endsWith(videoListBean.getIs_attention())) {
videoBean.setAttent(2);
} else if ("1".endsWith(videoListBean.getIs_attention())) {
videoBean.setAttent(1);
} else {
videoBean.setAttent(-1);
}
UserBean userBean = new UserBean();
userBean.setAvatar(videoListBean.getUser_avatar());
userBean.setUserNiceName(videoListBean.getUser_name());
userBean.setId(videoListBean.getUser_id());
videoBean.setUserBean(userBean);
videoBean.setUid(videoListBean.getUser_id());
videoBeanList.add(videoBean);
}
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidPlayVideo")
.setVideoBeanList(videoBeanList)
.setPosition(position));
}
}
@JavascriptInterface
public void androidClickSayHiBack(String uid, String name, String img) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidClickSayHiBack")
.setUserId(uid)
.setUserId(uid)
.setImage(img)
.setName(name));
}
@JavascriptInterface
public void androidMethodLookToLive(String liveId) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidMethodLookToLive")
.setLiveId(liveId));
}
@JavascriptInterface
public void androidClickFansList(String uid) {
RouteUtil.forwardFansActivity(uid);
}
@JavascriptInterface
public String androidMethod(String data) {
Bus.get().post(new JavascriptInterfaceEvent().setMethod("androidMethod").setData(data));
return "";
}
@JavascriptInterface
public String androidGetNewWrap(String data) {
if (data != null && !data.isEmpty()) {
isGetNewWrap = true;
}
return "";
}
@JavascriptInterface
public void androidMethodBack() {
mContext.finish();
}
@JavascriptInterface
public void modifyMydata() {
Bus.get().post(new JavascriptInterfaceEvent().setMethod("modifyMydata").setIndexInto(1));
RouteUtil.forwardEditProfileActivity();
}
@JavascriptInterface
public void gotoHomePage(String indexStr) {
if (!"".equals(indexStr) && indexStr != null) {
int index = -1;
if ("0".equals(indexStr)) {
index = 0;
} else if ("1".equals(indexStr)) {
index = 1;
} else if ("2".equals(indexStr)) {
index = 2;
} else if ("3".equals(indexStr)) {
index = 3;
}
if (index != -1) {
mContext.finish();
Constants.isShowPage = index;
}
}
}
@JavascriptInterface
public void openWebView(String url) {
Bus.get().post(new JavascriptInterfaceEvent().setMethod("openWebView").setData(url));
Constants.isTitle = false;
RouteUtil.forwardZhuangBanActivity(url);
}
@JavascriptInterface
public void openWebViewTitle(String url) {
Constants.isTitle = true;
RouteUtil.forwardZhuangBanActivity(url);
}
@JavascriptInterface
public void androidNewGoToGooglePay(String ProductId, String OrderNumber, String MoneyUsd) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidNewGoToGooglePay")
.setProductId(ProductId)
.setMoneyUsd(MoneyUsd)
.setOrderNumber(OrderNumber));
}
//拉黑不感兴趣
@JavascriptInterface
public void androidLoseInterest() {
EventBus.getDefault().post("blacklist");
}
@JavascriptInterface
public void AndroidFellow() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("AndroidFellow"));
}
//跳转修改昵称
@JavascriptInterface
public void openUpdataName() {
Constants.myIntoIndex = 2;
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openUpdataName")
.setUpdataUser(true));
RouteUtil.forwardMyWebViewActivity2(CommonAppConfig.HOST + "/h5/table/Modify-information.html" + "?token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid());
}
//跳转修改头像
@JavascriptInterface
public void openUpdataAvater() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openUpdataAvater"));
}
//跳转修改头像
@JavascriptInterface
public void openUpdataAvater(String s) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openUpdataAvater"));
}
//跳转修改签名
@JavascriptInterface
public void openUpdataAutograph() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openUpdataAutograph"));
}
//跳转修改签名
@JavascriptInterface
public void openUpdataAutograph(String s) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openUpdataAutograph"));
}
@JavascriptInterface
public void androidGoTopUp() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidGoTopUp"));
//我们的
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).withString("tag", "&first_page=1").navigation();
}
@JavascriptInterface
public String androidMethodLookLive(String uId, String liveId, String isLiving) {
//跳转个人主页
RouteUtil.forwardUserHome(mContext, liveId, 0);
return "";
}
@JavascriptInterface
public void AndroidClose() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("AndroidClose"));
}
@JavascriptInterface
public void sendFansCard(String id) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("sendFansCard")
.setLiveId(id));
}
@JavascriptInterface
public String androidMethodClickUser(String userId, String liveId) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidMethodClickUser")
.setLiveId(liveId)
.setUserId(userId));
return "";
}
@JavascriptInterface
public void onTrickerySendGift(String id) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("onTrickerySendGift")
.setUserId(id));
}
@JavascriptInterface
public void androidZBan(String svg) {
String[] arr = svg.split("/");
String id = arr[arr.length - 1];
String url1;
if (!svg.contains("http")) {
url1 = CommonAppConfig.HOST + svg;
} else {
url1 = svg;
}
GiftCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback<File>() {
@Override
public void callback(File bean) {
}
});
}
@JavascriptInterface
public void AndroidAdjustPrank() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("AndroidAdjustPrank"));
}
@JavascriptInterface
public void openWrap() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("openWrap"));
}
@JavascriptInterface
public void androidSignGift(String json) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidSignGift")
.setData(json));
}
@JavascriptInterface
public void setHeight(String height, String width) {
if ("0".equals(height)) {
return;
}
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
ViewGroup.LayoutParams params = mWebView.getLayoutParams();
params.height = DpUtil.dp2px(Integer.parseInt(height));
mWebView.setLayoutParams(params);
mWebView.setVisibility(View.VISIBLE);
});
}
}

View File

@@ -1,23 +1,9 @@
package com.yunbao.common.utils;
import static android.provider.Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION;
import static androidx.core.content.PermissionChecker.PERMISSION_GRANTED;
import static java.text.DateFormat.DEFAULT;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.text.TextUtils;
import android.util.Log;
import androidx.core.app.ActivityCompat;
import androidx.core.content.FileProvider;
import androidx.core.content.PermissionChecker;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Progress;
@@ -28,24 +14,10 @@ import com.lzy.okserver.upload.UploadListener;
import com.lzy.okserver.upload.UploadTask;
import com.yunbao.common.CommonAppConfig;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* Created by cxf on 2019/6/20.
@@ -147,70 +119,4 @@ public class LogUtil {
}
return null;
}
public static void shareFile(Context context) {
if(true){
return;
}
if (PermissionChecker.checkCallingOrSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
return;
}
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
File zip = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".zip");
try {
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zip)));
FileInputStream fis = null;
WritableByteChannel writableByteChannel = Channels.newChannel(zos);
if (dir.listFiles() != null) {
for (File file : dir.listFiles()) {
if (file.getName().endsWith(".log")) {
ZipEntry entry = new ZipEntry(file.getName());
zos.putNextEntry(entry);
fis = new FileInputStream(file);
FileChannel channel = fis.getChannel();
channel.transferTo(0, file.length() - 1, writableByteChannel);
fis.close();
}
}
}
zos.close();
writableByteChannel.close();
} catch (Exception e) {
e.printStackTrace();
}
if (zip.exists()) {
Intent share = new Intent(Intent.ACTION_SEND);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", zip);
share.putExtra(Intent.EXTRA_STREAM, contentUri);
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
} else {
share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(zip));
}
share.setType("application/vnd.ms-excel");
share.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
context.startActivity(Intent.createChooser(share, "分享文件"));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !CommonAppConfig.IS_GOOGLE_PLAY) {
if (!Environment.isExternalStorageManager()) {
Intent intent = new Intent(ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
context.startActivity(intent);
}
}
File out = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + zip.getName());
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Files.copy(zip.toPath(), out.toPath());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@@ -22,41 +22,4 @@ public class NobleUtil {
}
return -1;
}
public static String nobleIdToStringName(int id){
switch (id){
case 1:return "男爵";
case 2:return "子爵";
case 3:return "侯爵";
case 4:return "公爵";
case 5:return "国王";
case 6:return "皇帝";
case 7:return "超皇";
}
return "未开通";
}
public static int getNobleBackgroundId(int id){
switch (id){
case 1:return R.mipmap.img_aristocrat_nanjue;
case 2:return R.mipmap.img_aristocrat_zijue;
case 3:return R.mipmap.img_aristocrat_houjue;
case 4:return R.mipmap.img_aristocrat_gongjue;
case 5:return R.mipmap.img_aristocrat_guowang;
case 6:return R.mipmap.img_aristocrat_huangdi;
case 7:return R.mipmap.img_aristocrat_chaohuang;
}
return R.mipmap.img_aristocrat_notopen;
}
public static int getUserCardTitleBackgroundId(int id) {
switch (id){
case 1:return R.drawable.bg_user_card_title_nanjue;
case 2:return R.drawable.bg_user_card_title_zijue;
case 3:return R.drawable.bg_user_card_title_houjue;
case 4:return R.drawable.bg_user_card_title_gongjue;
case 5:return R.drawable.bg_user_card_title_guowang;
case 6:return R.drawable.bg_user_card_title_huangdi;
case 7:return R.drawable.bg_user_card_title_chaohuang;
}
return 0;
}
}

View File

@@ -24,26 +24,11 @@ public class RouteUtil {
public static final String PATH_LIVEREPORT = "/live/LiveReportActivity";
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity";
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
public static final String PATH_MAIN = "/main/MainActivity";
public static final String PATH_ENTRY = "/main/EntryActivity";
public static final String PATH_LIVE_AUDIENCE = "/live/LiveAudienceActivity";
public static final String PATH_SETTING = "/main/SettingActivity";
public static final String PATH_FANSACTIVITY = "/main/FansActivity";
public static final String PATH_MYWEBVIEWACTIVTITY2 = "/main/MyWebViewActivity2";
public static void forwardFansActivity(String uid) {
ARouter.getInstance().build(PATH_FANSACTIVITY)
.withString(Constants.TO_UID, uid)
.navigation();
}
public static void forwardMyWebViewActivity2(String url) {
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY2)
.withString(Constants.URL, url)
.navigation();
}
/**
* 启动页
@@ -100,7 +85,6 @@ public class RouteUtil {
}
Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis();
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY)
.withString(Constants.URL,url)
.navigation();
}
@@ -114,48 +98,6 @@ public class RouteUtil {
.navigation();
}
/**
* 跳转到装扮
*/
public static void forwardZhuangBanActivity(String url, boolean isFull) {
ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY)
.withString("url", url)
.withBoolean("isFull", isFull)
.navigation();
}
/**
* 跳转到装扮
*/
public static void forwardLiveZhuangBanActivity(String url, boolean isFull) {
ARouter.getInstance().build(PATH_LiveZHUANGBANACTIVITY)
.withString("url", url)
.withBoolean("isFull", isFull)
.navigation();
}
/**
* 跳转到装扮
*/
public static void forwardLiveZhuangBanActivity(String url, String title) {
ARouter.getInstance().build(PATH_LiveZHUANGBANACTIVITY)
.withString("url", url)
.withString("title", title)
.withBoolean("isFull", false)
.navigation();
}
/**
* 跳转到装扮
*/
public static void forwardZhuangBanActivity(String url, String title) {
ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY)
.withString("url", url)
.withString("title", title)
.withBoolean("isFull", false)
.navigation();
}
/**
* 跳转到充值页面
*/
@@ -172,7 +114,6 @@ public class RouteUtil {
ARouter.getInstance().build(PATH_EDITPROFILE)
.navigation();
}
/**
* 修改个人资料
*/
@@ -180,7 +121,6 @@ public class RouteUtil {
ARouter.getInstance().build(PATH_SETTING)
.navigation();
}
/**
* 打开直播页面
*/
@@ -202,15 +142,6 @@ public class RouteUtil {
.navigation();
}
public static void forwardLiveReportActivity(String dynamicId, int intoIndex, String communityType, String commentId) {
ARouter.getInstance().build(PATH_LIVEREPORT)
.withString(Constants.TO_UID, dynamicId)
.withInt(Constants.INTOINDEX, intoIndex)
.withString("community_type", communityType)
.withString("comment_id", commentId)
.navigation();
}
/**
* 进入facebook登录
*/

View File

@@ -1,233 +0,0 @@
package com.yunbao.common.views;
import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.DrawerPopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.adapter.CustomDrawerPopupAdapter;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
public class CustomDrawerPopupView extends DrawerPopupView {
private Context mContext;
private RecyclerView drawerList;
private CustomDrawerPopupAdapter adapter;
private List<AnchorRecommendItemModel> list = new ArrayList<>();
private String liveId;
public CustomDrawerPopupView setLiveId(String liveId) {
this.liveId = liveId;
return this;
}
public CustomDrawerPopupView setList(List<AnchorRecommendItemModel> list) {
this.list = list;
return this;
}
public CustomDrawerPopupView(@NonNull Context context) {
super(context);
mContext = context;
}
@Override
protected int getImplLayoutId() {
return R.layout.custom_drawer_popup;
}
@Override
protected void onCreate() {
Bus.getOn(this);
super.onCreate();
initView();
initData();
}
@Override
public void dismiss() {
Bus.getOff(this);
super.dismiss();
}
private void initView() {
drawerList = findViewById(R.id.drawerList);
adapter = new CustomDrawerPopupAdapter(mContext);
adapter.setList(list).setLiveId(liveId);
drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
drawerList.setAdapter(adapter);
adapter.setListener(new CustomDrawerPopupAdapter.CustomDrawerListener() {
@Override
public void goToLive(AnchorRecommendItemModel model) {
if (callBack != null) {
callBack.goToLive(model);
}
}
});
//连麦互动
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_link_mic), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.evenTheWheat();
}
}
});
//特效设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.effects_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.effectsSetting();
}
}
});
//滑动设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.slide_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.slideSetting();
}
}
});
//小窗设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.float_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.floatSetting();
}
}
});
//画质设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
}
});
//更多菜单
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu));
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Top)
.asCustom(new MoreMenuPopupView(mContext))
.show();
}
});
}
private void initData() {
LiveNetManager.get(mContext)
.getCustomSidebarInfo(new com.yunbao.common.http.base.HttpCallback<List<CustomSidebarInfoModel>>() {
@Override
public void onSuccess(List<CustomSidebarInfoModel> data) {
adapter.updateData(data);
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
private CustomDrawerPopupCallBack callBack;
public CustomDrawerPopupView setCallBack(CustomDrawerPopupCallBack callBack) {
this.callBack = callBack;
return this;
}
public interface CustomDrawerPopupCallBack {
void goToLive(AnchorRecommendItemModel model);
void informationTransfer(CustomDrawerPopupEvent event);
void funGamesID(int zfunGamesID);
void showerHtml(String htmlUrl, boolean screen);
//连麦
void evenTheWheat();
void effectsSetting();
void slideSetting();
void floatSetting();
void systemNotice();
void online();
void reportLayout();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void OnCustomDrawerPopupEvent(CustomDrawerPopupEvent event) {
//是否关闭弹窗
if (event.isDisMiss()) {
dismiss();
}
if (callBack != null) {
if (!TextUtils.isEmpty(event.getRightsInterests())) {
callBack.informationTransfer(event);
}
if (event.getActivityId() != 0) {
callBack.funGamesID(event.getActivityId());
}
if (!TextUtils.isEmpty(event.getHtmlUrl())) {
callBack.showerHtml(event.getHtmlUrl(), event.isScreen());
}
if (event.isSystemNotice()) {
dismiss();
callBack.systemNotice();
}
if (event.isOnline()) {
dismiss();
callBack.online();
}
if (event.isReportLayout()) {
dismiss();
callBack.reportLayout();
}
}
if (event.isRefresh()) {
initData();
}
}
}

View File

@@ -1,69 +0,0 @@
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.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class DrawerRecommendChildViewHolder extends RecyclerView.ViewHolder {
private ImageView icon;
private TextView title, subtitle;
public DrawerRecommendChildViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.icon);
title = itemView.findViewById(R.id.title);
subtitle = itemView.findViewById(R.id.subtitle);
}
public void setData(CustomSidebarChildModel model) {
ImgLoader.display2(itemView.getContext(), model.getIcon(), icon);
title.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
});
}
}

View File

@@ -1,80 +0,0 @@
package com.yunbao.common.views;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.adapter.DrawerRecommendAdapter;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
/**
* 侧边栏推荐布局 任务
*/
public class DrawerRecommendViewHolder extends RecyclerView.ViewHolder {
private TextView sendGoodGift, subtitle;
private RecyclerView childList;
private DrawerRecommendAdapter recommendAdapter;
public DrawerRecommendViewHolder(@NonNull View itemView) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
subtitle = itemView.findViewById(R.id.subtitle);
childList = itemView.findViewById(R.id.child_list);
recommendAdapter = new DrawerRecommendAdapter(itemView.getContext());
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 2));
childList.setAdapter(recommendAdapter);
}
public void setData(CustomSidebarInfoModel model) {
sendGoodGift.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
recommendAdapter.updateData(model.getChild());
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (TextUtils.equals(model.getSrc(), "recharge")) {
htmlUrl.append("recharge");
} else if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
});
}
}

View File

@@ -1,124 +0,0 @@
package com.yunbao.common.views;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
private ImageView icon;
private TextView title, subtitle, toReceive;
private RelativeLayout layout;
private FrameLayout toReceiveLayout;
public DrawerTaskChildViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.icon);
title = itemView.findViewById(R.id.title);
subtitle = itemView.findViewById(R.id.subtitle);
toReceive = itemView.findViewById(R.id.to_receive);
layout = itemView.findViewById(R.id.layout);
toReceiveLayout = itemView.findViewById(R.id.to_receive_layout);
}
public void setData(CustomSidebarChildModel model, int index) {
int iconImg = R.mipmap.icon_012x;
switch (model.getFlag()) {
case "send_coin_gift":
iconImg = R.mipmap.icon_012x;
break;
case "send_gold_gift":
iconImg = R.mipmap.icon_022x;
break;
case "attention":
iconImg = R.mipmap.icon_032x;
break;
case "bullet_screen":
iconImg = R.mipmap.icon_042x;
break;
case "illumine":
iconImg = R.mipmap.icon_052x;
break;
}
ImgLoader.display(itemView.getContext(), iconImg, icon);
StringBuffer titleBuffer = new StringBuffer();
titleBuffer
.append(model.getTitle())
.append("(")
.append(model.getNowNum())
.append("/")
.append(model.getNeedNum())
.append(")");
title.setText(titleBuffer.toString());
subtitle.setText(model.getSubtitle());
if (TextUtils.equals(model.getStatus(), "0")) {
layout.setEnabled(false);
toReceive.setText(R.string.to_complete);
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
toReceiveLayout.setEnabled(false);
} else if (TextUtils.equals(model.getStatus(), "1")) {
layout.setEnabled(false);
toReceive.setText(R.string.already_collected);
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status2);
toReceive.setTextColor(Color.parseColor("#DDDDDD"));
} else if (TextUtils.equals(model.getStatus(), "2")) {
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
toReceiveLayout.setEnabled(true);
layout.setEnabled(true);
toReceive.setText(R.string.to_receive);
}
ViewClicksAntiShake.clicksAntiShake(toReceive, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.equals(model.getStatus(), "2")) {
LiveNetManager.get(itemView.getContext())
.sendTaskGift(model.getFlag(), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
if (listener != null) {
listener.giftSuccess(model, index);
}
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true));
}
}
});
}
private DrawerTaskChildListener listener;
public DrawerTaskChildViewHolder setListener(DrawerTaskChildListener listener) {
this.listener = listener;
return this;
}
public interface DrawerTaskChildListener {
void giftSuccess(CustomSidebarChildModel model, int index);
}
}

View File

@@ -1,79 +0,0 @@
package com.yunbao.common.views;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.adapter.DrawerTaskAdapter;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
/**
* 侧边栏任务布局
*/
public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
private TextView sendGoodGift, subtitle;
private RecyclerView childList;
private DrawerTaskAdapter taskAdapter;
public DrawerTaskViewHolder(@NonNull View itemView) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
subtitle = itemView.findViewById(R.id.subtitle);
childList = itemView.findViewById(R.id.child_list);
taskAdapter = new DrawerTaskAdapter(itemView.getContext());
childList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.VERTICAL, false));
childList.setAdapter(taskAdapter);
}
public void setData(CustomSidebarInfoModel model) {
sendGoodGift.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
taskAdapter.updateData(model.getChild());
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
});
}
}

View File

@@ -1,81 +0,0 @@
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.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
private ImageView funGamePic;
private TextView funGameName;
public FunGamesChildViewHolder(@NonNull View itemView) {
super(itemView);
funGamePic = itemView.findViewById(R.id.fun_game_pic);
funGameName = itemView.findViewById(R.id.fun_game_name);
}
public void setData(CustomSidebarChildModel model, boolean rigts) {
if (rigts) {
ImgLoader.display(itemView.getContext(), model.getIcon(), funGamePic);
} else {
ImgLoader.display(itemView.getContext(), model.getResIcon(), funGamePic);
}
funGameName.setText(model.getTitle());
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (!rigts) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setRightsInterests(model.getTitle()));
} else {
int activityID = TextUtils.isEmpty(model.getActivityId()) ? 0 : Integer.parseInt(model.getActivityId());
if (activityID != 0) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setActivityId(activityID));
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}
Bus.get().post(new CustomDrawerPopupEvent()
.setHtmlUrl(htmlUrl.toString())
.setDisMiss(true)
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
}
});
}
}

View File

@@ -1,105 +0,0 @@
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.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.adapter.FunGamesAdapter;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.List;
public class FunGamesViewHolder extends RecyclerView.ViewHolder {
private FunGamesAdapter funGamesAdapter;
private TextView sendGoodGift, subtitle, selectMore;
private RecyclerView childList;
private ImageView selectMoreIcon;
boolean isShowMore = true;
public FunGamesViewHolder(@NonNull View itemView) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
subtitle = itemView.findViewById(R.id.subtitle);
childList = itemView.findViewById(R.id.child_list);
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
selectMore = itemView.findViewById(R.id.select_more);
funGamesAdapter = new FunGamesAdapter(itemView.getContext(), true);
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
childList.setAdapter(funGamesAdapter);
}
public void setData(CustomSidebarInfoModel model) {
List<CustomSidebarChildModel> sidebarChildModels = model.getChild();
// sidebarChildModels.addAll(model.getChild());
// sidebarChildModels.addAll(model.getChild());
itemView.findViewById(R.id.select_more_layout).setVisibility(sidebarChildModels.size() >= 8 ? View.VISIBLE : View.GONE);
sendGoodGift.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
funGamesAdapter.updateData(sidebarChildModels);
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
});
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.select_more_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (isShowMore) {
funGamesAdapter.selectAll(sidebarChildModels);
selectMore.setText(R.string.video_comment_collapsed);
ImgLoader.display(itemView.getContext(), R.mipmap.icon_more_up, selectMoreIcon);
} else {
funGamesAdapter.updateData(sidebarChildModels);
selectMore.setText(R.string.moer);
ImgLoader.display(itemView.getContext(), R.mipmap.icon_more_down, selectMoreIcon);
}
isShowMore = !isShowMore;
}
});
}
}

View File

@@ -1,54 +0,0 @@
package com.yunbao.common.views;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class MoreMenuPopupView extends AttachPopupView {
public MoreMenuPopupView(@NonNull Context context) {
super(context);
}
@Override
protected int getImplLayoutId() {
return R.layout.view_more_menu;
}
@Override
protected void onCreate() {
//系统通知
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setSystemNotice(true));
}
});
//在线客服
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setOnline(true));
}
});
//举报
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.report_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setReportLayout(true));
}
});
}
}

View File

@@ -1,62 +0,0 @@
package com.yunbao.common.views;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import com.yunbao.common.R;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class RecommendChildViewHolder extends RecyclerView.ViewHolder {
private ImageView cover;
private ImageView liveType;
private TextView name;
public RecommendChildViewHolder(@NonNull View itemView) {
super(itemView);
cover = itemView.findViewById(R.id.cover);
liveType = itemView.findViewById(R.id.live_type);
name = itemView.findViewById(R.id.name);
}
public void setData(AnchorRecommendItemModel bean) {
Context mContext = itemView.getContext();
if (bean.getContentPicSizeTwo() != null && !bean.getContentPicSizeTwo().equals("")) {
Picasso.with(mContext)
.load(bean.getContentPicSizeTwo())
.into(liveType);
} else if (bean.getContentPicSizeThree() != null && !bean.getContentPicSizeThree().equals("")) {
Picasso.with(mContext)
.load(bean.getContentPicSizeThree())
.into(liveType);
}
ImgLoader.display(itemView.getContext(), bean.getThumb(), cover);
name.setText(bean.getUserNicename());
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (listener != null) {
listener.goToLive(bean);
}
}
});
}
private RecommendChildListener listener;
public RecommendChildViewHolder setListener(RecommendChildListener listener) {
this.listener = listener;
return this;
}
public interface RecommendChildListener {
void goToLive(AnchorRecommendItemModel model);
}
}

View File

@@ -1,78 +0,0 @@
package com.yunbao.common.views;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.adapter.RecommendAdapter;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.List;
public class RecommendViewHolder extends RecyclerView.ViewHolder {
private TextView sendGoodGift, subtitle;
private RecyclerView childList;
private RecommendAdapter recommendAdapter;
public RecommendViewHolder(@NonNull View itemView) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
subtitle = itemView.findViewById(R.id.subtitle);
childList = itemView.findViewById(R.id.child_list);
recommendAdapter = new RecommendAdapter(itemView.getContext());
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 3));
childList.setAdapter(recommendAdapter);
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (listener != null) {
listener.changeOneBatch();
}
}
});
recommendAdapter.setCallback(new RecommendAdapter.RecommendCallback() {
@Override
public void goToLive(AnchorRecommendItemModel model) {
if (listener != null) {
listener.goToLive(model);
}
}
});
}
public void setData(CustomSidebarInfoModel model) {
sendGoodGift.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
}
public void updateData(List<AnchorRecommendItemModel> list) {
if (list.size() == 0) {
itemView.setVisibility(View.GONE);
} else {
itemView.setVisibility(View.VISIBLE);
}
recommendAdapter.updateData(list);
}
private RecommendViewListener listener;
public RecommendViewHolder setListener(RecommendViewListener listener) {
this.listener = listener;
return this;
}
public interface RecommendViewListener {
void changeOneBatch();
void goToLive(AnchorRecommendItemModel model);
}
}

View File

@@ -1,55 +0,0 @@
package com.yunbao.common.views;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.adapter.FunGamesAdapter;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import java.util.ArrayList;
import java.util.List;
public class RigtsInterestsViewHolder extends RecyclerView.ViewHolder {
private FunGamesAdapter funGamesAdapter;
private TextView sendGoodGift;
private RecyclerView childList;
public RigtsInterestsViewHolder(@NonNull View itemView) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
funGamesAdapter = new FunGamesAdapter(itemView.getContext(), false);
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 3));
childList.setAdapter(funGamesAdapter);
}
public void setData(CustomSidebarInfoModel model) {
sendGoodGift.setText(model.getTitle());
funGamesAdapter.updateData(generateData());
}
private List<CustomSidebarChildModel> generateData() {
List<CustomSidebarChildModel> child = new ArrayList<>();
child.add(new CustomSidebarChildModel()
.setTitle(itemView.getContext().getString(R.string.noble))
.setResIcon(R.mipmap.live_more_icon_aristocrat));
child.add(new CustomSidebarChildModel()
.setTitle(itemView.getContext().getString(R.string.guard_guard))
.setResIcon(R.mipmap.live_more_icon_guard));
child.add(new CustomSidebarChildModel()
.setTitle(itemView.getContext().getString(R.string.fan_club))
.setResIcon(R.mipmap.live_more_icon_fans));
return child;
}
}

View File

@@ -7,17 +7,16 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.FragmentActivity;
import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.enums.ShowPattern;
import com.lzf.easyfloat.interfaces.FloatCallbacks;
import com.lzf.easyfloat.interfaces.OnInvokeView;
import com.tencent.rtmp.ITXLivePlayListener;
import com.tencent.rtmp.TXLivePlayer;
import com.tencent.live2.V2TXLivePlayer;
import com.tencent.live2.V2TXLivePlayerObserver;
import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.R;
import com.yunbao.common.bean.LiveBean;
@@ -25,7 +24,6 @@ import com.yunbao.common.dialog.HintDialog;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.floatingview.FloatingMagnetView;
@@ -49,7 +47,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
private int mLiveTypeVal;
private FloatCallbacks.Builder builder;
private String TAG = "LiveFloatView";
private TXLivePlayer mPlayer;
private V2TXLivePlayer mPlayer;
public static LiveFloatView getInstance() {
if (instance == null) {
@@ -70,50 +68,30 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
.setMagnetViewListener(new MagnetViewListener() {
@Override
public void invoke(FloatingMagnetView magnetView) {
CardView layout = magnetView.findViewById(R.id.layout);
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
if (mLiveBean.getLandscape() == 1) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view);
mPlayer = new TXLivePlayer(mContext);
mPlayer.setPlayerView(videoView);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
mPlayer.setPlayListener(new ITXLivePlayListener() {
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
mPlayer.setObserver(new V2TXLivePlayerObserver() {
@Override
public void onPlayEvent(int event, Bundle param) {
float videoWidth = param.getInt("EVT_PARAM1", 0);
float videoHeight = param.getInt("EVT_PARAM2", 0);
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
if (mLiveBean.getLandscape() != 1){
if (videoWidth > 720) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
layout.setLayoutParams(cardParams);
}
public void onWarning(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onWarning(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
}
@Override
public void onNetStatus(Bundle bundle) {
public void onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onError(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
}
});
ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay(true);
mPlayer.stopPlay();
APPEasyFloat.getInstance().dismiss(mContext);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
if (IMLoginManager.get(mContext).isHint2()) {
HintDialog fragment = new HintDialog();
Bundle args = new Bundle();
args.putString("close", "1");
@@ -122,8 +100,8 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
}
}
});
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
mPlayer.stopPlay(true);
ViewClicksAntiShake.clicksAntiShake(magnetView, () -> {
mPlayer.stopPlay();
APPEasyFloat.getInstance().dismiss(mContext);
new Handler().post(liveCheck);
@@ -139,7 +117,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void dismiss() {
if (mPlayer != null)
mPlayer.stopPlay(true);
mPlayer.stopPlay();
}
})
.show(mContext);
@@ -178,14 +156,15 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
callback.invoke(aBoolean);
}
builder.dismiss(() -> {
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.stopPlay(true);
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.stopPlay();
}
return null;
});
builder.hide(view12 -> {
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.pause();
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.pauseAudio();
mPlayer.pauseVideo();
}
return null;
});
@@ -203,49 +182,14 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void invoke(View view) {
TXCloudVideoView videoView = view.findViewById(R.id.video_view);
CardView layout = view.findViewById(R.id.layout);
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
if (mLiveBean.getLandscape() == 1) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
layout.setLayoutParams(cardParams);
mPlayer = new TXLivePlayer(mContext);
mPlayer.setPlayerView(videoView);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
mPlayer.setPlayListener(new ITXLivePlayListener() {
@Override
public void onPlayEvent(int event, Bundle param) {
float videoWidth = param.getInt("EVT_PARAM1", 0);
float videoHeight = param.getInt("EVT_PARAM2", 0);
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
if (mLiveBean.getLandscape() != 1){
if (videoWidth > 720) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
layout.setLayoutParams(cardParams);
}
}
@Override
public void onNetStatus(Bundle bundle) {
}
});
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay(true);
mPlayer.stopPlay();
EasyFloat.dismiss("LiveFloatView", true);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog();
@@ -258,7 +202,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
});
ViewClicksAntiShake.clicksAntiShake(view, () -> {
mPlayer.stopPlay(true);
mPlayer.stopPlay();
new Handler().post(liveCheck);

View File

@@ -22,9 +22,9 @@ public class ViewClicksAntiShake {
/**
* 防抖
*/
public static void clicksAntiShake(int duration, View view, ViewClicksCallBack callBack) {
public static void clicksAntiShake(View view, ViewClicksCallBack callBack) {
RxView.clicks(view)
.throttleFirst(duration, TimeUnit.MILLISECONDS)
.throttleFirst(800, TimeUnit.MILLISECONDS)
.subscribe(new Observer<Unit>() {
@Override
public void onSubscribe(Disposable d) {
@@ -48,8 +48,4 @@ public class ViewClicksAntiShake {
}
});
}
public static void clicksAntiShake(View view, ViewClicksCallBack callBack) {
clicksAntiShake(800, view, callBack);
}
}

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="16dp"
android:topLeftRadius="16dp" />
<solid android:color="#15151D" />
</shape>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="100dp" android:height="36dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffc621" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:radius="7dp"/>
<solid android:color="#20ffffff"/>
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:radius="7dp"/>
<solid android:color="#20000000"/>
</shape>
</item>
<!-- <item android:state_enabled="true">-->
<!-- <shape>-->
<!-- <corners android:radius="7dp" />-->
<!-- <solid android:color="#7000" />-->
<!-- </shape>-->
<!-- </item>-->
<!-- <item android:state_enabled="false">-->
<!-- <shape>-->
<!-- <corners android:radius="7dp" />-->
<!-- <solid android:color="#7000" />-->
<!-- </shape>-->
<!-- </item>-->
</selector>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:radius="7dp" />
<solid android:color="#30FFD35A" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:radius="7dp" />
<solid android:color="#2C2B39" />
</shape>
</item>
</selector>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:radius="12.5dp" />
<solid android:color="#FFE59A" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:radius="12.5dp" />
<solid android:color="@color/white" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="12.5dp" />
<solid android:color="#40FFFFFF" />
</shape>
</item>
</selector>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:radius="18dp" />
<shape>
<corners android:radius="10dp"/>
<stroke android:width="1dp" android:color="#b6b6b6"/>
</shape>
</item>
<item android:state_checked="false">

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#F8C4C4" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#C4F8F6" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#F8E4C4" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#E2F6FF" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#F8CEC4" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#ffe9e2ff" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="375dp" android:height="93dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffff" android:endColor="#E2FFF7" android:angle="90" />
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
</shape>
</item>
</selector>

View File

@@ -1,174 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="330dp"
android:layout_height="match_parent"
android:background="@drawable/backgroud_custom_drawer_popup"
android:orientation="vertical">
<HorizontalScrollView
android:id="@+id/basic_tools_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="34dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_link_mic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_connect_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_link_mic_2"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/effects_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_special_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/effects_settings"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/slide_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_sliding_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/slide_settings"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/float_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_fenestrule_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/small_window"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/system_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_hd" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/image_quality_selection"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_more" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/more_settings"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/drawerList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/basic_tools_layout"
android:layout_marginTop="48dp" />
<View
android:id="@+id/more_menu"
android:layout_width="20dp"
android:layout_height="1dp"
android:layout_above="@id/basic_tools_layout"
android:layout_alignParentEnd="true"
android:layout_marginEnd="14dp"
android:layout_marginBottom="4dp" />
</RelativeLayout>

View File

@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="280dp"
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_marginBottom="15dp"
android:layout_marginTop="15dp"
android:gravity="center_horizontal"
android:text="@string/dialog_tip"
android:textColor="@color/textColor"
android:textSize="15sp"
/>
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:textColor="#161616"
android:textSize="14sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:gravity="center"
android:layout_marginBottom="22dp"
android:layout_height="40dp">
<TextView
android:id="@+id/btn_cancel"
android:layout_width="87dp"
android:layout_height="33dp"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#FFC621"
android:layout_marginRight="7dp"
android:textSize="14sp"
android:background="@drawable/bg_dialog_unfollow_cancel"
/>
<TextView
android:id="@+id/btn_confirm"
android:layout_width="87dp"
android:layout_height="33dp"
android:gravity="center"
android:layout_marginLeft="7dp"
android:text="@string/confirm"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:background="@mipmap/tipbox_btn_orange"
/>
</LinearLayout>
</LinearLayout>

View File

@@ -1,46 +0,0 @@
<?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="94dp"
android:layout_marginTop="4dp"
android:layout_marginStart="4dp"
android:orientation="vertical"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/live_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:gravity="center" />
<View
android:layout_width="match_parent"
android:layout_height="35.12dp"
android:layout_gravity="bottom"
android:background="@mipmap/bg_main_item_bottom" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="4dp"
android:textColor="#FFF6F7FB"
android:textSize="11sp" />
</FrameLayout>
</androidx.cardview.widget.CardView>

View File

@@ -1,8 +1,8 @@
<?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:layout_height="80dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center">
<LinearLayout
@@ -15,10 +15,10 @@
<ImageView
android:id="@+id/img"
android:layout_width="60dp"
android:layout_height="60dp"
app:riv_oval="true"
android:src="@mipmap/ic_launcher"
app:riv_oval="true" />
android:layout_width="60dp"
android:layout_height="60dp"/>
<LinearLayout
android:layout_width="match_parent"
@@ -28,22 +28,22 @@
android:orientation="vertical">
<TextView
android:id="@+id/title"
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我开播了!"
android:textSize="15sp"
android:textColor="@color/yellow4"
android:textSize="15sp" />
android:text="我开播了!"/>
<TextView
android:id="@+id/content"
<TextView android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginTop="5dp"
android:text="说好的,你今天来看我直播!"
android:textColor="@color/gray3"
android:textSize="15sp" />
android:text="说好的,你今天来看我直播!"/>
</LinearLayout>
@@ -52,9 +52,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:text="PD LIVE"
android:textColor="@color/gray3" />
android:textColor="@color/gray3"
android:layout_alignParentRight="true"
android:text="PD LIVE"/>
</RelativeLayout>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginStart="6dp"
android:background="@drawable/bg_drawer_popup">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"
android:scaleType="fitCenter" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="15dp"
android:layout_toEndOf="@+id/icon"
android:text="首充特惠大禮包"
android:textColor="#F6F7FB"
android:textSize="12sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_toEndOf="@+id/icon"
android:text="首充特惠大禮包"
android:textColor="#9A9A9A"
android:textSize="10sp" />
</RelativeLayout>

View File

@@ -1,11 +1,10 @@
<?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="wrap_content"
android:layout_width="210dp"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/layout"
android:layout_width="230dp"
android:layout_height="130dp"
android:layout_marginStart="25dp"

View File

@@ -1,24 +0,0 @@
<?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:layout_marginTop="12dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/fun_game_pic"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@mipmap/live_more_icon_guard" />
<TextView
android:id="@+id/fun_game_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/guard_guard"
android:textColor="#9A9A9A"
android:textSize="10sp" />
</LinearLayout>

View File

@@ -1,72 +0,0 @@
<?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:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/send_good_gift"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任務中心"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:drawableEnd="@mipmap/icon_more_02"
android:drawablePadding="3dp"
android:text="查看更多"
android:textColor="#A1A7BE"
android:textSize="12sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" />
<LinearLayout
android:id="@+id/select_more_layout"
android:layout_width="wrap_content"
android:padding="14dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical">
<TextView
android:id="@+id/select_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/moer"
android:textColor="#EEF1FF"
android:textSize="12sp" />
<ImageView
android:id="@+id/select_more_icon"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginStart="3dp"
android:src="@mipmap/icon_more_down" />
</LinearLayout>
</LinearLayout>

View File

@@ -1,48 +0,0 @@
<?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:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/send_good_gift"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="充值送好禮"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:drawableEnd="@mipmap/icon_more_02"
android:drawablePadding="3dp"
android:text="去充值"
android:textColor="#A1A7BE"
android:textSize="12sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:paddingStart="4dp"
android:paddingEnd="10dp" />
</LinearLayout>

View File

@@ -1,82 +0,0 @@
<?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="176dp"
android:layout_height="62dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/system_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_system" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/system_notice"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_service" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/online_service"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/report_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_report" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/report"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@@ -1,49 +0,0 @@
<?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:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/send_good_gift"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任務中心"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:drawableStart="@mipmap/icon_change"
android:drawablePadding="3dp"
android:gravity="center_vertical"
android:text="查看更多"
android:textColor="#A1A7BE"
android:textSize="12sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="16dp" />
</LinearLayout>

View File

@@ -1,32 +0,0 @@
<?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:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/send_good_gift"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任務中心"
android:textColor="#F6F7FB"
android:textSize="14sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" />
</LinearLayout>

View File

@@ -1,46 +0,0 @@
<?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:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/send_good_gift"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任務中心"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:drawableEnd="@mipmap/icon_more_02"
android:drawablePadding="3dp"
android:text="查看更多"
android:textColor="#A1A7BE"
android:textSize="12sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp" />
</LinearLayout>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="58dp"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_drawer_popup_task">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginStart="9dp"
android:scaleType="fitCenter" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:layout_marginTop="10dp"
android:layout_toEndOf="@id/icon"
android:text="赠送送玫瑰 (5/5)"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginStart="9dp"
android:layout_marginTop="4dp"
android:layout_toEndOf="@id/icon"
android:text="赠送送玫瑰 (5/5)"
android:textColor="#9A9A9A"
android:textSize="10sp" />
<FrameLayout
android:id="@+id/to_receive_layout"
android:layout_width="58dp"
android:layout_height="25dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="9dp"
android:background="@drawable/bg_drawer_popup_task_status"
android:gravity="center">
<TextView
android:id="@+id/to_receive"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="领取"
android:textColor="#15151D"
android:textSize="12sp" />
</FrameLayout>
</RelativeLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

Some files were not shown because too many files have changed in this diff Show More