Compare commits

..

7 Commits

Author SHA1 Message Date
b184d5255f 移除Debug显示信息 2023-02-14 15:15:37 +08:00
4d9dbadea5 新增一处优化内存点
修复闪退回到首页后是默认在社区并且连不上IM的问题
2023-02-14 14:11:31 +08:00
0294296ada Merge branch 'master' into tmp_mon
# Conflicts:
#	main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
2023-02-14 10:16:06 +08:00
af00538101 Merge branch 'master' into tmp_mon
# Conflicts:
#	live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java
2023-02-09 10:06:06 +08:00
13c53644a2 update 优化OOM点 2022-12-26 10:47:13 +08:00
0f9bd6aa3c Merge branch 'master' into dev_tmp
# Conflicts:
#	main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
2022-12-26 09:45:28 +08:00
33ee465a43 修复部分内存泄漏问题 2022-12-23 10:27:25 +08:00
1002 changed files with 4771 additions and 45228 deletions

View File

@@ -55,8 +55,8 @@ public class FURenderer extends IFURenderer {
private FURenderKit mFURenderKit;
/* AI道具*/
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
private String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
private String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
/* GL 线程 ID */
private Long mGlThreadId = 0L;

View File

@@ -314,35 +314,6 @@ public class FileUtils {
return null;
}
public static String copyAssetsFile(Context context, String assetsPath, String fileName, String saveFileDir) {
File fileDir = new File(saveFileDir);
if (!fileDir.exists()) {
fileDir.mkdirs();
}
File file = new File(fileDir, fileName);
if (file.exists()) {
return file.getAbsolutePath();
}
try {
InputStream inputStream = context.getAssets().open(assetsPath);
FileOutputStream fos = new FileOutputStream(file);
BufferedInputStream bis = new BufferedInputStream(inputStream);
BufferedOutputStream bos = new BufferedOutputStream(fos);
byte[] byteArray = new byte[1024];
int bytes = bis.read(byteArray);
while (bytes > 0) {
bos.write(byteArray, 0, bytes);
bos.flush();
bytes = bis.read(byteArray);
}
bos.close();
fos.close();
return file.getAbsolutePath();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 获取Uri文件绝对路径
@@ -551,7 +522,6 @@ public class FileUtils {
/**
* 遍历一个文件夹获取改文件夹下所有文件名
*
* @param path
* @return
*/
@@ -593,7 +563,7 @@ public class FileUtils {
* @param path String
* @return Boolean
*/
public static Boolean checkIsVideo(Context context, String path) {
public static Boolean checkIsVideo(Context context,String path) {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(context, Uri.fromFile(new File(path)));

View File

@@ -1,5 +1,8 @@
package com.yunbao.faceunity;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
@@ -7,5 +10,8 @@ package com.yunbao.faceunity;
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

1
Share/.gitignore vendored
View File

@@ -1 +0,0 @@
/build

View File

@@ -1,73 +0,0 @@
apply plugin: 'com.android.library'
apply plugin: 'img-optimizer'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so"
pickFirst "lib/armeabi-v7a/libyuvutils.so"
pickFirst "lib/armeabi/libyuvtools.so"
pickFirst "lib/arm64-v8a/libyuvtools.so"
pickFirst "lib/armeabi-v7a/libyuvtools.so"
exclude "lib/arm64-v8a/libmmcv_api_handgesture.so"
exclude "lib/arm64-v8a/libmmcv_api_express.so"
exclude "lib/arm64-v8a/libMediaEncoder.so"
exclude "lib/arm64-v8a/libarcore_sdk_c.so"
exclude "lib/arm64-v8a/libmediadecoder.so"
exclude "lib/arm64-v8a/libMediaMuxer.so"
exclude "lib/arm64-v8a/libarcore_sdk_jni.so"
exclude "lib/arm64-v8a/libMediaUtils.so"
exclude "lib/arm64-v8a/libcosmosffmpeg.so"
}
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
manifestPlaceholders = rootProject.ext.manifestPlaceholders
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
aaptOptions {
cruncherEnabled = false
useNewCruncher = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs', '../libs'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies["appcompat-androidx"]
implementation rootProject.ext.dependencies["recyclerview-androidx"]
//common
implementation project(path: ':common')
//Twitter
implementation 'com.twitter.sdk.android:twitter:3.1.1'
//facebook & Messenger
implementation 'com.facebook.android:facebook-share:15.2.0'
}

View File

@@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -1,26 +0,0 @@
package com.yunbao.share;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.yunbao.share.test", appContext.getPackageName());
}
}

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.pdlive.shayu">
<queries>
<package android:name="com.pdlive.shayu"/>
<package android:name="com.facebook.orca"/>
<package
android:name="com.facebook.composer" />
<package
android:name="com.facebook.katana" />
<package
android:name="com.facebook.messenger" />
<provider
android:authorities="com.facebook.katana.provider.PlatformProvider"
tools:ignore="ExportedContentProvider" />
</queries>
<application android:allowBackup="true">
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider2011402032399020"
android:exported="true" />
<receiver
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_SUCCESS" />
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_FAILURE" />
<action android:name="com.twitter.sdk.android.tweetcomposer.TWEET_COMPOSE_CANCEL" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -1,34 +0,0 @@
package com.yunbao.share;
import android.content.Context;
import android.content.IntentFilter;
import android.net.Uri;
import androidx.core.content.FileProvider;
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.receiver.TwitterResultReceiver;
import java.io.File;
public abstract class AbsShareInterface {
protected final Context mContext;
public AbsShareInterface(Context context) {
this.mContext = context;
IntentFilter filter = new IntentFilter(TweetUploadService.UPLOAD_SUCCESS);
filter.addAction(TweetUploadService.UPLOAD_FAILURE);
filter.addAction(TweetUploadService.TWEET_COMPOSE_CANCEL);
context.registerReceiver(new TwitterResultReceiver(), filter);
}
public abstract void share(ShareBuilder builder, ICallback callback);
public Uri fileToUri(File file){
return FileProvider.getUriForFile(mContext,
mContext.getPackageName() + ".fileprovider",
file
);
}
}

View File

@@ -1,6 +0,0 @@
package com.yunbao.share;
public interface ICallback {
void onSuccess();
void onFailure();
}

View File

@@ -1,130 +0,0 @@
package com.yunbao.share.adapters;
import android.content.Context;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;
import com.pdlive.shayu.R;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.platform.FacebookShare;
import com.yunbao.share.platform.Instagram;
import com.yunbao.share.platform.Line;
import com.yunbao.share.platform.MessengerShare;
import com.yunbao.share.platform.TwitterShare;
import com.yunbao.share.platform.WhatsApp;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
private Context mContext;
private List<ShareBuilder> list;
public ShareAppAdapter(Context mContext) {
list = new ArrayList<>();
this.mContext = mContext;
}
public void setList(List<ShareBuilder> list) {
this.list = list;
notifyDataSetChanged();
}
@NonNull
@Override
public AppViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new AppViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_share_app, parent, false));
}
@Override
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
ShareBuilder builder = list.get(position);
switch (builder.getType()) {
case ShareBuilder.APP_FACEBOOK:
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
break;
case ShareBuilder.APP_LINE:
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
break;
case ShareBuilder.APP_TWITTER:
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
break;
case ShareBuilder.APP_WHATSAPP:
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
break;
case ShareBuilder.APP_MESSENGER:
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
break;
case ShareBuilder.APP_INSTAGRAM:
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
break;
}
}
@Override
public int getItemCount() {
return list.size();
}
public static class AppViewHolder extends RecyclerView.ViewHolder {
ImageView icon;
TextView title;
public AppViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.share_app_icon);
title = itemView.findViewById(R.id.share_app_name);
}
public void setData(ShareBuilder bean, @DrawableRes int iconId, @StringRes int appName) {
icon.setImageResource(iconId);
title.setText(appName);
itemView.setOnClickListener(v -> {
switch (bean.getType()) {
case ShareBuilder.APP_FACEBOOK:
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_LINE:
new Line(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_TWITTER:
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_WHATSAPP:
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_MESSENGER:
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_INSTAGRAM:
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
break;
}
});
}
private static class ShareCallback implements ICallback {
@Override
public void onSuccess() {
}
@Override
public void onFailure() {
}
}
}
}

View File

@@ -1,134 +0,0 @@
package com.yunbao.share.bean;
import androidx.annotation.NonNull;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.StringUtil;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Locale;
public class ShareBuilder {
public static final int APP_FACEBOOK = 0;
public static final int APP_LINE = 1;
public static final int APP_TWITTER = 2;
public static final int APP_WHATSAPP = 3;
public static final int APP_MESSENGER = 4;
public static final int APP_INSTAGRAM = 5;
private String text;
private String link;
private File file;
private int type;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
return String.format(CommonAppConfig.HOST +
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
anchorId,
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
) ;
}
public static String createInviteLink(String shareUid) {
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
);
}
public static ShareBuilder builder(int type) {
return new ShareBuilder(type);
}
private ShareBuilder(int type) {
this.type = type;
}
public int getType() {
return type;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getAnchorId() {
return anchorId;
}
public void setAnchorId(String anchorId) {
this.anchorId = anchorId;
}
public String getAnchorName() {
return anchorName;
}
public void setAnchorName(String anchorName) {
this.anchorName = anchorName;
}
public String getAnchorAvatar() {
return anchorAvatar;
}
public void setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
}
public ShareBuilder setText(String text) {
this.text = text;
return this;
}
public ShareBuilder setLink(String link) {
this.link = link;
return this;
}
public ShareBuilder setFile(File file) {
this.file = file;
return this;
}
public String getText() {
if (StringUtil.isEmpty(text)) {
return getLink();
}
return text + "\n" + getLink();
}
public String getLink() {
if (StringUtil.isEmpty(link)) {
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
}
return link;
}
public File getFile() {
return file;
}
@NonNull
@Override
public String toString() {
return "ShareBuilder{" +
"text='" + text + '\'' +
", link='" + link + '\'' +
", file=" + file +
'}';
}
}

View File

@@ -1,48 +0,0 @@
package com.yunbao.share.platform;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.share.Sharer;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.ShareDialog;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
public class FacebookShare extends AbsShareInterface {
public static CallbackManager callbackManager;
public FacebookShare(Context context) {
super(context);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
callbackManager= CallbackManager.Factory.create();
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(builder.getLink()))
.build();
ShareDialog dialog=new ShareDialog((Activity) mContext);
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
}
@Override
public void onCancel() {
}
@Override
public void onError(@NonNull FacebookException e) {
}
});
dialog.show(content);
}
}

View File

@@ -1,27 +0,0 @@
package com.yunbao.share.platform;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
public class Instagram extends AbsShareInterface {
public Instagram(Context context) {
super(context);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
String type = "image/*";
Intent share = new Intent(Intent.ACTION_SEND);
Uri uri = fileToUri(builder.getFile());
share.setType(type);
share.putExtra(Intent.EXTRA_STREAM, uri);
share.setPackage("com.instagram.android");
mContext.startActivity(Intent.createChooser(share, "Share to"));
callback.onSuccess();
}
}

View File

@@ -1,31 +0,0 @@
package com.yunbao.share.platform;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import java.net.URLEncoder;
public class Line extends AbsShareInterface {
public Line(Context context) {
super(context);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
try {
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
mContext.startActivity(share);
callback.onSuccess();
} catch (Exception e) {
callback.onFailure();
throw new RuntimeException(e);
}
}
}

View File

@@ -1,57 +0,0 @@
package com.yunbao.share.platform;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.share.Sharer;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.MessageDialog;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
public class MessengerShare extends AbsShareInterface {
public static CallbackManager callbackManager;
public MessengerShare(Context context) {
super(context);
FacebookSdk.setIsDebugEnabled(true);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
callbackManager = CallbackManager.Factory.create();
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(builder.getLink()))
.build();
MessageDialog dialog = new MessageDialog((Activity) mContext);
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
callback.onSuccess();
}
@Override
public void onCancel() {
}
@Override
public void onError(@NonNull FacebookException e) {
e.printStackTrace();
}
});
if(dialog.canShow(content)) {
dialog.show(content);
}else{
callback.onFailure();
}
}
}

View File

@@ -1,73 +0,0 @@
package com.yunbao.share.platform;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.twitter.sdk.android.core.Twitter;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import java.net.URLEncoder;
public class TwitterShare extends AbsShareInterface {
public TwitterShare(Context context) {
super(context);
Twitter.initialize(context);
}
@Override
public void share(ShareBuilder date, ICallback callback) {
/*
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> result) {
//获取以下登录成功返回信息进行登录验证
//获取登录用户信息
final TwitterSession activeSession=TwitterCore.getInstance().getSessionManager().getActiveSession();
Intent intent = new ComposerActivity.Builder(mContext)
.session(activeSession)
.image(fileToUri(date.getFile()))
.text(date.getText())
.hashtags("#twitter")
.createIntent();
mContext.startActivity(intent);
}
@Override
public void failure(TwitterException e) {
}
});*/
/* TweetComposer.Builder builder;
if (date.getFile() == null) {
try {
builder=new TweetComposer.Builder(mContext)
.text(date.getText())
.url(new URL(date.getLink()));
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
} else {
builder = new TweetComposer.Builder(mContext)
.text(date.getText())
.image(fileToUri(date.getFile()));
}
builder.show();*/
try {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_VIEW);
sendIntent.putExtra(Intent.EXTRA_TEXT, date.getText());
// sendIntent.setType("text/plain");
//sendIntent.setPackage("com.twitter.composer.ComposerShareActivity");
sendIntent.setData(Uri.parse("https://twitter.com/intent/tweet?text=" +URLEncoder.encode(date.getText(),"UTF-8")));
mContext.startActivity(sendIntent);
callback.onSuccess();
} catch (Exception e) {
callback.onFailure();
}
}
}

View File

@@ -1,30 +0,0 @@
package com.yunbao.share.platform;
import android.content.Context;
import android.content.Intent;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
public class WhatsApp extends AbsShareInterface {
public WhatsApp(Context context) {
super(context);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
try {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, builder.getText());
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
mContext.startActivity(sendIntent);
callback.onSuccess();
} catch (Exception e) {
callback.onFailure();
}
}
}

View File

@@ -1,28 +0,0 @@
package com.yunbao.share.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
import com.yunbao.common.utils.ToastUtil;
public class TwitterResultReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i("分享log", "onReceive: "+intent.getAction());
if (TweetUploadService.UPLOAD_SUCCESS.equals(intent.getAction())) {
ToastUtil.show("推特分享成功");
// success
final Long tweetId = intent.getExtras().getLong(TweetUploadService.EXTRA_TWEET_ID);
} else if (TweetUploadService.UPLOAD_FAILURE.equals(intent.getAction())) {
// failure
ToastUtil.show("推特分享失败");
final Intent retryIntent = intent.getExtras().getParcelable(TweetUploadService.EXTRA_RETRY_INTENT);
} else if (TweetUploadService.TWEET_COMPOSE_CANCEL.equals(intent.getAction())) {
// cancel
ToastUtil.show("推特分享取消");
}
}
}

View File

@@ -1,158 +0,0 @@
package com.yunbao.share.ui;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.pdlive.shayu.R;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.adapters.ShareAppAdapter;
import java.util.ArrayList;
import java.util.List;
public class InvitePopDialog extends AbsDialogPopupWindow {
private ShareAppAdapter adapter;
private RecyclerView list;
private RoundedImageView avatar;
private TextView info;
private TextView link;
private TextView title;
private List<ShareBuilder> data;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
private String url;
public InvitePopDialog(@NonNull Context context) {
super(context);
}
public InvitePopDialog setUid(String uid) {
this.uid = uid;
return this;
}
public InvitePopDialog setAnchorId(String anchorId) {
this.anchorId = anchorId;
return this;
}
public InvitePopDialog setAnchorName(String anchorName) {
this.anchorName = anchorName;
return this;
}
public InvitePopDialog setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
return this;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_share;
}
@Override
protected void onCreate() {
super.onCreate();
findViewById(R.id.close).setOnClickListener(v -> dismiss());
((ImageView) findViewById(R.id.close)).setImageResource(R.mipmap.icon_invite_close);
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
// findViewById(R.id.share_preview).setVisibility(GONE);
findViewById(R.id.share_dialog).setBackgroundResource(R.mipmap.bg_dialog_inviet);
title = findViewById(R.id.share_title);
list = findViewById(R.id.share_apps_list);
avatar = findViewById(R.id.share_avatar);
info = findViewById(R.id.share_info);
link = findViewById(R.id.share_link);
adapter = new ShareAppAdapter(getContext());
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
list.setAdapter(adapter);
initData();
link.setText(url.substring(0, 40));
info.setText(R.string.dialog_invite_info);
avatar.setImageResource(R.mipmap.ic_launcher);
//title.setTextColor(getContext().getResources().getColorStateList(R.drawable.bg_invite_title));
title.setText(R.string.dialog_invite_title);
title.getViewTreeObserver().addOnGlobalLayoutListener(this::setTitleColor);
}
private void setTitleColor() {
int[] colors = {
Color.parseColor("#3377FF"),
Color.parseColor("#7F66FF"),
};
float[] position = {
0f,
1.0f
};
float height = title.getMeasuredHeight();
LinearGradient mLinearGradient = new LinearGradient(0, 0, 0, height, colors, position, Shader.TileMode.CLAMP);
title.getPaint().setShader(mLinearGradient);
title.invalidate();
}
private void initData() {
data = new ArrayList<>();
data.add(builder(ShareBuilder.APP_FACEBOOK));
data.add(builder(ShareBuilder.APP_LINE));
data.add(builder(ShareBuilder.APP_TWITTER));
data.add(builder(ShareBuilder.APP_WHATSAPP));
data.add(builder(ShareBuilder.APP_MESSENGER));
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
adapter.setList(data);
}
private ShareBuilder builder(int type) {
ShareBuilder builder = ShareBuilder.builder(type);
builder.setText(getContext().getString(R.string.dialog_invite_info));
builder.setLink(url);
builder.setUid(uid);
builder.setAnchorId(anchorId);
builder.setAnchorName(anchorName);
builder.setAnchorAvatar(anchorAvatar);
return builder;
}
private void copyLink() {
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text", info.getText() + "\n" + url);
cm.setPrimaryClip(clipData);
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
}
public InvitePopDialog setUrl(String data) {
this.url = data + "&isGoogle=" + (CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0");
return this;
}
}

View File

@@ -1,146 +0,0 @@
package com.yunbao.share.ui;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.pdlive.shayu.R;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.adapters.ShareAppAdapter;
import java.util.ArrayList;
import java.util.List;
public class SharePopDialog extends AbsDialogPopupWindow {
private ShareAppAdapter adapter;
private RecyclerView list;
private RoundedImageView avatar;
private TextView info;
private TextView link;
private List<ShareBuilder> data;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
private String shareLink;
public SharePopDialog(@NonNull Context context) {
super(context);
}
public SharePopDialog setUid(String uid) {
this.uid = uid;
return this;
}
public SharePopDialog setAnchorId(String anchorId) {
this.anchorId = anchorId;
return this;
}
public SharePopDialog setAnchorName(String anchorName) {
this.anchorName = anchorName;
return this;
}
public SharePopDialog setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
return this;
}
public SharePopDialog setShareLink(String link) {
this.shareLink = link;
return this;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_share;
}
@Override
protected void onCreate() {
super.onCreate();
findViewById(R.id.close).setOnClickListener(v -> dismiss());
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
list = findViewById(R.id.share_apps_list);
avatar = findViewById(R.id.share_avatar);
info = findViewById(R.id.share_info);
link = findViewById(R.id.share_link);
adapter = new ShareAppAdapter(getContext());
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
list.setAdapter(adapter);
initData();
}
private void initData() {
data = new ArrayList<>();
data.add(builder(ShareBuilder.APP_FACEBOOK));
data.add(builder(ShareBuilder.APP_LINE));
data.add(builder(ShareBuilder.APP_TWITTER));
data.add(builder(ShareBuilder.APP_WHATSAPP));
data.add(builder(ShareBuilder.APP_MESSENGER));
//data.add(builder(ShareBuilder.APP_INSTAGRAM));
adapter.setList(data);
String url;
if (shareLink == null) {
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar).substring(0, 40) + "...";
} else {
if (shareLink.length() > 40) {
url = shareLink.substring(0, 40) + "...";
} else {
url = shareLink;
}
}
link.setText(url);
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
ImgLoader.display(getContext(), anchorAvatar, avatar);
}
private ShareBuilder builder(int type) {
ShareBuilder builder = ShareBuilder.builder(type);
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
builder.setUid(uid);
builder.setAnchorId(anchorId);
builder.setAnchorName(anchorName);
builder.setAnchorAvatar(anchorAvatar);
if (shareLink != null) {
builder.setLink(shareLink);
}
return builder;
}
private void copyLink() {
String url;
if (shareLink != null) {
url = shareLink;
} else {
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
}
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text",info.getText().toString()+"\n"+url);
cm.setPrimaryClip(clipData);
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
}
}

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="189dp" android:height="42dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffc621" android:endColor="#ffffae05" android:angle="135" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="112dp" android:height="42dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffffff" />
<gradient android:type="linear" android:useLevel="true" android:startColor="#3377FF" android:endColor="#7F66FF" android:angle="90" />
<corners android:topLeftRadius="22dp" android:topRightRadius="22dp" android:bottomLeftRadius="22dp" android:bottomRightRadius="22dp" />
</shape>
</item>
</selector>

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="15dp" />
<solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="#EBEBEB" />
</shape>
</item>
</selector>

View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/share_dialog"
android:layout_height="wrap_content"
android:background="@mipmap/bg_dialog_share">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/share_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="@string/dialog_invite_title"
android:textColor="@drawable/bg_invite_title"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/icon_dialog_charge_close" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/share_apps_list"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
tools:itemCount="6"
tools:layoutManager="GridLayoutManager"
tools:listitem="@layout/item_share_app"
tools:spanCount="3" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/share_dialog"
android:layout_height="wrap_content"
android:background="@mipmap/bg_dialog_share">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/share_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="@string/dialog_share_title"
android:textColor="#333333"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/icon_share_close" />
</LinearLayout>
<include
android:id="@+id/share_preview"
layout="@layout/view_share_preview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/share_apps_list"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/share_preview"
tools:itemCount="6"
tools:layoutManager="GridLayoutManager"
tools:listitem="@layout/item_share_app"
tools:spanCount="3" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/share_app_icon"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginStart="35dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="35dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" />
<TextView
android:id="@+id/share_app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="12dp"
android:text="TextView"
android:textColor="#666666"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/share_app_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_preview"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="2dp"
android:orientation="horizontal">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/share_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<TextView
android:id="@+id/share_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:text="@string/dialog_share_info"
android:textColor="#333333"
android:textSize="12sp" />
<TextView
android:id="@+id/share_copy"
android:layout_width="70dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_btn"
android:gravity="center"
android:layout_marginStart="25dp"
android:text="@string/dialog_share_copy"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/share_layout_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:orientation="horizontal">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@mipmap/icon_share_url" />
<TextView
android:id="@+id/share_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="TextView"
android:textColor="#999999"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dialog_share_title">Share</string>
<string name="dialog_share_info">Come and watch %s live on PDLIVE and meet more interesting people!</string>
<string name="dialog_invite_title">Invite Friends</string>
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
<string name="dialog_share_copy">Copy</string>
</resources>

View File

@@ -1,17 +0,0 @@
<resources>
<string name="com.twitter.sdk.android.CONSUMER_KEY" translatable="false">ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
<string name="com.twitter.sdk.android.CONSUMER_SECRET" translatable="false">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
<string name="dialog_share_title">分享</string>
<string name="dialog_share_info">快來 PDLIVE觀看%s直播認識更多有趣的朋友吧</string>
<string name="dialog_share_app_facebook" translatable="false">Facebook</string>
<string name="dialog_share_app_line" translatable="false">Line</string>
<string name="dialog_share_app_twitter" translatable="false">Twitter</string>
<string name="dialog_share_app_whatsapp" translatable="false">WhatsApp</string>
<string name="dialog_share_app_messenger" translatable="false">Messenger</string>
<string name="dialog_share_app_instagram" translatable="false">Instagram</string>
<string name="dialog_invite_title">邀請好友</string>
<string name="dialog_invite_info">快來 PDLIVE觀看直播認識更多有趣的朋友吧</string>
<string name="dialog_share_copy">複製</string>
</resources>

View File

@@ -1,17 +0,0 @@
package com.yunbao.share;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -6,9 +6,6 @@ apply plugin: 'com.alibaba.arouter'
android {
dexOptions {
jumboMode = true
}
project.tasks.getByName("tasks").doFirst {
}
/* applicationVariants.all { variant ->
variant.mergeAssetsProvider.configure {
@@ -95,13 +92,6 @@ android {
exclude 'lib/armeabi-v7a/libmmlic.so'
exclude 'lib/armeabi-v7a/libMNN_CL.so'
exclude 'lib/armeabi-v7a/libMNN_Express.so'
//美颜
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
exclude 'lib/arm64-v8a/libCNamaSDK.so'
exclude 'lib/armeabi-v7a/libfuai.so'
exclude 'lib/arm64-v8a/libfuai.so'
}
}
compileOptions {
@@ -109,11 +99,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.all { variant ->
println "清空build文件夹";
for (final def project in rootProject.getAllprojects()) {
delete project.buildDir
println project.buildDir
}
String variantName = variant.name.capitalize()
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
processManifestTask.doLast { pm ->
@@ -154,36 +139,9 @@ android {
'Asset/*',
'image_effect_shaders/*',
'internal/*'
//美颜基础组件
]))
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
delete(fileTree(dir: outputDir, includes: [
'model/ai_face_processor_lite.bundle',
'graphics/face_beautification.bundle'
]))
} else {
println "不删除bundle"
}
}
}
variant.outputs.all {
def isGoogle = "link"
if (rootProject.ext.manifestPlaceholders.isGooglePlay) {
isGoogle = "Google"
}
def isPlugin = "all"
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
isPlugin = "plugin"
}
def isTest = "测试服"
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
isTest = "正式服"
}
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
}
}
signingConfigs {
release {
@@ -235,17 +193,12 @@ android {
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
shrinkResources false
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

170
app/proguard-rules.pro vendored
View File

@@ -12,40 +12,17 @@
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the groupLast number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
#-keepattributes SourceFile,LineNumberTable
# If you keep the groupLast number information, uncomment this to
# hide the original source file name.
-renamesourcefileattribute SourceFile
-keep class com.yunbao.**{
public <methods>;
protected <methods>;
}
-keep class * implements com.yunbao.common.bean.BaseModel {
*;
}
-keep class com.yunbao.common.bean.** {
*;
}
-keep class com.yunbao.common.views.weight.VerticalViewPager$LayoutParams{
*;
}
-keep class android.**{
*;
}
-keep class **.R$* {
public static <fields>;
}
-keep class com.tencent.** { *; }
#-renamesourcefileattribute SourceFile
-keep class com.adjust.sdk.**{ *; }
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
@@ -71,13 +48,6 @@
-keep class okhttp3.internal.**{*;}
-dontwarn okio.**
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
#okio
-dontwarn okio.**
-keep class okio.**{*;}
# Retrofit
@@ -85,10 +55,9 @@
-keep class retrofit2.** { *; }
-keepattributes Signature-keepattributes,Exceptions
-keepattributes Signature-keepattributes Exceptions
# RxJava RxAndroid
-dontwarn java.util.concurrent.Flow*
-dontwarn sun.misc.**
@@ -100,139 +69,20 @@ long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef* {
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode* producerNode;
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef* {
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode* consumerNode;
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
# Gson
-keep class com.google.gson.stream.** { *; }
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
##---------------End: proguard configuration for Gson ----------
-keepattributes EnclosingMethod
#--------融云
-keepattributes Exceptions,InnerClasses
-keepattributes Signature
-keep class io.rong.** {*;}
-keep class cn.rongcloud.** {*;}
-keep class * implements io.rong.imlib.model.MessageContent {*;}
-dontwarn io.rong.push.**
-dontnote com.xiaomi.**
-dontnote com.google.android.gms.gcm.**
-dontnote io.rong.**
# 下方混淆使用了融云 IMKit 提供的 locationKit 位置插件时才需要配置,可参考高德官网的混淆方式:https://lbs.amap.com/api/android-sdk/guide/create-project/dev-attention
-keep class com.amap.api.maps.**{*;}
-keep class com.autonavi.**{*;}
-keep class com.amap.api.trace.**{*;}
-keep class com.amap.api.location.**{*;}
-keep class com.amap.api.fence.**{*;}
-keep class com.loc.**{*;}
-keep class com.autonavi.aps.amapapi.model.**{*;}
-keep class com.amap.api.services.**{*;}
-ignorewarnings
#--------科大讯飞
-keep class com.iflytek.**{*;}
-keepattributes Signature
#EvenBus
-keepattributes *Annotation*
-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# If using AsyncExecutord, keep required constructor of default event used.
# Adjust the class name if a custom failure event type is used.
-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
# Accessed via reflection, avoid renaming or removal
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
#--------ARouter
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
# If you use the byType method to obtain Service, add the following rules to protect the interface:
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
#----retrofit2
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keepattributes AnnotationDefault
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement*
-dontwarn javax.annotation.**
-dontwarn kotlin.Unit
-dontwarn retrofit2.KotlinExtensions*
-dontwarn retrofit2.KotlinExtensions$*
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
#-----glide
-keep public class com.bumptech.glide.** {*;}
-keep public class jp.co.cyberagent.** {*;}
-dontwarn jp.co.cyberagent.android.gpuimage.**
-printconfiguration tmp/full-r8-config.txt
#---美颜模块需要暴露出来的参数名
-keep class com.yunbao.faceunity.utils.FURenderer{
public static java.lang.String BUNDLE_AI_FACE;
}
-keep class com.yunbao.faceunity.utils.FaceUnityConfig{
public static java.lang.String BUNDLE_FACE_BEAUTIFICATION;
}
-keep class com.faceunity.wrapper.faceunity$LoadConfig*{
private static boolean sLoadedLibrary;
}

View File

@@ -6,8 +6,6 @@
<uses-permission
android:name="android.permission.CALL_PHONE"
tools:node="remove" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
tools:ignore="ProtectedPermissions" />
<uses-permission
android:name="android.permission.READ_LOGS"
tools:ignore="ProtectedPermissions"
@@ -84,21 +82,16 @@
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<queries>
<package android:name="com.twitter.android"/>
<package android:name="jp.naver.line.android"/>
</queries>
<application
android:name="com.shayu.phonelive.AppContext"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:preserveLegacyExternalStorage="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="theme,label,icon,allowBackup">
<!-- <service-->
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
@@ -132,7 +125,20 @@
<data android:scheme="smvslm" />
</intent-filter>
</activity>
</activity> <!-- keytool -exportcert -alias androiddebugkey -keystore feixiong.jks | openssl sha1 -binary | openssl base64 -->
<meta-data
android:name="TencentMapSDK"
android:value="${txMapAppKey}" />
<!-- 百度语音识别 -->
<meta-data
android:name="com.baidu.speech.APP_ID"
android:value="${baiduAppId}" />
<meta-data
android:name="com.baidu.speech.API_KEY"
android:value="${baiduAppKey}" />
<meta-data
android:name="com.baidu.speech.SECRET_KEY"
android:value="${baiduAppSecretKey}" />
<!-- 服务器地址 -->
<meta-data
@@ -145,9 +151,6 @@
<meta-data
android:name="IS_UPLOAD_ERROR_LOG"
android:value="${isUploadLog}" />
<meta-data
android:name="IS_PLUGIN_MODEL"
android:value="${isPluginModel}" />
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="${isUploadLog}" />
@@ -186,12 +189,12 @@
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- <meta-data-->
<!-- android:name="com.huawei.hms.client.appid"-->
<!-- android:value="106936673"/>-->
<!-- <meta-data-->
<!-- android:name="com.huawei.hms.client.cpid"-->
<!-- android:value="30086000612391734"/>-->
<meta-data
android:name="com.huawei.hms.client.appid"
android:value="106936673"/>
<meta-data
android:name="com.huawei.hms.client.cpid"
android:value="30086000612391734"/>
</application>
</manifest>

View File

@@ -11,7 +11,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
@@ -40,10 +39,8 @@ import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.socket.SocketRyClient;
import com.yunbao.live.utils.LiveImDeletUtil;
import com.yunbao.live.views.PortraitLiveManager;
@@ -80,7 +77,6 @@ public class AppContext extends CommonAppContext {
public LiveImDeletUtil liveImDeletUtil;
private final static List<WeakReference<Activity>> activities = new ArrayList<>();
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
@Override
public void onActivityResumed(Activity activity) {
@@ -108,14 +104,12 @@ public class AppContext extends CommonAppContext {
return;
}
}
AppManager.getInstance().removeActivity(activity);
}
@Override
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
activities.add(new WeakReference<>(activity));
CrashSaveBean.getInstance().setActivitySize(activities);
AppManager.getInstance().addActivity(activity);
}
@Override
@@ -128,17 +122,11 @@ public class AppContext extends CommonAppContext {
@Override
public void onCreate() {
super.onCreate();
//注册全局异常捕获
if (!isMainProcess()) {
return;
}
AppManager.runDebugCode(new Runnable() {
@Override
public void run() {
ToastUtil.show("Debug代码");
}
});
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
//注册全局异常捕获
registerError();
registerFirebaseCrash();
LogUtils.start(this);
@@ -248,7 +236,6 @@ public class AppContext extends CommonAppContext {
configSPApp();
//初始化美颜SDK
// FaceManager.initFaceUnity(this);
}
/**
@@ -290,21 +277,18 @@ public class AppContext extends CommonAppContext {
.setMainCrashHandler((t, e) -> {
Log.e("ApplicationError", "主线程异常");//此处log只是展示当debug为true时主类内部log会打印异常信息
e.printStackTrace();
AppManager.runDebugCode(() -> {
//闪退后finish所有Activity并且杀死进程
for (WeakReference<Activity> activity : activities) {
if (activity != null && activity.get() != null) {
activity.get().finish();
}
//闪退后finish所有Activity并且杀死进程
/* for (WeakReference<Activity> activity : activities) {
if (activity != null && activity.get() != null) {
activity.get().finish();
}
Process.killProcess(Process.myPid());
System.exit(0);
setFirebaseCrashData();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
throw new RuntimeException(e);
}, 100);
});
}
*//* Process.killProcess(Process.myPid());
System.exit(0);*//*
setFirebaseCrashData();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
throw new RuntimeException(e);
}, 100);*/
})
.setUncaughtCrashHandler((t, e) -> {
Log.e("ApplicationError", "子线程异常");//此处log只是展示当debug为true时主类内部log会打印异常信息

View File

@@ -8,9 +8,7 @@ import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.FileUtil;
import com.yunbao.common.utils.SpUtil;
@@ -92,12 +90,10 @@ public class NeverCrashUtils {
*
* @param application application
*/
private boolean errorWhile = true;
public void register(Application application) {
//主线程异常拦截
new Handler(Looper.getMainLooper()).post(() -> {
while (errorWhile) {
while (true) {
try {
Looper.loop();
} catch (Throwable e) {
@@ -105,12 +101,10 @@ public class NeverCrashUtils {
Log.e(TAG, "未捕获的主线程异常行为", e);
}
e.printStackTrace();
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
AppManager.runDebugCode(() -> errorWhile = false);
// return;
// return;
}
}
});
@@ -145,11 +139,11 @@ public class NeverCrashUtils {
writer.write("PhoneName=" + Build.BRAND + "\n");
writer.write("Phone=" + Build.MODEL + "\n");
writer.write("CPU=" + Arrays.toString(Build.SUPPORTED_ABIS) + "\n");
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()) + "\n");
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom() + "\n");
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom() + "\n");
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga() + "\n");
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize() + "\n");
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime())+ "\n");
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom()+ "\n");
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom()+ "\n");
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga()+ "\n");
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize()+ "\n");
writer.write("UserData=" + SpUtil.getInstance().getStringValue(SpUtil.USER_INFO) + "\n");
writer.write("[ERROR]");
PrintWriter printWriter = new PrintWriter(writer);

View File

@@ -1,11 +1,8 @@
package com.shayu.phonelive.activity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -22,8 +19,6 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.app.ActivityOptionsCompat;
import androidx.core.app.NotificationManagerCompat;
import com.alibaba.android.arouter.facade.annotation.Route;
@@ -50,7 +45,6 @@ import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DownloadUtil;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LogUtil;
import com.yunbao.common.utils.MD5Util;
@@ -104,18 +98,8 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
private int mVideoLastProgress;
private boolean mForward;
@Override
public Resources getResources() {
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
config.locale = IMLoginManager.get(this).getLocaleLanguage();
res.updateConfiguration(config, res.getDisplayMetrics());
return res;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
setStatusBar();
@@ -200,7 +184,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
String adInfo = bean.getAdInfo();
if (!TextUtils.isEmpty(adInfo)) {
JSONObject obj = JSON.parseObject(adInfo);
Log.i(TAG, "callback: " + adInfo);
if (obj.getIntValue("switch") == 1) {
List<AdBean> list = JSON.parseArray(obj.getString("list"), AdBean.class);
if (list != null && list.size() > 0) {
@@ -285,19 +268,8 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
if (getIntent().getStringExtra("activityUrl") != null) {
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
}
if (mImageViewList != null && mImageViewList.size() > 0) {
Log.i(TAG, "forwardMainActivity: " + mImageViewList.size());
AdBean bean = mAdList.get(0);
if (bean != null && bean.getAnimation() == 1) {
intent.putExtra("ad_url", mAdList.get(0).getUrl());
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle();
LauncherActivity.this.startActivity(intent, bundle);
} else {
LauncherActivity.this.startActivity(intent);
}
} else {
LauncherActivity.this.startActivity(intent);
}
LauncherActivity.this.startActivity(intent);
finish();
}
@@ -406,7 +378,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setBackgroundColor(0xffffffff);
imageView.setTransitionName("ad_img_" + i);
mImageViewList.add(imageView);
ImgLoader.display(mContext, mAdList.get(i).getUrl(), imageView);
}
@@ -540,7 +511,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
}
} else if (e == TXLiveConstants.PLAY_ERR_NET_DISCONNECT ||
e == TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND) {
ToastUtil.show(mContext.getString(R.string.live_play_error));
ToastUtil.show(WordUtil.getString(R.string.live_play_error));
checkUidAndToken();
} else if (e == TXLiveConstants.PLAY_EVT_PLAY_PROGRESS) {
int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS");

View File

@@ -31,7 +31,7 @@ public class LogUtils {
String[] exec = new String[]{"logcat", "-c"};
Runtime.getRuntime().exec(exec).waitFor();
exec = new String[]{"logcat", "-v", "color", "UTC-8"};
exec = new String[]{"logcat", "-v", "UTC", "-D"};
Process process = Runtime.getRuntime().exec(exec);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
@@ -55,7 +55,6 @@ public class LogUtils {
writer = new PrintWriter(os);
while ((line = bufferedReader.readLine()) != null) {
writer.append(line).write("\n");
writer.flush();
}
writer.flush();
writer.close();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -86,7 +86,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
TiUtils.unzip(file, targetDir);
bean.setDownloadSuccess(mContext);
} catch (Exception e) {
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
bean.setDownloading(false);
} finally {
file.delete();
@@ -103,7 +103,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
@Override
public void onError(Throwable e) {
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
bean.setDownloading(false);
notifyItemChanged(position, Constants.PAYLOAD);
mLoadingTaskMap.remove(position);

View File

@@ -116,8 +116,8 @@ dependencies {
api rootProject.ext.dependencies["ucrop"]
//腾讯定位地图sdk
// api files('libs/TencentLocationSdk_v6.2.5.3.jar')
// api files('libs/TencentMapSDK_1.2.8.1.jar')
api files('libs/TencentLocationSdk_v6.2.5.3.jar')
api files('libs/TencentMapSDK_1.2.8.1.jar')
//下拉刷新上拉加载
api rootProject.ext.dependencies["smartRefreshLayout"]
@@ -162,8 +162,8 @@ dependencies {
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
//融云小视频模块
api 'cn.rongcloud.sdk:sight:5.2.5.4'
api 'com.facebook.android:facebook-android-sdk:15.2.0'
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
api 'com.facebook.android:facebook-android-sdk:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:15.0.1'
api('com.twitter.sdk.android:twitter-core:3.1.1@aar') {
transitive = true
@@ -174,8 +174,8 @@ dependencies {
api 'com.squareup.retrofit2:retrofit:2.3.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
//gson解析
api 'com.squareup.retrofit2:converter-gson:2.3.0'//混淆
implementation "io.reactivex.rxjava2:rxjava:2.2.3"//混淆
api 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation "io.reactivex.rxjava2:rxjava:2.2.3"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
//loading样式库
@@ -190,10 +190,4 @@ dependencies {
api 'com.github.li-xiaojun:XPopup:2.9.1'
api 'com.github.shenbengit:PagerGridLayoutManager:1.1.7'
//选择器
api 'com.github.gzu-liyujiang.AndroidPicker:Common:4.1.11'
api 'com.github.gzu-liyujiang.AndroidPicker:WheelView:4.1.11'
//自定义圆角图片
api 'com.makeramen:roundedimageview:2.3.0'
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -35,8 +35,6 @@ public class CommonAppConfig {
public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY");
//是否开启上报错误日志功能
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
//是否为插件包模式
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
//外部sd卡
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
@@ -385,7 +383,7 @@ public class CommonAppConfig {
public String getAppName() {
if (TextUtils.isEmpty(mAppName)) {
int res = CommonAppContext.sInstance.getResources().getIdentifier("app_name", "string", "myname.pdlive.shayu");
mAppName =WordUtil.getString(res);
mAppName = WordUtil.getString(res);
}
return mAppName;
}

View File

@@ -17,6 +17,8 @@ import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.utils.L;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import io.rong.imlib.RongIMClient;
@@ -33,6 +35,7 @@ public class CommonAppContext extends MultiDexApplication {
public static CommonAppContext sInstance;
public static WeakReference<Activity> activityWeakReference;
public static List<WeakReference<Activity>> activityList=new ArrayList<>();
private int mCount;
private boolean mFront;//是否前台
public static int jpushMsgNum;
@@ -74,12 +77,10 @@ public class CommonAppContext extends MultiDexApplication {
} else {
locale = getResources().getConfiguration().locale;
}
if (locale.getLanguage().equals("zh")) {
lang = "chinese";
} else {
if (locale.getLanguage().equals("en")) {
lang = "english";
} else {
lang = "chinese";
}
Log.i("lang", lang);
@@ -113,6 +114,7 @@ public class CommonAppContext extends MultiDexApplication {
jpushMsgNum = 0;
CommonAppConfig.getInstance().setFrontGround(true);
}
activityList.add(activityWeakReference);
}
@Override
@@ -133,6 +135,12 @@ public class CommonAppContext extends MultiDexApplication {
L.e("AppContext------->处于后台");
CommonAppConfig.getInstance().setFrontGround(false);
}
for (WeakReference<Activity> reference : activityList) {
if (reference.get() == activity) {
activityList.remove(reference);
return;
}
}
}
@Override

View File

@@ -76,7 +76,7 @@ public class Constants {
public static final String PAY_BUY_COIN_ALI = "Charge.getAliOrder";
public static final String PAY_BUY_COIN_WX = "Charge.getWxOrder";
// public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
// public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
public static final String PACKAGE_NAME_WX = "com.tencent.mm";//微信的包名
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
public static final String LAT = "lat";
@@ -133,7 +133,7 @@ public class Constants {
public static final int LIVE_FUNC_WKS = 2014;//語音
public static final int LIVE_FUNC_ZSLK = 2015;//語音
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
public static final int LIVE_ROBOT = 2017;//机器人
public static final int LIVE_ROBOT= 2017;//机器人
//socket
public static final String SOCKET_CONN = "conn";
@@ -177,14 +177,6 @@ public class Constants {
public static final String SUPER_VISION = "supervision";//超级发言警告
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
public static final String XYD_COMPLETE = "XydComplete";//心愿单完成通知
public static final String WISH_LIST_PROGRESS = "wishListProgress";//心愿单进度通知
public static final String LIVE_VOTE_CREATE = "createVote";
public static final String LIVE_VOTE_UPDATE = "updateVote";
public static final String LIVE_VOTE_END = "endVote";
public static final String LIVE_PK_END = "endPK";//结束PK以这个PK获取到的参数为准
public static final String RED_PACKET = "RedPacket";//红包通知
public static final String RED_PACKET_SUPER_JACKPOT = "RedPacketSuperJackpot";//超级红包通知
//游戏socket
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花

View File

@@ -8,7 +8,7 @@ public class HtmlConfig {
//登录即代表同意服务和隐私条款
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=59";
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/portal/page/index/id/59";
//注册用户协议
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";

View File

@@ -27,7 +27,6 @@ import androidx.appcompat.app.AppCompatActivity;
import com.yunbao.common.R;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.LifeCycleListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ClickUtil;
import java.util.ArrayList;
@@ -49,7 +48,6 @@ public abstract class AbsActivity extends AppCompatActivity {
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
config.locale = IMLoginManager.get(this).getLocaleLanguage();
res.updateConfiguration(config, res.getDisplayMetrics());
return res;
}
@@ -57,7 +55,6 @@ public abstract class AbsActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
create();
Intent intent = getIntent();
if (intent != null) {
isFullWindow = getIntent().getBooleanExtra("isFull", false);
@@ -89,9 +86,6 @@ public abstract class AbsActivity extends AppCompatActivity {
protected void main() {
}
protected void create(){
}
protected boolean isStatusBarWhite() {

View File

@@ -60,6 +60,6 @@ public class ErrorActivity extends AbsActivity {
ClipboardManager clipboardManager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text", mErrorInfo);
clipboardManager.setPrimaryClip(clipData);
ToastUtil.show(mContext.getString(R.string.copy_success));
ToastUtil.show(WordUtil.getString(R.string.copy_success));
}
}

View File

@@ -1,6 +1,5 @@
package com.yunbao.common.activity;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
@@ -23,32 +22,21 @@ import android.widget.ProgressBar;
import androidx.annotation.RequiresApi;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants;
import com.yunbao.common.R;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.AndroidBug5497Workaround;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.HintCustomPopup;
import com.yunbao.common.utils.WordUtil;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
import java.util.Stack;
/**
* Created by cxf on 2018/9/25.
*/
@@ -75,13 +63,13 @@ public class WebViewActivity extends AbsActivity {
protected void main() {
String url = getIntent().getStringExtra(Constants.URL);
L.e("H5--->" + url);
Bus.getOn(this);
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
btnEdit = (ImageView) findViewById(R.id.btn_edit);
ft_title = (FrameLayout) findViewById(R.id.ft_title);
v_spacing = (View) findViewById(R.id.v_spacing);
mWebView = findViewById(R.id.webView);
AndroidBug5497Workaround.assistActivity(this);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.topMargin = DpUtil.dp2px(1);
@@ -109,7 +97,6 @@ public class WebViewActivity extends AbsActivity {
mWebView.loadUrl("javascript:goAnchorTab()");
}
//真实屏幕高度-(ft_title的高度+导航栏高度)
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
if (!navigationGestureEnabled(mContext)) {
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
@@ -171,7 +158,6 @@ public class WebViewActivity extends AbsActivity {
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
mWebView.loadUrl(url);
AndroidBug5497Workaround.assistActivity(this);
if (Constants.myIntoIndex == 2) {
ft_title.setVisibility(View.GONE);
@@ -198,7 +184,7 @@ public class WebViewActivity extends AbsActivity {
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
}
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@@ -248,13 +234,13 @@ public class WebViewActivity extends AbsActivity {
}
}
Intent intent = new Intent(context, WebViewActivity.class);
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
intent.putExtra(Constants.URL, url);
context.startActivity(intent);
}
public static void forward(Context context, String url) {
forward(context, url, true); }
forward(context, url, true);
}
@Override
protected void onDestroy() {
@@ -268,7 +254,6 @@ public class WebViewActivity extends AbsActivity {
Constants.myIntoIndex = 0;
indexInto = 0;
Constants.LoginKefu = true;
Bus.getOff(this);
super.onDestroy();
}
@@ -324,56 +309,5 @@ public class WebViewActivity extends AbsActivity {
@Subscribe(threadMode = ThreadMode.MAIN)
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
indexInto = event.getIndexInto();
if (event.getMethod().equals("androidInviteShare")) {
try {
Class<?> clz = mContext.getClassLoader().loadClass("com.yunbao.share.ui.InvitePopDialog");
Object invite = clz.getConstructor(Context.class).newInstance(mContext);
invite = invite.getClass().getMethod("setUrl", String.class).invoke(invite, event.getData());
assert invite != null;
invite.getClass().getMethod("showDialog").invoke(invite);
} catch (Exception e) {
throw new RuntimeException(e);
}
} else if (TextUtils.equals(event.getMethod(), "clickLogOffAccount")) {
new XPopup.Builder(mContext)
.asCustom(new HintCustomPopup(mContext,
mContext.getString(R.string.delete_account1),
mContext.getString(R.string.delete_account2))
.setLiveOpenOk(mContext.getString(R.string.delete_account3))
.setLiveOpenCancel(mContext.getString(R.string.cancel))
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
@Override
public void onSure() {
LiveNetManager.get(mContext).
setLogOff(new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
for (int i = 0; i < allActivityStacks.size(); i++) {
if (!(allActivityStacks.get(i) instanceof WebViewActivity)) {
allActivityStacks.get(i).finish();
}
}
IMLoginManager.get(mContext).logout(mContext);
CommonAppConfig.getInstance().clearLoginInfo();
mContext.finish();
RouteUtil.forwardLoginActivity();
}
@Override
public void onError(String error) {
}
});
}
@Override
public void onCancel() {
}
}))
.show();
}
}
}

View File

@@ -1,41 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.UserMedalModel;
import com.yunbao.common.views.AchievementDetailsViewHolder;
import java.util.ArrayList;
import java.util.List;
public class AchievementDetailsAdapter extends RecyclerView.Adapter {
private List<UserMedalModel> dressInfo = new ArrayList<>();
public AchievementDetailsAdapter(List<UserMedalModel> dressInfo) {
this.dressInfo = dressInfo;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_achievement_details, parent, false);
return new AchievementDetailsViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
AchievementDetailsViewHolder achievementDetailsViewHolder = (AchievementDetailsViewHolder) holder;
achievementDetailsViewHolder.showData(dressInfo.get(position));
}
@Override
public int getItemCount() {
return dressInfo.size();
}
}

View File

@@ -41,7 +41,7 @@ public class ChatChargeCoinAdapter extends RecyclerView.Adapter<ChatChargeCoinAd
mList = list;
mCoinName = CommonAppConfig.getInstance().getCoinName();
mGoldCoinName = CommonAppConfig.getInstance().getGoldCoinName();
mGiveString = context.getString(R.string.coin_give);
mGiveString = WordUtil.getString(R.string.coin_give);
mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@@ -15,7 +15,6 @@ import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.DrawerRecommendViewHolder;
import com.yunbao.common.views.DrawerTaskViewHolder;
import com.yunbao.common.views.FunGamesViewHolder;
@@ -122,7 +121,6 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
@Override
public void onError(String error) {
ToastUtil.show(R.string.net_error);
}
});
}

View File

@@ -1,7 +1,6 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -49,22 +48,12 @@ public class DrawerTaskAdapter extends RecyclerView.Adapter {
@Override
public int getItemCount() {
if (child.size()>3){
return 3;
}else {
return child.size();
}
return 2;
}
public void updateData(List<CustomSidebarChildModel> mChild) {
child.clear();
child.addAll(mChild);
// for (CustomSidebarChildModel childModel : mChild) {
// if (TextUtils.equals("1", childModel.getIsShow())) {
// child.add(childModel);
// }
// }
notifyDataSetChanged();
}
}

View File

@@ -1,43 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.views.GiftAlreadyWallViewHolder;
import java.util.ArrayList;
import java.util.List;
public class GiftAlreadyWallAdapter extends RecyclerView.Adapter {
private List<GiftWallModel> giftWall = new ArrayList<>();
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_already_wall, parent, false);
return new GiftAlreadyWallViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
GiftAlreadyWallViewHolder withoutWallViewHolder = (GiftAlreadyWallViewHolder) holder;
withoutWallViewHolder.showData(giftWall.get(position));
}
@Override
public int getItemCount() {
return giftWall.size();
}
public void addAllData(List<GiftWallModel> mGiftWall) {
giftWall.clear();
giftWall.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@@ -1,40 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftQuantityModel;
import com.yunbao.common.views.GiftNumber;
import java.util.List;
public class GiftNumberAdapter extends RecyclerView.Adapter {
private List<GiftQuantityModel> giftQuantityModels;
public GiftNumberAdapter(List<GiftQuantityModel> giftQuantityModels) {
this.giftQuantityModels = giftQuantityModels;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_number, parent, false);
return new GiftNumber(robotSayHelloView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
GiftNumber giftNumber = (GiftNumber) holder;
giftNumber.showData(giftQuantityModels.get(position));
}
@Override
public int getItemCount() {
return giftQuantityModels.size();
}
}

View File

@@ -1,43 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.views.GiftWithoutWallViewHolder;
import java.util.ArrayList;
import java.util.List;
public class GiftWithoutWallAdapter extends RecyclerView.Adapter {
private List<GiftWallModel> giftWall = new ArrayList<>();
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_without_wall, parent, false);
return new GiftWithoutWallViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
GiftWithoutWallViewHolder withoutWallViewHolder = (GiftWithoutWallViewHolder) holder;
withoutWallViewHolder.showData(giftWall.get(position));
}
@Override
public int getItemCount() {
return giftWall.size();
}
public void addAllData(List<GiftWallModel> mGiftWall) {
giftWall.clear();
giftWall.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@@ -1,164 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.WishModel;
import com.yunbao.common.event.LiveNewWishListCloseEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.DayWishItemViewHolder;
import com.yunbao.common.views.LunarWishItemViewHolder;
import com.yunbao.common.views.SeasonalWishItemViewHolder;
import com.yunbao.common.views.WeekWishItemViewHolder;
import java.util.ArrayList;
import java.util.List;
public class LiveNewWishAdapter extends RecyclerView.Adapter {
private int type = 0;
private List<WishModel> wishList = new ArrayList<>();
public void addData(List<WishModel> wishModelList, int type) {
this.type = type;
wishList.clear();
wishList.addAll(wishModelList);
wishList.add(null);
notifyDataSetChanged();
}
public void addGiftListModel(WishModel model) {
switch (type) {
case 1:
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
break;
case 2:
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
break;
case 3:
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
break;
case 4:
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
break;
}
wishList.add(0, model);
notifyDataSetChanged();
}
public List<WishModel> getWishList() {
return wishList;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (type == 1) {
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_day_wish, parent, false);
return new DayWishItemViewHolder(dayWish);
} else if (type == 2) {
View weekWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_week_wish, parent, false);
return new WeekWishItemViewHolder(weekWish);
} else if (type == 3) {
View lunarWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_lunar_wish, parent, false);
return new LunarWishItemViewHolder(lunarWish);
} else {
View seasonalWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_seasonal_wish, parent, false);
return new SeasonalWishItemViewHolder(seasonalWish);
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (position == wishList.size()) return;
if (holder instanceof DayWishItemViewHolder) {
DayWishItemViewHolder dayWishItemViewHolder = (DayWishItemViewHolder) holder;
dayWishItemViewHolder.steDayWishData(wishList.get(position), position, new DayWishItemViewHolder.DayWishItemListener() {
@Override
public void onDelete(int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
wishList.remove(index);
notifyDataSetChanged();
}
@Override
public void onUpdate(WishModel model, int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
wishList.remove(index);
wishList.add(index, model);
notifyItemChanged(index);
}
});
} else if (holder instanceof WeekWishItemViewHolder) {
WeekWishItemViewHolder weekWishItemViewHolder = (WeekWishItemViewHolder) holder;
weekWishItemViewHolder.steWeekWishData(wishList.get(position), position, new WeekWishItemViewHolder.WeekWishItemListener() {
@Override
public void onDelete(int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
wishList.remove(index);
notifyDataSetChanged();
}
@Override
public void onUpdate(WishModel model, int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
wishList.remove(index);
wishList.add(index, model);
notifyItemChanged(index);
}
});
} else if (holder instanceof LunarWishItemViewHolder) {
LunarWishItemViewHolder lunarWishItemViewHolder = (LunarWishItemViewHolder) holder;
lunarWishItemViewHolder.steLunarWishData(wishList.get(position), position, new LunarWishItemViewHolder.LunarWishItemListener() {
@Override
public void onDelete(int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
wishList.remove(index);
notifyDataSetChanged();
}
@Override
public void onUpdate(WishModel model, int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
wishList.remove(index);
wishList.add(index, model);
notifyItemChanged(index);
}
});
} else if (holder instanceof SeasonalWishItemViewHolder) {
SeasonalWishItemViewHolder seasonalWishItemViewHolder = (SeasonalWishItemViewHolder) holder;
seasonalWishItemViewHolder.steSeasonalWish(wishList.get(position), position, new SeasonalWishItemViewHolder.SeasonalWishItemListener() {
@Override
public void onDelete(int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
wishList.remove(index);
notifyDataSetChanged();
}
@Override
public void onUpdate(WishModel model, int index) {
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
wishList.remove(index);
wishList.add(index, model);
notifyItemChanged(index);
}
});
}
}
@Override
public int getItemCount() {
return wishList.size();
}
}

View File

@@ -1,56 +0,0 @@
package com.yunbao.common.adapter;
import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftListModel;
import com.yunbao.common.event.LiveNewWishGiftEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.LiveNewWishGiftViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.ArrayList;
import java.util.List;
public class LiveNewWishGiftAdapter extends RecyclerView.Adapter {
private List<GiftListModel> giftListModels = new ArrayList<>();
public LiveNewWishGiftAdapter(List<GiftListModel> giftListModels) {
this.giftListModels = giftListModels;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gitf_wish, parent, false);
return new LiveNewWishGiftViewHolder(dayWish);
}
private int index = -1;
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
LiveNewWishGiftViewHolder wishGiftViewHolder = (LiveNewWishGiftViewHolder) holder;
wishGiftViewHolder.setData(giftListModels.get(position), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
index = position;
notifyDataSetChanged();
Bus.get().post(new LiveNewWishGiftEvent().setModel(giftListModels.get(position)));
}
});
wishGiftViewHolder.onSelect(index == position);
}
@Override
public int getItemCount() {
return giftListModels.size();
}
}

View File

@@ -1,30 +0,0 @@
package com.yunbao.common.adapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import java.util.ArrayList;
import java.util.List;
public class LiveNewWishListAdapter extends FragmentStateAdapter {
private List<Fragment> list = new ArrayList<>();
public LiveNewWishListAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> list) {
super(fragmentActivity);
this.list = list;
}
@NonNull
@Override
public Fragment createFragment(int position) {
return list.get(position);
}
@Override
public int getItemCount() {
return list.size();
}
}

View File

@@ -1,52 +0,0 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.ListInfoMessageModel;
import com.yunbao.common.views.LiveSystemMessageViewHolder;
import java.util.ArrayList;
import java.util.List;
/**
* 主播消息中心适配器
*/
public class LiveSystemMessageAdapter extends RecyclerView.Adapter {
private Context mContext;
private LayoutInflater mInflater;
private List<ListInfoMessageModel> listInfoMessageModels = new ArrayList<>();
public LiveSystemMessageAdapter(Context mContext) {
this.mContext = mContext;
mInflater = LayoutInflater.from(mContext);
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new LiveSystemMessageViewHolder(mInflater.inflate(R.layout.view_live_system_message, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
LiveSystemMessageViewHolder messageViewHolder = (LiveSystemMessageViewHolder) holder;
messageViewHolder.setViewData(listInfoMessageModels.get(position));
}
@Override
public int getItemCount() {
return listInfoMessageModels.size();
}
public void addData(List<ListInfoMessageModel> list) {
listInfoMessageModels.addAll(list);
notifyDataSetChanged();
}
}

View File

@@ -1,44 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.UserMedalListModel;
import com.yunbao.common.views.MedalAchievementViewHolder;
import java.util.ArrayList;
import java.util.List;
public class MedalAchievementAdapter extends RecyclerView.Adapter {
private List<UserMedalListModel> medalData = new ArrayList<>();
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_medal_achievement, parent, false);
return new MedalAchievementViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
MedalAchievementViewHolder achievementViewHolder = (MedalAchievementViewHolder) holder;
achievementViewHolder.showData(medalData.get(position));
}
@Override
public int getItemCount() {
return medalData.size();
}
public void addAllData(List<UserMedalListModel> mGiftWall) {
medalData.clear();
medalData.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@@ -1,43 +0,0 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.views.MonthGiftNamingViewHolder;
import java.util.ArrayList;
import java.util.List;
public class MonthGiftNamingAdapter extends RecyclerView.Adapter {
private List<GiftWallModel> giftWall = new ArrayList<>();
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_month_gift_naming, parent, false);
return new MonthGiftNamingViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
MonthGiftNamingViewHolder monthGiftNamingViewHolder = (MonthGiftNamingViewHolder) holder;
monthGiftNamingViewHolder.showData(giftWall.get(position));
}
@Override
public int getItemCount() {
return giftWall.size();
}
public void addAllData(List<GiftWallModel> mGiftWall) {
giftWall.clear();
giftWall.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@@ -9,7 +9,6 @@ import com.alibaba.fastjson.annotation.JSONField;
public class AdBean {
private String mUrl;
private String mLink;
private int animation;//是否使用过度动画
@JSONField(name = "thumb")
public String getUrl() {
@@ -27,12 +26,4 @@ public class AdBean {
public void setLink(String link) {
mLink = link;
}
@JSONField(name = "animation")
public int getAnimation() {
return animation;
}
@JSONField(name = "animation")
public void setAnimation(int animation) {
this.animation = animation;
}
}

View File

@@ -17,8 +17,6 @@ public class AnchorRecommendModel extends BaseModel {
//是否展示0=不展示1=展示
@SerializedName("list_show")
private int listShow = 0;
@SerializedName("red_packet_show")
private int showRedPacket = 0;//是否显示首页红包浮窗
//是否支持换一批0=不支持 1=支持
@SerializedName("up_show")
private int upShow = 0;
@@ -26,10 +24,6 @@ public class AnchorRecommendModel extends BaseModel {
private List<AnchorRecommendItemModel> list = new ArrayList<>();
@SerializedName("slide")
private List<SlideInfoModel> slide = new ArrayList<>();
@SerializedName("red_packet_total")
private int redPacketTotal = 100;
@SerializedName("red_packet_day_create_num")
private int redPacketNum = 0;
public List<SlideInfoModel> getSlide() {
return slide;
@@ -58,30 +52,6 @@ public class AnchorRecommendModel extends BaseModel {
return this;
}
public int getShowRedPacket() {
return showRedPacket;
}
public void setShowRedPacket(int showRedPacket) {
this.showRedPacket = showRedPacket;
}
public int getRedPacketTotal() {
return redPacketTotal;
}
public void setRedPacketTotal(int redPacketTotal) {
this.redPacketTotal = redPacketTotal;
}
public int getRedPacketNum() {
return redPacketNum;
}
public void setRedPacketNum(int redPacketNum) {
this.redPacketNum = redPacketNum;
}
public List<AnchorRecommendItemModel> getList() {
return list;
}

View File

@@ -1,9 +1,6 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
/**
* Created by cxf on 2019/3/30.
@@ -18,81 +15,7 @@ public class BannerBean {
private String mIntoUrl;
private int type;
private String name;
private int activityId = 0;
private int mIconRes;
//心愿单展示数据
@SerializedName("wishlist_icon")
private String wishlistIcon;
@SerializedName("wishlist_num")
private String wishlistNum;
@SerializedName("wishlist_progress")
private String wishlistProgress;
@SerializedName("wishlist_name")
private String wishlistName;
private Object data;//用来存储任意bean
public String getmImageUrl() {
return mImageUrl;
}
public BannerBean setmImageUrl(String mImageUrl) {
this.mImageUrl = mImageUrl;
return this;
}
public String getmLink() {
return mLink;
}
public BannerBean setmLink(String mLink) {
this.mLink = mLink;
return this;
}
public int getmIconRes() {
return mIconRes;
}
public BannerBean setmIconRes(int mIconRes) {
this.mIconRes = mIconRes;
return this;
}
public String getWishlistIcon() {
return wishlistIcon;
}
public BannerBean setWishlistIcon(String wishlistIcon) {
this.wishlistIcon = wishlistIcon;
return this;
}
public String getWishlistNum() {
return wishlistNum;
}
public BannerBean setWishlistNum(String wishlistNum) {
this.wishlistNum = wishlistNum;
return this;
}
public String getWishlistProgress() {
return wishlistProgress;
}
public BannerBean setWishlistProgress(String wishlistProgress) {
this.wishlistProgress = wishlistProgress;
return this;
}
public String getWishlistName() {
return wishlistName;
}
public BannerBean setWishlistName(String wishlistName) {
this.wishlistName = wishlistName;
return this;
}
private int activityId=0;
private StarChallengeStatusModel model;
@@ -156,49 +79,27 @@ public class BannerBean {
public int getType() {
return type;
}
@JSONField(name = "type")
public void setType(int type) {
this.type = type;
}
@JSONField(name = "name")
public String getName() {
return name;
}
@JSONField(name = "name")
public void setName(String name) {
this.name = name;
}
@JSONField(name = "active_id")
public int getActivityId() {
return activityId;
}
@JSONField(name = "active_id")
public void setActivityId(int activityId) {
this.activityId = activityId;
}
public int getIconRes() {
return mIconRes;
}
public void setIconRes(int mIconRes) {
this.mIconRes = mIconRes;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@NonNull
@Override
public String toString() {
return "BannerBean{" +
@@ -209,12 +110,6 @@ public class BannerBean {
", mIntoUrl='" + mIntoUrl + '\'' +
", type=" + type +
", name='" + name + '\'' +
", activityId=" + activityId +
", mIconRes=" + mIconRes +
", wishlistIcon='" + wishlistIcon + '\'' +
", wishlistNum='" + wishlistNum + '\'' +
", wishlistProgress='" + wishlistProgress + '\'' +
", wishlistName='" + wishlistName + '\'' +
", model=" + model +
'}';
}

View File

@@ -1,99 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class BlindBoxInfoModel extends BaseModel {
/**
* "info":[{"item_name":["麒麟勛章饰品","麒麟頭像框饰品","麒麟坐騎饰品","水晶项链礼物","夢幻水晶球礼物","心動泡泡礼物","蝴蝶少女礼物","金色唱片礼物","鑽石禮盒礼物","紙花船礼物"],"threshold_value":268,"threshold_dress_name":"麒麟坐騎","dress_threshold_value":0,"blind_box_type":1,"blind_box_id":1636},{"item_name":["金鳳勛章饰品","金鳳頭像框饰品","金鳳坐騎饰品","浪漫氣球礼物","捕夢網礼物","仙女棒礼物","藍寶石鈴鐺礼物","榮耀星礼物","童話屋礼物","夢幻許願池礼物"],"threshold_value":198,"threshold_dress_name":"金鳳坐騎","dress_threshold_value":0,"blind_box_type":2,"blind_box_id":1637},{"item_name":["神龍勛章饰品","神龍頭像框饰品","神龍坐騎饰品","水晶玫瑰礼物","sweet香水礼物","甜蜜熱氣球礼物","風鈴舞動礼物","音樂噴泉礼物","星空列車礼物","漂洋過海來看你礼物"],"threshold_value":128,"threshold_dress_name":"神龍坐騎","dress_threshold_value":0,"blind_box_type":3,"blind_box_id":1638}]
*/
@SerializedName("item_name")
private List<String> itemName;
@SerializedName("threshold_value")
private String thresholdValue = "0";
@SerializedName("threshold_dress_name")
private String thresholdDressName;
@SerializedName("dress_threshold_value")
private String dressThresholdValue;
@SerializedName("blind_box_type")
private String blindBoxType;
@SerializedName("blind_box_id")
private String blindBoxId;
@SerializedName("blind_box_swf")
private String blindBoxSwf;
@SerializedName("threshold_effect_src")
private String thresholdEffectSrc;
public String getThresholdEffectSrc() {
return thresholdEffectSrc;
}
public BlindBoxInfoModel setThresholdEffectSrc(String thresholdEffectSrc) {
this.thresholdEffectSrc = thresholdEffectSrc;
return this;
}
public String getBlindBoxSwf() {
return blindBoxSwf;
}
public BlindBoxInfoModel setBlindBoxSwf(String blindBoxSwf) {
this.blindBoxSwf = blindBoxSwf;
return this;
}
public List<String> getItemName() {
return itemName;
}
public BlindBoxInfoModel setItemName(List<String> itemName) {
this.itemName = itemName;
return this;
}
public String getThresholdValue() {
return thresholdValue;
}
public BlindBoxInfoModel setThresholdValue(String thresholdValue) {
this.thresholdValue = thresholdValue;
return this;
}
public String getThresholdDressName() {
return thresholdDressName;
}
public BlindBoxInfoModel setThresholdDressName(String thresholdDressName) {
this.thresholdDressName = thresholdDressName;
return this;
}
public String getDressThresholdValue() {
return dressThresholdValue;
}
public BlindBoxInfoModel setDressThresholdValue(String dressThresholdValue) {
this.dressThresholdValue = dressThresholdValue;
return this;
}
public String getBlindBoxType() {
return blindBoxType;
}
public BlindBoxInfoModel setBlindBoxType(String blindBoxType) {
this.blindBoxType = blindBoxType;
return this;
}
public String getBlindBoxId() {
return blindBoxId;
}
public BlindBoxInfoModel setBlindBoxId(String blindBoxId) {
this.blindBoxId = blindBoxId;
return this;
}
}

View File

@@ -31,18 +31,7 @@ public class CustomSidebarChildModel extends BaseModel {
@SerializedName("activity_id")
private String activityId;
@SerializedName("flag")
private String flag = "";
@SerializedName("is_show")
private String isShow;
public String getIsShow() {
return isShow;
}
public CustomSidebarChildModel setIsShow(String isShow) {
this.isShow = isShow;
return this;
}
private String flag;
public String getFlag() {
return flag;

View File

@@ -1,109 +0,0 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.google.gson.annotations.SerializedName;
/**
* 优惠卷
*/
public class DiscountsModel extends BaseModel {
//------------------贵族--------------------
public static final int TYPE_VISCOUNT=1;//子爵
public static final int TYPE_MARQUIS=2;//侯爵
public static final int TYPE_DUKE=3;//公爵
public static final int TYPE_KING=4;//国王
public static final int TYPE_EMPEROR=5;//皇帝
//------------------守护--------------------
public static final int TYPE_WEEKS=6;//周守护
public static final int TYPE_MONTH=7;//月守护
public static final int TYPE_YEARS=8;//月守护
@SerializedName("userCouponId")
private int userCouponID;
@SerializedName("num")
private int num;
@SerializedName("endTime")
private long endTime;
@SerializedName("img")
private String img;
@SerializedName("name")
private String name;
@SerializedName("discount")
private double discount;
@SerializedName("describe")
private String describe;
public DiscountsModel() {
}
public int getUserCouponID() {
return userCouponID;
}
public void setUserCouponID(int userCouponID) {
this.userCouponID = userCouponID;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
@NonNull
@Override
public String toString() {
return "DiscountsModel{" +
"userCouponID=" + userCouponID +
", num=" + num +
", endTime=" + endTime +
", img='" + img + '\'' +
", name='" + name + '\'' +
", discount=" + discount +
", describe='" + describe + '\'' +
'}';
}
}

View File

@@ -103,57 +103,13 @@ public class EnterRoomInfoModel extends BaseModel {
@SerializedName("anchor_goodnum")
private String anchorGoodnum;
@SerializedName("jackpot_level")
private String jackpotLevel = "-1";
@SerializedName("live_vote")
private LiveRoomVoteModel voteModel;
@SerializedName("red_packet")
private RedPacketModel redPacketModel;
@SerializedName("gift_wall_lighten_number")
private String giftWallLightenNumber;
@SerializedName("gift_wall_lighten_total")
private String giftWallLightenTotal;
public String getGiftWallLightenNumber() {
return giftWallLightenNumber;
}
public EnterRoomInfoModel setGiftWallLightenNumber(String giftWallLightenNumber) {
this.giftWallLightenNumber = giftWallLightenNumber;
return this;
}
public String getGiftWallLightenTotal() {
return giftWallLightenTotal;
}
public EnterRoomInfoModel setGiftWallLightenTotal(String giftWallLightenTotal) {
this.giftWallLightenTotal = giftWallLightenTotal;
return this;
}
public RedPacketModel getRedPacketModel() {
return redPacketModel;
}
public EnterRoomInfoModel setRedPacketModel(RedPacketModel redPacketModel) {
this.redPacketModel = redPacketModel;
return this;
}
private String jackpotLevel="-1";
public String getJackpotLevel() {
return jackpotLevel;
}
public LiveRoomVoteModel getVoteModel() {
return voteModel;
}
public void setVoteModel(LiveRoomVoteModel voteModel) {
this.voteModel = voteModel;
}
public EnterRoomInfoModel setJackpotLevel(String jackpotLevel) {
this.jackpotLevel = jackpotLevel;
return this;
@@ -520,8 +476,8 @@ public class EnterRoomInfoModel extends BaseModel {
}
public String getIsconnection() {
if (StringUtil.isEmpty(isconnection)) {
isconnection = "0";
if(StringUtil.isEmpty(isconnection)){
isconnection="0";
}
return isconnection;
}
@@ -532,9 +488,6 @@ public class EnterRoomInfoModel extends BaseModel {
}
public String getIsleave() {
if (StringUtil.isEmpty(isleave)) {
isleave = "0";
}
return isleave;
}

View File

@@ -30,17 +30,6 @@ public class EnterRoomNewModel extends BaseModel {
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
@SerializedName("clarityType")
private int clarityType;
@SerializedName("wishListProgress")
private WishModel wishListProgress;
public WishModel getWishListProgress() {
return wishListProgress;
}
public EnterRoomNewModel setWishListProgress(WishModel wishListProgress) {
this.wishListProgress = wishListProgress;
return this;
}
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
return liveRoomActivityModels;

View File

@@ -1,44 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* 礼物墙已点亮
*/
public class GiftAlreadyWallModel extends BaseModel {
@SerializedName("gift_wall")
private List<GiftWallModel> giftWall;
@SerializedName("gift_wall_lighten_number")
private String giftWallLightenNumber;
@SerializedName("gift_wall_lighten_total")
private String giftWallLightenTotal;
public List<GiftWallModel> getGiftWall() {
return giftWall;
}
public GiftAlreadyWallModel setGiftWall(List<GiftWallModel> giftWall) {
this.giftWall = giftWall;
return this;
}
public String getGiftWallLightenNumber() {
return giftWallLightenNumber;
}
public GiftAlreadyWallModel setGiftWallLightenNumber(String giftWallLightenNumber) {
this.giftWallLightenNumber = giftWallLightenNumber;
return this;
}
public String getGiftWallLightenTotal() {
return giftWallLightenTotal;
}
public GiftAlreadyWallModel setGiftWallLightenTotal(String giftWallLightenTotal) {
this.giftWallLightenTotal = giftWallLightenTotal;
return this;
}
}

View File

@@ -1,119 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class GiftGuideModel extends BaseModel {
@SerializedName("guide_name")
private String guideName;
@SerializedName("illuminate_count")
private int illuminateCount;
@SerializedName("already_font")
private String alreadyFont;
@SerializedName("without_font")
private String withoutFont;
@SerializedName("number")
private String number;
@SerializedName("illuminate_total")
private int illuminateTotal;
@SerializedName("week_number")
private String weekNumber;
@SerializedName("guide_name_img_path")
private String guideNameImgPath;
@SerializedName("guide_background_picture_path")
private String guideBackgroundPicturePath;
@SerializedName("gift_data")
private List<GiftWallModel> giftData;
public String getAlreadyFont() {
return alreadyFont;
}
public GiftGuideModel setAlreadyFont(String alreadyFont) {
this.alreadyFont = alreadyFont;
return this;
}
public String getWithoutFont() {
return withoutFont;
}
public GiftGuideModel setWithoutFont(String withoutFont) {
this.withoutFont = withoutFont;
return this;
}
public String getNumber() {
return number;
}
public GiftGuideModel setNumber(String number) {
this.number = number;
return this;
}
public int getIlluminateTotal() {
return illuminateTotal;
}
public GiftGuideModel setIlluminateTotal(int illuminateTotal) {
this.illuminateTotal = illuminateTotal;
return this;
}
public String getWeekNumber() {
return weekNumber;
}
public GiftGuideModel setWeekNumber(String weekNumber) {
this.weekNumber = weekNumber;
return this;
}
public String getGuideNameImgPath() {
return guideNameImgPath;
}
public GiftGuideModel setGuideNameImgPath(String guideNameImgPath) {
this.guideNameImgPath = guideNameImgPath;
return this;
}
public String getGuideBackgroundPicturePath() {
return guideBackgroundPicturePath;
}
public GiftGuideModel setGuideBackgroundPicturePath(String guideBackgroundPicturePath) {
this.guideBackgroundPicturePath = guideBackgroundPicturePath;
return this;
}
public String getGuideName() {
return guideName;
}
public GiftGuideModel setGuideName(String guideName) {
this.guideName = guideName;
return this;
}
public int getIlluminateCount() {
return illuminateCount;
}
public GiftGuideModel setIlluminateCount(int illuminateCount) {
this.illuminateCount = illuminateCount;
return this;
}
public List<GiftWallModel> getGiftData() {
return giftData;
}
public GiftGuideModel setGiftData(List<GiftWallModel> giftData) {
this.giftData = giftData;
return this;
}
}

View File

@@ -1,72 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GiftListModel extends BaseModel {
@SerializedName("name")
private String name;
@SerializedName("price")
private String price;
@SerializedName("img")
private String img;
@SerializedName("id")
private String id;
@SerializedName("gift_type")
private String giftType;
public String getName() {
return name;
}
public GiftListModel setName(String name) {
this.name = name;
return this;
}
public String getPrice() {
return price;
}
public GiftListModel setPrice(String price) {
this.price = price;
return this;
}
public String getImg() {
return img;
}
public GiftListModel setImg(String img) {
this.img = img;
return this;
}
public String getId() {
return id;
}
public GiftListModel setId(String id) {
this.id = id;
return this;
}
public String getGiftType() {
return giftType;
}
public GiftListModel setGiftType(String giftType) {
this.giftType = giftType;
return this;
}
@Override
public String toString() {
return "GiftListModel{" +
"name='" + name + '\'' +
", price='" + price + '\'' +
", img='" + img + '\'' +
", id='" + id + '\'' +
", giftType='" + giftType + '\'' +
'}';
}
}

View File

@@ -1,43 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
/**
* 礼物选择数量
*/
public class GiftQuantityModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("gift_quantity")
private String giftQuantity;
@SerializedName("font_colour")
private String fontColour;
public String getId() {
return id;
}
public GiftQuantityModel setId(String id) {
this.id = id;
return this;
}
public String getGiftQuantity() {
return giftQuantity;
}
public GiftQuantityModel setGiftQuantity(String giftQuantity) {
this.giftQuantity = giftQuantity;
return this;
}
public String getFontColour() {
return fontColour;
}
public GiftQuantityModel setFontColour(String fontColour) {
this.fontColour = fontColour;
return this;
}
}

View File

@@ -1,51 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GiftWallGiftDetail extends BaseModel {
@SerializedName("uid")
private int uid;
@SerializedName("user_nicename")
private String userNicename;
@SerializedName("avatar")
private String avatar;
@SerializedName("naming_coin")
private int namingCoin;
public int getUid() {
return uid;
}
public GiftWallGiftDetail setUid(int uid) {
this.uid = uid;
return this;
}
public String getUserNicename() {
return userNicename;
}
public GiftWallGiftDetail setUserNicename(String userNicename) {
this.userNicename = userNicename;
return this;
}
public String getAvatar() {
return avatar;
}
public GiftWallGiftDetail setAvatar(String avatar) {
this.avatar = avatar;
return this;
}
public int getNamingCoin() {
return namingCoin;
}
public GiftWallGiftDetail setNamingCoin(int namingCoin) {
this.namingCoin = namingCoin;
return this;
}
}

View File

@@ -1,392 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GiftWallModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("sendtype")
private String sendtype;
@SerializedName("type")
private String type;
@SerializedName("name")
private String name;
@SerializedName("release_status")
private String releaseStatus;
@SerializedName("type_sort")
private String typeSort;
@SerializedName("operate_image")
private String operateImage;
@SerializedName("operate_url")
private String operateUrl;
@SerializedName("mark")
private String mark;
@SerializedName("giftname")
private String giftname;
@SerializedName("needcoin")
private String needcoin;
@SerializedName("gifticon")
private String gifticon;
@SerializedName("gift_description")
private String giftDescription;
@SerializedName("corner_mark")
private String cornerMark;
@SerializedName("swf")
private String swf;
@SerializedName("gift_uid")
private String giftUid;
@SerializedName("type_start_time")
private String typeStartTime;
@SerializedName("type_end_time")
private String typeEndTime;
@SerializedName("gift_start_time")
private String giftStartTime;
@SerializedName("gift_end_time")
private String giftEndTime;
@SerializedName("naming_liveuid")
private String namingLiveuid;
@SerializedName("naming_uid")
private String namingUid;
@SerializedName("naming_live_name")
private String namingLiveName;
@SerializedName("naming_user_name")
private String namingUserName;
@SerializedName("naming_live_avatar")
private String namingLiveAvatar;
@SerializedName("naming_user_avatar")
private String namingUserAvatar;
@SerializedName("naming_status")
private String namingStatus;
@SerializedName("naming_coin")
private String namingCoin;
@SerializedName("gifticon_total")
private String gifticonTotal;
@SerializedName("gift_count_number")
private String giftCountNumber;
@SerializedName("user_nicename")
private String userNicename;
@SerializedName("avatar")
private String avatar;
@SerializedName("naming_coin_max")
private String namingCoinMax;
@SerializedName("illuminate_status")
private int illuminateStatus;
@SerializedName("font_color")
private String fontColor;
public String getFontColor() {
return fontColor;
}
public GiftWallModel setFontColor(String fontColor) {
this.fontColor = fontColor;
return this;
}
public int getIlluminateStatus() {
return illuminateStatus;
}
public GiftWallModel setIlluminateStatus(int illuminateStatus) {
this.illuminateStatus = illuminateStatus;
return this;
}
public String getNamingCoinMax() {
return namingCoinMax;
}
public GiftWallModel setNamingCoinMax(String namingCoinMax) {
this.namingCoinMax = namingCoinMax;
return this;
}
public String getAvatar() {
return avatar;
}
public GiftWallModel setAvatar(String avatar) {
this.avatar = avatar;
return this;
}
public String getUserNicename() {
return userNicename;
}
public GiftWallModel setUserNicename(String userNicename) {
this.userNicename = userNicename;
return this;
}
public String getId() {
return id;
}
public GiftWallModel setId(String id) {
this.id = id;
return this;
}
public String getSendtype() {
return sendtype;
}
public GiftWallModel setSendtype(String sendtype) {
this.sendtype = sendtype;
return this;
}
public String getType() {
return type;
}
public GiftWallModel setType(String type) {
this.type = type;
return this;
}
public String getName() {
return name;
}
public GiftWallModel setName(String name) {
this.name = name;
return this;
}
public String getReleaseStatus() {
return releaseStatus;
}
public GiftWallModel setReleaseStatus(String releaseStatus) {
this.releaseStatus = releaseStatus;
return this;
}
public String getTypeSort() {
return typeSort;
}
public GiftWallModel setTypeSort(String typeSort) {
this.typeSort = typeSort;
return this;
}
public String getOperateImage() {
return operateImage;
}
public GiftWallModel setOperateImage(String operateImage) {
this.operateImage = operateImage;
return this;
}
public String getOperateUrl() {
return operateUrl;
}
public GiftWallModel setOperateUrl(String operateUrl) {
this.operateUrl = operateUrl;
return this;
}
public String getMark() {
return mark;
}
public GiftWallModel setMark(String mark) {
this.mark = mark;
return this;
}
public String getGiftname() {
return giftname;
}
public GiftWallModel setGiftname(String giftname) {
this.giftname = giftname;
return this;
}
public String getNeedcoin() {
return needcoin;
}
public GiftWallModel setNeedcoin(String needcoin) {
this.needcoin = needcoin;
return this;
}
public String getGifticon() {
return gifticon;
}
public GiftWallModel setGifticon(String gifticon) {
this.gifticon = gifticon;
return this;
}
public String getGiftDescription() {
return giftDescription;
}
public GiftWallModel setGiftDescription(String giftDescription) {
this.giftDescription = giftDescription;
return this;
}
public String getCornerMark() {
return cornerMark;
}
public GiftWallModel setCornerMark(String cornerMark) {
this.cornerMark = cornerMark;
return this;
}
public String getSwf() {
return swf;
}
public GiftWallModel setSwf(String swf) {
this.swf = swf;
return this;
}
public String getGiftUid() {
return giftUid;
}
public GiftWallModel setGiftUid(String giftUid) {
this.giftUid = giftUid;
return this;
}
public String getTypeStartTime() {
return typeStartTime;
}
public GiftWallModel setTypeStartTime(String typeStartTime) {
this.typeStartTime = typeStartTime;
return this;
}
public String getTypeEndTime() {
return typeEndTime;
}
public GiftWallModel setTypeEndTime(String typeEndTime) {
this.typeEndTime = typeEndTime;
return this;
}
public String getGiftStartTime() {
return giftStartTime;
}
public GiftWallModel setGiftStartTime(String giftStartTime) {
this.giftStartTime = giftStartTime;
return this;
}
public String getGiftEndTime() {
return giftEndTime;
}
public GiftWallModel setGiftEndTime(String giftEndTime) {
this.giftEndTime = giftEndTime;
return this;
}
public String getNamingLiveuid() {
return namingLiveuid;
}
public GiftWallModel setNamingLiveuid(String namingLiveuid) {
this.namingLiveuid = namingLiveuid;
return this;
}
public String getNamingUid() {
return namingUid;
}
public GiftWallModel setNamingUid(String namingUid) {
this.namingUid = namingUid;
return this;
}
public String getNamingLiveName() {
return namingLiveName;
}
public GiftWallModel setNamingLiveName(String namingLiveName) {
this.namingLiveName = namingLiveName;
return this;
}
public String getNamingUserName() {
return namingUserName;
}
public GiftWallModel setNamingUserName(String namingUserName) {
this.namingUserName = namingUserName;
return this;
}
public String getNamingLiveAvatar() {
return namingLiveAvatar;
}
public GiftWallModel setNamingLiveAvatar(String namingLiveAvatar) {
this.namingLiveAvatar = namingLiveAvatar;
return this;
}
public String getNamingUserAvatar() {
return namingUserAvatar;
}
public GiftWallModel setNamingUserAvatar(String namingUserAvatar) {
this.namingUserAvatar = namingUserAvatar;
return this;
}
public String getNamingStatus() {
return namingStatus;
}
public GiftWallModel setNamingStatus(String namingStatus) {
this.namingStatus = namingStatus;
return this;
}
public String getNamingCoin() {
return namingCoin;
}
public GiftWallModel setNamingCoin(String namingCoin) {
this.namingCoin = namingCoin;
return this;
}
public String getGifticonTotal() {
return gifticonTotal;
}
public GiftWallModel setGifticonTotal(String gifticonTotal) {
this.gifticonTotal = gifticonTotal;
return this;
}
public String getGiftCountNumber() {
return giftCountNumber;
}
public GiftWallModel setGiftCountNumber(String giftCountNumber) {
this.giftCountNumber = giftCountNumber;
return this;
}
}

View File

@@ -28,12 +28,4 @@ public class HttpCallbackModel extends BaseModel {
public void setMsg(String msg) {
this.msg = msg;
}
@Override
public String toString() {
return "HttpCallbackModel{" +
"code=" + code +
", msg='" + msg + '\'' +
'}';
}
}

View File

@@ -1,96 +0,0 @@
package com.yunbao.common.bean;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ListInfoMessageModel extends BaseModel {
@SerializedName("id")
private int id;
@SerializedName("title")
private String title;
@SerializedName("banner")
private String banner;
@SerializedName("content")
private String content;
@SerializedName("link")
private String link;
@SerializedName("addtime")
private String addtime;
public int getId() {
return id;
}
public ListInfoMessageModel setId(int id) {
this.id = id;
return this;
}
public String getTitle() {
return title;
}
public ListInfoMessageModel setTitle(String title) {
this.title = title;
return this;
}
public String getBanner() {
return banner;
}
public ListInfoMessageModel setBanner(String banner) {
this.banner = banner;
return this;
}
public String getContent() {
return content;
}
public ListInfoMessageModel setContent(String content) {
this.content = content;
return this;
}
public String getLink() {
return link;
}
public ListInfoMessageModel setLink(String link) {
this.link = link;
return this;
}
public String getAddtime() {
return addtime;
}
public ListInfoMessageModel setAddtime(String addtime) {
this.addtime = addtime;
return this;
}
/**
* 会话列表展示时间
*/
public String getLastDate(String type) {
if (!TextUtils.isEmpty(addtime) && !TextUtils.equals(addtime, "0")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date currenTimeZone;
if (TextUtils.equals(type, "-1")) {
currenTimeZone = new Date(Long.parseLong(addtime));
} else {
currenTimeZone = new Date(Long.parseLong(addtime + "000"));
}
return sdf.format(currenTimeZone);
} else {
return "";
}
}
}

View File

@@ -1,184 +0,0 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.annotations.SerializedName;
/**
* 联系方式
*/
public class LiveAnchorCallMeModel extends BaseModel {
@SerializedName("id")
private int id;
@SerializedName("isShow")
private int isShow;
@SerializedName("gift_id")
private int giftId;
@SerializedName("giftImage")
private String giftImage;
@SerializedName("content")
private String content;
@SerializedName("wechat")
private AppBean wechat;
@SerializedName("line")
private AppBean line;
@SerializedName("whatsApp")
private AppBean whatsApp;
@SerializedName("isGet")
private int isGet;
@SerializedName("link")
private String link;
public LiveAnchorCallMeModel() {
}
public int getIsGet() {
return isGet;
}
public void setIsGet(int isGet) {
this.isGet = isGet;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGiftImage() {
return giftImage;
}
public void setGiftImage(String giftImage) {
this.giftImage = giftImage;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public int getGiftId() {
return giftId;
}
public void setGiftId(int giftId) {
this.giftId = giftId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public AppBean getWechat() {
if (wechat == null) {
wechat = new AppBean();
}
return wechat;
}
public void setWechat(AppBean wechat) {
this.wechat = wechat;
}
public AppBean getLine() {
if (line == null) {
line = new AppBean();
}
return line;
}
public void setLine(AppBean line) {
this.line = line;
}
public AppBean getWhatsApp() {
if (whatsApp == null) {
whatsApp = new AppBean();
}
return whatsApp;
}
public void setWhatsApp(AppBean whatsApp) {
this.whatsApp = whatsApp;
}
@Override
public String toString() {
return "LiveAnchorCallMeModel{" +
"id=" + id +
", isShow=" + isShow +
", giftId=" + giftId +
", giftImage='" + giftImage + '\'' +
", content='" + content + '\'' +
", wechat=" + wechat +
", line=" + line +
", whatsApp=" + whatsApp +
", isGet=" + isGet +
", link='" + link + '\'' +
'}';
}
public static class AppBean {
private String number;
private int isShow;
public AppBean() {
}
public AppBean(String number, int isShow) {
this.number = number;
this.isShow = isShow;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
@NonNull
@Override
public String toString() {
return "AppBean{" +
"number='" + number + '\'' +
", isShow=" + isShow +
'}';
}
public JSONObject toJSONObject() {
return (JSONObject) JSON.toJSON(this);
}
}
}

View File

@@ -1,80 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class LiveAnchorSayModel extends BaseModel{
@SerializedName("livePreview")
private LivePreview livePreview;
@SerializedName("style")
private List<String> style;
public LiveAnchorSayModel() {
}
public LivePreview getLivePreview() {
return livePreview;
}
public void setLivePreview(LivePreview livePreview) {
this.livePreview = livePreview;
}
public List<String> getStyle() {
return style;
}
public void setStyle(List<String> style) {
this.style = style;
}
public class LivePreview{
private int isShow;
private String content;
private String styleImage;
public LivePreview() {
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getStyleImage() {
return styleImage;
}
public void setStyleImage(String styleImage) {
this.styleImage = styleImage;
}
@Override
public String toString() {
return "LivePreview{" +
"isShow=" + isShow +
", content='" + content + '\'' +
", styleImage='" + styleImage + '\'' +
'}';
}
}
@Override
public String toString() {
return "LiveAnchorSayModel{" +
"livePreview=" + livePreview +
", style=" + style +
'}';
}
}

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;
import java.util.ArrayList;
import java.util.List;
@@ -52,8 +51,6 @@ public class LiveBean implements Parcelable {
private String recommendCardtype = "";
private String recommendCardIconSizeTwo = "";
private String recommendCardIconSizeThree = "";
@SerializedName("red_packet_status")
private int redPacketStatus;
private Map<String,String> params;//用于跳转Activity时扩展参数从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
@@ -385,14 +382,6 @@ public class LiveBean implements Parcelable {
this.islive = islive;
}
public int getRedPacketStatus() {
return redPacketStatus;
}
public void setRedPacketStatus(int redPacketStatus) {
this.redPacketStatus = redPacketStatus;
}
/**
* 显示靓号
*/
@@ -540,7 +529,6 @@ public class LiveBean implements Parcelable {
", recommendCardtype='" + recommendCardtype + '\'' +
", recommendCardIconSizeTwo='" + recommendCardIconSizeTwo + '\'' +
", recommendCardIconSizeThree='" + recommendCardIconSizeThree + '\'' +
", redPacketStatus=" + redPacketStatus +
", params=" + params +
", mWeekList=" + mWeekList +
'}';

View File

@@ -14,26 +14,6 @@ public class LiveClassBean {
private boolean isAll;
private String des;
private boolean checked;
private String chinese;
private String english;
public String getChinese() {
return chinese;
}
public LiveClassBean setChinese(String chinese) {
this.chinese = chinese;
return this;
}
public String getEnglish() {
return english;
}
public LiveClassBean setEnglish(String english) {
this.english = english;
return this;
}
public int getId() {
return id;

View File

@@ -1,106 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
/**
* 直播数据
*/
public class LiveDataInfoModel extends BaseModel{
@SerializedName("totalCoin")
private long totalCoin;//钻石数量
@SerializedName("totalGold")
private long totalGold;//金币数量
@SerializedName("acceptNum")
private long acceptNum;//送礼人数
@SerializedName("enterNum")
private long enterNum;//进场人数
@SerializedName("attentionNum")
private long attentionNum;//关注人数
@SerializedName("fanGroupNum")
private long fanGroupNum;//粉丝团人数
@SerializedName("attentionNumRate")
private double attentionNumRate;//关注转化率
@SerializedName("fanGroupNumRate")
private double fanGroupNumRate;//粉丝团转化率
public LiveDataInfoModel() {
}
public long getTotalCoin() {
return totalCoin;
}
public void setTotalCoin(long totalCoin) {
this.totalCoin = totalCoin;
}
public long getTotalGold() {
return totalGold;
}
public void setTotalGold(long totalGold) {
this.totalGold = totalGold;
}
public long getAcceptNum() {
return acceptNum;
}
public void setAcceptNum(long acceptNum) {
this.acceptNum = acceptNum;
}
public long getEnterNum() {
return enterNum;
}
public void setEnterNum(long enterNum) {
this.enterNum = enterNum;
}
public long getAttentionNum() {
return attentionNum;
}
public void setAttentionNum(long attentionNum) {
this.attentionNum = attentionNum;
}
public long getFanGroupNum() {
return fanGroupNum;
}
public void setFanGroupNum(long fanGroupNum) {
this.fanGroupNum = fanGroupNum;
}
public double getAttentionNumRate() {
return attentionNumRate;
}
public void setAttentionNumRate(double attentionNumRate) {
this.attentionNumRate = attentionNumRate;
}
public double getFanGroupNumRate() {
return fanGroupNumRate;
}
public void setFanGroupNumRate(double fanGroupNumRate) {
this.fanGroupNumRate = fanGroupNumRate;
}
@Override
public String toString() {
return "LiveDataInfoModel{" +
"totalCoin=" + totalCoin +
", totalGold=" + totalGold +
", acceptNum=" + acceptNum +
", enterNum=" + enterNum +
", attentionNum=" + attentionNum +
", fanGroupNum=" + fanGroupNum +
", attentionNumRate=" + attentionNumRate +
", fanGroupNumRate=" + fanGroupNumRate +
'}';
}
}

View File

@@ -18,12 +18,12 @@ public class LiveGiftBean {
// public static final int MARK_LUCK = 3;
private int id;
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团 5盲盒礼物
private int type;//0 普通礼物 1是豪华礼物
private int mark;// 0 普通 1热门 2守护 3幸运
private String name;
private String price;
private String icon;
private boolean checked = false;
private boolean checked;
private int page;
private View mView;
private String sendType;//支付是金币还是钻石
@@ -34,171 +34,6 @@ public class LiveGiftBean {
private String isweek;
private String end_time;
private String tag;
@JSONField(name = "blind_box_type")
private int blind_box_type = 0;
//礼物角标
@JSONField(name = "corner_mark")
private String cornerMark;
@JSONField(name = "gift_description")
private String giftDescription;
@JSONField(name = "operate_image")
private String operateImage;
@JSONField(name = "operate_url")
private String operateUrl;
@JSONField(name = "naming_liveuid")
private String namingLiveuid;
@JSONField(name = "naming_uid")
private String namingUid;
@JSONField(name = "naming_live_name")
private String namingLiveName;
@JSONField(name = "naming_user_name")
private String namingUserName;
@JSONField(name = "naming_live_avatar")
private String namingLiveAvatar;
@JSONField(name = "naming_user_avatar")
private String namingUserAvatar;
@JSONField(name = "naming_status")
private String namingStatus;
@JSONField(name = "naming_coin")
private String namingCoin;
public View getmView() {
return mView;
}
public LiveGiftBean setmView(View mView) {
this.mView = mView;
return this;
}
public String getmGiftNum() {
return mGiftNum;
}
public LiveGiftBean setmGiftNum(String mGiftNum) {
this.mGiftNum = mGiftNum;
return this;
}
public String getNamingLiveuid() {
return namingLiveuid;
}
public LiveGiftBean setNamingLiveuid(String namingLiveuid) {
this.namingLiveuid = namingLiveuid;
return this;
}
public String getNamingUid() {
return namingUid;
}
public LiveGiftBean setNamingUid(String namingUid) {
this.namingUid = namingUid;
return this;
}
public String getNamingLiveName() {
return namingLiveName;
}
public LiveGiftBean setNamingLiveName(String namingLiveName) {
this.namingLiveName = namingLiveName;
return this;
}
public String getNamingUserName() {
return namingUserName;
}
public LiveGiftBean setNamingUserName(String namingUserName) {
this.namingUserName = namingUserName;
return this;
}
public String getNamingLiveAvatar() {
return namingLiveAvatar;
}
public LiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) {
this.namingLiveAvatar = namingLiveAvatar;
return this;
}
public String getNamingUserAvatar() {
return namingUserAvatar;
}
public LiveGiftBean setNamingUserAvatar(String namingUserAvatar) {
this.namingUserAvatar = namingUserAvatar;
return this;
}
public String getNamingStatus() {
return namingStatus;
}
public LiveGiftBean setNamingStatus(String namingStatus) {
this.namingStatus = namingStatus;
return this;
}
public String getNamingCoin() {
return namingCoin;
}
public LiveGiftBean setNamingCoin(String namingCoin) {
this.namingCoin = namingCoin;
return this;
}
public String getOperateImage() {
return operateImage;
}
public LiveGiftBean setOperateImage(String operateImage) {
this.operateImage = operateImage;
return this;
}
public String getOperateUrl() {
return operateUrl;
}
public LiveGiftBean setOperateUrl(String operateUrl) {
this.operateUrl = operateUrl;
return this;
}
public String getGiftDescription() {
return giftDescription;
}
public LiveGiftBean setGiftDescription(String giftDescription) {
this.giftDescription = giftDescription;
return this;
}
public String getCornerMark() {
return cornerMark;
}
public LiveGiftBean setCornerMark(String cornerMark) {
this.cornerMark = cornerMark;
return this;
}
public int getBlind_box_type() {
return blind_box_type;
}
public LiveGiftBean setBlind_box_type(int blind_box_type) {
this.blind_box_type = blind_box_type;
return this;
}
public String getTag() {
return tag;

View File

@@ -1,193 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.List;
/**
* 主播创建投票
* {
* "live_vote_id": "20",
* "question_content": "123",
* "vote_end_time": 180,
* "option_content_first_num": 0,
* "option_content_second_num": 0,
* "users_id": []
* }
*/
public class LiveRoomVoteModel extends BaseModel {
@SerializedName("vote_status")
private int status;
@SerializedName("live_vote_id")
private String voteId;
@SerializedName("question_content")
private String content;
@SerializedName("vote_end_time")
private int time;
@SerializedName("option_content_first_num")
private int answer1Num;
@SerializedName("option_content_second_num")
private int answer2Num;
@SerializedName("users_id")
private List<String> userIds;
@SerializedName("option_content_first")
private String answer1;
@SerializedName("option_content_second")
private String answer2;
@SerializedName("result_zh")
private String resultZh;
@SerializedName("result_en")
private String resultEn;
@SerializedName("option_text")
private String optionText;
@SerializedName("option_content_key")
private String vote;
private String liveUid;
public String getLiveUid() {
return liveUid;
}
public void setLiveUid(String liveUid) {
this.liveUid = liveUid;
}
public String getAnswer1() {
return answer1;
}
public void setAnswer1(String answer1) {
this.answer1 = answer1;
}
public String getAnswer2() {
return answer2;
}
public void setAnswer2(String answer2) {
this.answer2 = answer2;
}
public String getVoteId() {
return voteId;
}
public void setVoteId(String voteId) {
this.voteId = voteId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getTime() {
return time;
}
public void setTime(int time) {
this.time = time;
}
public int getAnswer1Num() {
return answer1Num;
}
public void setAnswer1Num(int answer1Num) {
this.answer1Num = answer1Num;
}
public int getAnswer2Num() {
return answer2Num;
}
public void setAnswer2Num(int answer2Num) {
this.answer2Num = answer2Num;
}
public List<String> getUserIds() {
return userIds;
}
public void setUserIds(List<String> userIds) {
this.userIds = userIds;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getResult() {
return WordUtil.isNewZh() ? resultZh : resultEn;
}
public String getResultZh() {
return resultZh;
}
public void setResultZh(String resultZh) {
this.resultZh = resultZh;
}
public String getResultEn() {
return resultEn;
}
public void setResultEn(String resultEn) {
this.resultEn = resultEn;
}
public String getOptionText() {
return optionText;
}
public void setOptionText(String optionText) {
this.optionText = optionText;
}
@Override
public String toString() {
return "LiveRoomVoteModel{" +
"status=" + status +
", voteId='" + voteId + '\'' +
", content='" + content + '\'' +
", time=" + time +
", answer1Num=" + answer1Num +
", answer2Num=" + answer2Num +
", userIds=" + userIds +
", answer1='" + answer1 + '\'' +
", answer2='" + answer2 + '\'' +
", resultZh='" + resultZh + '\'' +
", resultEn='" + resultEn + '\'' +
", optionText='" + optionText + '\'' +
", vote='" + vote + '\'' +
", liveUid='" + liveUid + '\'' +
'}';
}
public String getVote() {
return vote;
}
public void setVote(String vote) {
this.vote = vote;
}
public boolean isVoteLeft() {
return vote.equals("option_content_first_num");
}
public boolean isVote() {
return !StringUtil.isEmpty(vote);
}
}

View File

@@ -1,259 +0,0 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.R;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.WordUtil;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
/**
* 直播任务
*/
public class LiveTaskModel extends BaseModel {
public static final int TASK_TYPE_TIP = 0;
public static final int TASK_TYPE_ITEM = 1;
int type;
@SerializedName("new")
NewUser user;
@SerializedName("list")
List<List<Task>> list;
public LiveTaskModel() {
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public NewUser getUser() {
return user;
}
public void setUser(NewUser user) {
this.user = user;
}
public List<List<Task>> getList() {
if (user != null && user.isNew()) {
for (List<Task> tasks : list) {
for (Task task : tasks) {
task.isNewUser = true;
}
}
}
return list;
}
public void setList(List<List<Task>> list) {
this.list = list;
}
@Override
public String toString() {
return "LiveTaskModel{" +
"type=" + type +
", user=" + user +
", list=" + list +
'}';
}
public static class NewUser implements Serializable{
@SerializedName("isNew")
private int isNew;
@SerializedName("endTime")
private String endTime;
public NewUser() {
}
public boolean isNew() {
return isNew == 1;
}
public void setNew(int aNew) {
isNew = aNew;
}
public String getEndTime() {
if (!StringUtil.isEmpty(endTime)) {
endTime =WordUtil.getString(R.string.live_task_new_user_timer) + new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault()).format(new Date(Long.parseLong(endTime) * 1000));
}
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return "NewUser{" +
"isNew=" + isNew +
", endTime='" + endTime + '\'' +
'}';
}
}
public static class Task implements Serializable {
@SerializedName("id")
private int id;
@SerializedName("type")
private int type;
@SerializedName("task_type")
private int taskType;
@SerializedName("task_name")
private String taskName;
@SerializedName("task_num")
private int taskNum;
@SerializedName("hot")
private long hot;
@SerializedName("exp")
private long exp;
@SerializedName("new_hot")
private long newUserHot;
@SerializedName("new_exp")
private long newUserExp;
@SerializedName("sort")
private int sort;
@SerializedName("status")
private int status;
@SerializedName("now_num")
private int nowValue;
private boolean isNewUser = false;
public Task() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getTaskType() {
return taskType;
}
public void setTaskType(int taskType) {
this.taskType = taskType;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public int getTaskNum() {
return taskNum;
}
public void setTaskNum(int taskNum) {
this.taskNum = taskNum;
}
public long getHot() {
if (isNewUser) {
hot = newUserHot;
}
return hot;
}
public void setHot(long hot) {
this.hot = hot;
}
public long getExp() {
if (isNewUser) {
exp = newUserExp;
}
return exp;
}
public void setExp(long exp) {
this.exp = exp;
}
public long getNewUserHot() {
return newUserHot;
}
public void setNewUserHot(long newUserHot) {
this.newUserHot = newUserHot;
}
public long getNewUserExp() {
return newUserExp;
}
public void setNewUserExp(long newUserExp) {
this.newUserExp = newUserExp;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public boolean getStatus() {
return status == 1;
}
public void setStatus(int status) {
this.status = status;
}
public int getNowValue() {
return nowValue;
}
public void setNowValue(int nowValue) {
this.nowValue = nowValue;
}
@Override
public String toString() {
return "Task{" +
"id=" + id +
", type=" + type +
", taskType=" + taskType +
", taskName='" + taskName + '\'' +
", taskNum=" + taskNum +
", hot=" + hot +
", exp=" + exp +
", newUserHot=" + newUserHot +
", newUserExp=" + newUserExp +
", sort=" + sort +
", status=" + status +
'}';
}
}
}

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