Compare commits
3 Commits
新潘多拉_6.8.2
...
新潘多拉横屏
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bec6c1b79 | ||
|
|
1df8d443f7 | ||
|
|
6e7d27cbc3 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -14,8 +14,4 @@ local.properties
|
||||
/live/build/
|
||||
/main/build/
|
||||
/video/build/
|
||||
/tmp/full-r8-config.txt
|
||||
/outputs/apk
|
||||
/TabLayout/build
|
||||
/app/google_test/release
|
||||
|
||||
/tmp/full-r8-config.txt
|
||||
@@ -4,7 +4,7 @@
|
||||
>
|
||||
|
||||
<queries>
|
||||
<package android:name="${applicationId}"/>
|
||||
<package android:name="com.pandora.sy"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_KEY">ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_SECRET">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_KEY" >ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_SECRET">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="dialog_share_title">分享</string>
|
||||
<string name="dialog_share_app_internal">站內好友</string>
|
||||
<string name="dialog_share_info">快來 PandoraLive觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook">Facebook</string>
|
||||
<string name="dialog_share_app_line">Line</string>
|
||||
<string name="dialog_share_app_twitter">Twitter</string>
|
||||
<string name="dialog_share_app_whatsapp">WhatsApp</string>
|
||||
<string name="dialog_share_app_messenger">Messenger</string>
|
||||
<string name="dialog_share_app_instagram">Instagram</string>
|
||||
<string name="dialog_share_title">分享</string>
|
||||
<string name="dialog_share_info">快來 PDLIVE觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook" >Facebook</string>
|
||||
<string name="dialog_share_app_line" >Line</string>
|
||||
<string name="dialog_share_app_twitter">Twitter</string>
|
||||
<string name="dialog_share_app_whatsapp" >WhatsApp</string>
|
||||
<string name="dialog_share_app_messenger">Messenger</string>
|
||||
<string name="dialog_share_app_instagram" >Instagram</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PandoraLive觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PDLIVE觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
</resources>
|
||||
@@ -1,24 +1,24 @@
|
||||
<?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 PandoraLive and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to PandoraLive to discover more and better live streams.</string>
|
||||
<string name="dialog_share_copy">Copy</string>
|
||||
<string name="dialog_share_app_internal">Site friends</string>
|
||||
<string name="dialog_share_internal_title">Share To</string>
|
||||
<string name="dialog_share_internal_cancel">cancel</string>
|
||||
<string name="dialog_share_internal_search">Search nickname</string>
|
||||
<string name="dialog_share_internal_list_btn">Send</string>
|
||||
<string name="dialog_share_success">Share success</string>
|
||||
<string name="dialog_share_success_btn">Go chat</string>
|
||||
<string name="dialog_share_failure_not_select">Please select friends</string>
|
||||
|
||||
<string name="dialog_share_app_facebook" >Facebook</string>
|
||||
<string name="dialog_share_app_line" >Line</string>
|
||||
<string name="dialog_share_app_twitter">Twitter</string>
|
||||
<string name="dialog_share_app_whatsapp" >WhatsApp</string>
|
||||
<string name="dialog_share_app_messenger">Messenger</string>
|
||||
<string name="dialog_share_app_instagram" >Instagram</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_share_app_internal">站內好友</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PDLIVE觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
<string name="dialog_share_internal_title">分享至</string>
|
||||
<string name="dialog_share_internal_search">搜索昵稱</string>
|
||||
<string name="dialog_share_internal_list_btn">發送</string>
|
||||
<string name="dialog_share_success">分享成功</string>
|
||||
<string name="dialog_share_success_btn">去聊聊</string>
|
||||
<string name="dialog_share_failure_not_select">请选择好友</string>
|
||||
|
||||
</resources>
|
||||
@@ -297,7 +297,8 @@ android {
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.newpandora.yo"
|
||||
// applicationId "myname.pdlive.shayu"
|
||||
applicationId "com.pandora.sy"
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
//版本在这里修改
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
|
||||
@@ -1,73 +1,57 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "671943160079",
|
||||
"project_id": "pdlnews",
|
||||
"storage_bucket": "pdlnews.appspot.com"
|
||||
"project_number": "867032862719",
|
||||
"project_id": "pdlnew",
|
||||
"storage_bucket": "pdlnew.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:671943160079:android:e3116655ea962750fb8e7a",
|
||||
"mobilesdk_app_id": "1:867032862719:android:841a73fdfb6c37453ae1ca",
|
||||
"android_client_info": {
|
||||
"package_name": "com.newpandora.yo"
|
||||
"package_name": "com.pandora.sy"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "671943160079-9olh3lsv7mo2mrjr16u0cqtlmde8r4ps.apps.googleusercontent.com",
|
||||
"client_id": "867032862719-af2dnojobjd8s6ekdr1is1vev8nk36sv.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-evu2q1gur12tb34cimc9g14t9vffb9sm.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"package_name": "com.pandora.sy",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-gd4v6mr8t330ik8a00po6psdsn6p7b9k.apps.googleusercontent.com",
|
||||
"client_id": "867032862719-ohaa1f18e186qpasvgt7qkk1i1pivniq.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "89f318e9603ae92835b6dab299a45afc59485b9e"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-gs1mv4vpdjgofj541cuqkfhija98rna0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "b55235e71e9e1d2f8f7120ddc4224db85125e085"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-pdtdv5k1s4mamo7obssuo99rtghkd503.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"package_name": "com.pandora.sy",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-9259s527l99jlrfikv6hd4ljcieup34u.apps.googleusercontent.com",
|
||||
"client_id": "867032862719-snpbqruvqcc9fsifjnmm1h3dcgtr8am4.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.sy",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCf7-JJ44TD09I34Yt4DVzcAO7VCDCa424"
|
||||
"current_key": "AIzaSyAnlY2aBEGyg7QpghHo7EaMRkM89dVNgq8"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "671943160079-9259s527l99jlrfikv6hd4ljcieup34u.apps.googleusercontent.com",
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
|
||||
1
app/proguard-rules.pro
vendored
1
app/proguard-rules.pro
vendored
@@ -319,4 +319,3 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keep class com.qiniu.**{*;}
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.NETWORK_PROVIDER" />
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.gson.Gson;
|
||||
import com.pandoralive.shayu.R;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.yunbao.common.http.Data;
|
||||
@@ -483,7 +482,7 @@ public class AppContext extends CommonAppContext {
|
||||
NeverCrashUtils.getInstance().setDebugMode(BuildConfig.DEBUG).setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
DebugUtils.runDebugCode(() -> {
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.widget.Toast;
|
||||
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
|
||||
@@ -106,10 +105,10 @@ public class NeverCrashUtils {
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppContext.setFirebaseCrashData();
|
||||
DebugUtils.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
DebugUtils.runDebugCode(() -> errorWhile = false);
|
||||
AppManager.runDebugCode(() -> errorWhile = false);
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -86,7 +86,6 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
api 'androidx.activity:activity:1.9.1'
|
||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
api rootProject.ext.dependencies["cardview-androidx"]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:authorities="com.pandora.sy.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
|
||||
@@ -282,10 +282,6 @@ public class Constants {
|
||||
|
||||
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
||||
|
||||
public static final String SOCKET_SEND_NEW_TASK_PUSH="SendNewTaskPush";//直播间-新用户完成任务push
|
||||
|
||||
public static final String SOCKET_SEND_NEW_TASK_IM ="SendNewTaskIM"; //直播间—新用户领取礼物IM
|
||||
|
||||
//视频举报获取位置
|
||||
public static int xIndex = 0;
|
||||
public static int yindex = 0;
|
||||
|
||||
@@ -434,8 +434,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
gotoLive(event.getLiveId());
|
||||
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}else if(TextUtils.equals(event.getMethod(), "toRoomManage")){
|
||||
RouteUtil.forwardRoomManageActivity();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import static com.yunbao.common.utils.StringUtil.isEmpty;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/22.
|
||||
*/
|
||||
|
||||
public class LiveDataHistoryAdapter extends RecyclerView.Adapter<LiveDataHistoryAdapter.Vh> {
|
||||
|
||||
private Context mContext;
|
||||
private List<LiveDataHistoryBean> mList= new ArrayList<>();
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public LiveDataHistoryAdapter(Context context, List<LiveDataHistoryBean> list) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
mList = list;
|
||||
}
|
||||
|
||||
public void setDataCollection(List<LiveDataHistoryBean> data) {
|
||||
if (data == null) {
|
||||
data = new ArrayList();
|
||||
}
|
||||
this.mList = data;
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.live_data_history_item, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh holder, @SuppressLint("RecyclerView") int position) {
|
||||
if (isEmpty() || mList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
holder.time.setText(mList.get(position).getAddtime().substring(0,9)+"\n"+mList.get(position).getAddtime().substring(10));
|
||||
holder.giftTypeName.setText(mList.get(position).getCateName());
|
||||
holder.giftName.setText(mList.get(position).getGiftname());
|
||||
holder.income.setText(String.valueOf(mList.get(position).getAnchor_profit_coin()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
private TextView time;
|
||||
private TextView giftTypeName;
|
||||
private TextView giftName;
|
||||
private TextView income;
|
||||
|
||||
public Vh(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
time = itemView.findViewById(R.id.time);
|
||||
giftTypeName = itemView.findViewById(R.id.giftTypeName);
|
||||
giftName = itemView.findViewById(R.id.giftName);
|
||||
income = itemView.findViewById(R.id.income);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,34 +12,25 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ChatMsgTypeUtils;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.spongycastle.jcajce.provider.asymmetric.rsa.ISOSignatureSpi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
@@ -48,54 +39,26 @@ import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.HQVoiceMessage;
|
||||
import io.rong.message.ImageMessage;
|
||||
import io.rong.message.SightMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
import io.rong.message.VoiceMessage;
|
||||
|
||||
public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
public static final int TYPE_SEARCH_TITLE = 500;
|
||||
public static final int TYPE_SEARCH_USER = 510;
|
||||
public static final int TYPE_SEARCH_CHAT = 520;
|
||||
private List<BaseUiConversation> srcList;
|
||||
private List<BaseUiConversation> allDataList;
|
||||
private Context mContext;
|
||||
private boolean isChat = true;
|
||||
private OnRecyclerListRefreshListener<List<BaseUiConversation>> onRefreshListener;
|
||||
private Map<String, Integer> timerMap = new HashMap<>();
|
||||
|
||||
|
||||
public static final int FILTER_OFFLINE = 0;
|
||||
public static final int FILTER_ONLINE = 1;
|
||||
public static final int FILTER_UNREAD = 2;
|
||||
public static final int FILTER_READ = 4;
|
||||
public static final int FILTER_ALL = 7;
|
||||
private int mFilter = FILTER_ALL;
|
||||
|
||||
public int getFilter() {
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
public void setFilter(int mFilter) {
|
||||
if (this.mFilter == mFilter)
|
||||
return;
|
||||
this.mFilter = mFilter;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MainConversationListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setSrcList(List<BaseUiConversation> srcList) {
|
||||
this.srcList = srcList;
|
||||
if (mFilter== FILTER_OFFLINE || mFilter == FILTER_ONLINE) {
|
||||
super.setDataCollection(UiConversationCodeUtil.FilterData(mFilter, allDataList));
|
||||
}else {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setOnRefreshListener(OnRecyclerListRefreshListener<List<BaseUiConversation>> onRefreshListener) {
|
||||
@@ -119,7 +82,7 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main_msg_search_chat, parent, false);
|
||||
holder = ViewHolder.createViewHolder(parent.getContext(), view);
|
||||
} else if (viewType != -200) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.rc_conversationlist_item2, parent, false);
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.rc_conversationlist_item, parent, false);
|
||||
holder = ViewHolder.createViewHolder(parent.getContext(), view);
|
||||
} else {
|
||||
holder = super.onCreateViewHolder(parent, viewType);
|
||||
@@ -132,13 +95,11 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
int type = super.getItemViewType(position);
|
||||
if (mDataList.size() > position) {
|
||||
String objectName = mDataList.get(position).mCore.getObjectName();
|
||||
Log.i("聊天数据源发现","objectName::"+objectName);
|
||||
if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_USER")) {
|
||||
type = TYPE_SEARCH_USER;
|
||||
} else if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_CHAT")) {
|
||||
type = TYPE_SEARCH_CHAT;
|
||||
} else if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_TITLE")) {
|
||||
Log.i("聊天数据源发现 ","getItemViewTypeSEARCH_TITLE");
|
||||
type = TYPE_SEARCH_TITLE;
|
||||
}
|
||||
} else if (mDataList.isEmpty() || isEmpty() || srcList.isEmpty()) {
|
||||
@@ -158,95 +119,33 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
} else if (getItemViewType(position) == TYPE_SEARCH_CHAT) {
|
||||
bindChat(holder, position);
|
||||
} else if (getItemViewType(position) == TYPE_SEARCH_TITLE) {
|
||||
Log.i("聊天数据源设置标题头","SEARCH_TITLE::"+position);
|
||||
bindTitle(holder, position);
|
||||
return;
|
||||
} else if (getItemViewType(position) != -200) {
|
||||
bindChatNew(holder, position);
|
||||
super.onBindViewHolder(holder, position);
|
||||
return;
|
||||
}
|
||||
if (getItemViewType(position) != -200) {
|
||||
bindDefault(holder, position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindChatNew(ViewHolder holder, int position) {
|
||||
BaseUiConversation conversation = mDataList.get(position);
|
||||
ImgLoader.display(holder.getContext(), conversation.mCore.getPortraitUrl(), holder.getView(R.id.rc_conversation_portrait));
|
||||
holder.setText(R.id.rc_conversation_title, conversation.mCore.getConversationTitle());
|
||||
((TextView) holder.getView(R.id.rc_conversation_content)).setText(ChatMsgTypeUtils.getMsg(conversation.mConversationContent.toString()));
|
||||
if (conversation.mCore.getSentTime() != -1 && holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.setText(R.id.rc_conversation_date, DateFormatUtil.getDateTimeString(conversation.mCore.getSentTime(), true, holder.getContext()));
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.VISIBLE);
|
||||
} else if (holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.GONE);
|
||||
}
|
||||
holder.setVisible(R.id.rc_conversation_live_online, "0".equals(conversation.mCore.getDraft()));
|
||||
int unReadCount = conversation.mCore.getUnreadMessageCount();
|
||||
|
||||
if (unReadCount > 0) {
|
||||
holder.setVisible(R.id.rc_conversation_unread_count, true);
|
||||
holder.setText(R.id.rc_conversation_unread_count, String.valueOf(unReadCount));
|
||||
} else {
|
||||
holder.setVisible(R.id.rc_conversation_unread_count, false);
|
||||
}
|
||||
|
||||
|
||||
Message message = conversation.mCore.getMessage();
|
||||
if (message != null && message.getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
holder.setVisible(R.id.rc_conversation_unread_tv, true);
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
holder.setTextColor(R.id.rc_conversation_unread_tv, ContextCompat.getColor(holder.itemView.getContext(), R.color.rc_secondary_color));
|
||||
holder.setText(R.id.rc_conversation_unread_tv, WordUtil.getNewString(R.string.message_chat_msg_read_tip));
|
||||
} else {
|
||||
holder.setTextColor(R.id.rc_conversation_unread_tv, ContextCompat.getColor(holder.itemView.getContext(), R.color.red));
|
||||
holder.setText(R.id.rc_conversation_unread_tv, WordUtil.getNewString(R.string.message_chat_msg_unread_tip));
|
||||
}
|
||||
} else {
|
||||
holder.setVisible(R.id.rc_conversation_unread_tv, false);
|
||||
}
|
||||
|
||||
|
||||
if (holder.getView(R.id.rc_conversation_live_status) == null || IMLoginManager.get(holder.getContext()).getAnchorB() != 1) {
|
||||
return;
|
||||
}
|
||||
Integer timer = timerMap.get(mDataList.get(position).mCore.getTargetId());
|
||||
if (timer == null) {
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (timer >= 10) {
|
||||
holder.setText(R.id.rc_conversation_live_status,
|
||||
String.format(WordUtil.getNewString(R.string.message_chat_msg_look_live), timer)
|
||||
);
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindDefault(ViewHolder holder, int position) {
|
||||
BaseUiConversation conversation = mDataList.get(position);
|
||||
Log.i("列表", "bindDefault: 用户头像:" + conversation.mCore.getPortraitUrl());
|
||||
Log.i("列表", "bindDefault: 用户名字:" + conversation.mCore.getConversationTitle());
|
||||
ImgLoader.display(holder.getContext(), conversation.mCore.getPortraitUrl(), holder.getView(R.id.rc_conversation_portrait));
|
||||
holder.setText(R.id.rc_conversation_title, conversation.mCore.getConversationTitle());
|
||||
((TextView) holder.getView(R.id.rc_conversation_content)).setText(ChatMsgTypeUtils.getMsg(conversation.mConversationContent.toString()));
|
||||
if (conversation.mCore.getSentTime() != -1 && holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.setText(R.id.rc_conversation_date, DateFormatUtil.getDateTimeString(conversation.mCore.getSentTime(), true, holder.getContext()));
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.VISIBLE);
|
||||
} else if (holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.GONE);
|
||||
}
|
||||
if ("0".equals(conversation.mCore.getDraft())) {
|
||||
holder.setImageDrawable(R.id.rc_conversation_live_online_icon, mContext.getResources().getDrawable(R.mipmap.msg_online));
|
||||
holder.setText(R.id.rc_conversation_live_online, WordUtil.isNewZh() ? "在線" : "Online");
|
||||
} else {
|
||||
holder.setImageDrawable(R.id.rc_conversation_live_online_icon, mContext.getResources().getDrawable(R.mipmap.msg_off));
|
||||
holder.setText(R.id.rc_conversation_live_online, WordUtil.isNewZh() ? "離線" : "Offline");
|
||||
if("0".equals(conversation.mCore.getDraft())){
|
||||
holder.setImageDrawable(R.id.rc_conversation_live_online_icon,mContext.getResources().getDrawable(R.mipmap.msg_online));
|
||||
holder.setText(R.id.rc_conversation_live_online,WordUtil.isNewZh()?"在線":"Online");
|
||||
}else{
|
||||
holder.setImageDrawable(R.id.rc_conversation_live_online_icon,mContext.getResources().getDrawable(R.mipmap.msg_off));
|
||||
holder.setText(R.id.rc_conversation_live_online,WordUtil.isNewZh()?"離線":"Offline");
|
||||
}
|
||||
if (holder.getView(R.id.rc_conversation_live_status) == null || IMLoginManager.get(holder.getContext()).getAnchorB() != 1) {
|
||||
return;
|
||||
@@ -266,9 +165,7 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindEmpty(ViewHolder holder, int position) {
|
||||
Log.i("聊天数据源", "bindEmpty: ");
|
||||
if (isChat) {
|
||||
ViewUtils.findViewById(holder.itemView, R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_message_not_chat_list);
|
||||
ViewUtils.findViewById(holder.itemView, R.id.textView, TextView.class).setText(R.string.not_data_message_chat_list);
|
||||
@@ -280,19 +177,15 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
|
||||
public void onFinish() {
|
||||
if (onRefreshListener != null) {
|
||||
Log.i("聊天数据源", "设置数据源: " + allDataList.size());
|
||||
onRefreshListener.onFinish(allDataList);
|
||||
Log.i("聊天数据源", "设置数据源: " + mDataList.size());
|
||||
onRefreshListener.onFinish(mDataList);
|
||||
}
|
||||
}
|
||||
|
||||
private int listHashCode = 0;
|
||||
|
||||
public synchronized void setDataCollectionV2(List<BaseUiConversation> data, boolean isSearch) {
|
||||
if (data.hashCode() == listHashCode) return;
|
||||
listHashCode = data.hashCode();
|
||||
@Override
|
||||
public void setDataCollection(List<BaseUiConversation> data) {
|
||||
List<BaseUiConversation> tmp = new ArrayList<>();
|
||||
Log.i("聊天数据源", "size()" + data.size() + " setDataCollection: " + data.hashCode());
|
||||
|
||||
Log.i("聊天数据源", "setDataCollection: " + data.hashCode());
|
||||
List<String> urls = new ArrayList<>();
|
||||
if (srcList == null) {
|
||||
srcList = new ArrayList<>();
|
||||
@@ -301,8 +194,7 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
if (mContext == null)
|
||||
mContext = AppManager.getInstance().getLastActivity();
|
||||
for (BaseUiConversation item : data) {
|
||||
if (urls.contains(item.mCore.getTargetId()) && item.mCore.getTargetId()!=null) continue;
|
||||
// if ( item.mCore.getConversationTitle()==null || item.mCore.getTargetId()==null) continue;
|
||||
if (urls.contains(item.mCore.getTargetId())) continue;
|
||||
if (item.mConversationContent != null && item.mConversationContent.toString().contains("_method_")) {
|
||||
IMCenter.getInstance().deleteMessages(Conversation.ConversationType.PRIVATE,
|
||||
item.mCore.getTargetId(),
|
||||
@@ -321,13 +213,9 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, item.mCore.getTargetId(), null);
|
||||
}
|
||||
urls.add(item.mCore.getTargetId());
|
||||
Log.i("聊天数据源", item.mCore.getConversationTitle() + "|" + item.mCore.getPortraitUrl() + "|" + item.mCore.getTargetId() +"|"+item.mCore.getObjectName());
|
||||
|
||||
if (!tmpUids.contains(item.mCore.getTargetId())) {
|
||||
BaseUiConversation cn = new SingleConversation(mContext, item.mCore);
|
||||
srcList.add(cn);
|
||||
tmpUids.add(item.mCore.getTargetId());
|
||||
}
|
||||
Log.i("聊天数据源", item.mCore.getConversationTitle() + "|" + item.mCore.getPortraitUrl() + "|" + item.mCore.getTargetId());
|
||||
BaseUiConversation cn = new SingleConversation(mContext, item.mCore);
|
||||
srcList.add(cn);
|
||||
|
||||
if (item.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
|
||||
if (item.mCore.getLatestMessage() instanceof MessageChatCardContent) {
|
||||
@@ -336,37 +224,11 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
}
|
||||
tmp.add(item);
|
||||
}
|
||||
List<BaseUiConversation> showData = null;
|
||||
if (isSearch) {
|
||||
// Log.i("聊天数据源", "FilterData isSearch");
|
||||
showData = tmp ;//UiConversationCodeUtil.FilterData(mFilter, tmp, allDataList);
|
||||
} else {
|
||||
allDataList = tmp;
|
||||
if (mFilter != FILTER_OFFLINE && mFilter != FILTER_ONLINE )
|
||||
{
|
||||
// Log.i("聊天数据源", "FilterData notSearch");
|
||||
showData = UiConversationCodeUtil.FilterData(mFilter, allDataList);
|
||||
}
|
||||
}
|
||||
if (showData != null && !UiConversationCodeUtil.checkIsSame(showData, mDataList)) {
|
||||
// Log.i("聊天数据源", "数据源有变化" + showData.size());
|
||||
super.setDataCollection(showData);
|
||||
} else {
|
||||
// Log.i("聊天数据源", "数据源无变化");
|
||||
}
|
||||
// ToastUtil.showDebug("消息数:"+data.size());
|
||||
super.setDataCollection(tmp);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<BaseUiConversation> data) {
|
||||
setDataCollectionV2(data, false);
|
||||
}
|
||||
|
||||
|
||||
private List<String> tmpUids = new ArrayList<>();
|
||||
|
||||
public void clear() {
|
||||
Log.i("聊天数据源", "clear: " + mDataList.size());
|
||||
mDataList.clear();
|
||||
if (srcList != null) {
|
||||
srcList.clear();
|
||||
@@ -473,17 +335,12 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
BaseUiConversation conversation = mDataList.get(id);
|
||||
conversation.mCore.setSentTime(bean.getSentTime());
|
||||
conversation.mCore.setUnreadMessageCount(integer);
|
||||
if (bean.getContent() instanceof SightMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[小視頻]" : "[Video]");
|
||||
} else if (bean.getContent() instanceof HQVoiceMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[語音]" : "[Voice]");
|
||||
} else if (bean.getContent() instanceof ImageMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[圖片]" : "[picture]");
|
||||
} else if (bean.getContent() instanceof MessageChatCardContent) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[站內分享]" : "[In-app sharing]");
|
||||
} else {
|
||||
if(bean.getContent() instanceof SightMessage){
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh()?"[小視頻]":"[Video]");
|
||||
}else{
|
||||
conversation.mConversationContent = new SpannableString(((TextMessage) bean.getContent()).getContent());
|
||||
}
|
||||
|
||||
mDataList.set(id, conversation);
|
||||
notifyItemChanged(id);
|
||||
}
|
||||
@@ -499,6 +356,4 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ public class ConfigBean extends BaseModel {
|
||||
private String google_isup;
|
||||
|
||||
private String sud_game_speech;
|
||||
private int pay_type = 0;
|
||||
|
||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||
private String isReturnUser="";
|
||||
@@ -73,14 +72,6 @@ public class ConfigBean extends BaseModel {
|
||||
@SerializedName("jump_h5_url")//点击跳转H5页面地址
|
||||
private String jumpH5Url="";
|
||||
|
||||
public int getPay_type() {
|
||||
return pay_type;
|
||||
}
|
||||
|
||||
public void setPay_type(int pay_type) {
|
||||
this.pay_type = pay_type;
|
||||
}
|
||||
|
||||
@JSONField(name = "is_return_user")
|
||||
public String getIsReturnUser() {
|
||||
return isReturnUser;
|
||||
|
||||
@@ -113,67 +113,10 @@ public class EnterRoomInfoModel extends BaseModel {
|
||||
private String giftWallLightenNumber;
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
private String giftWallLightenTotal;
|
||||
|
||||
@SerializedName("connection_info")
|
||||
private LivePkMicModel connectionInfo;
|
||||
|
||||
@SerializedName("week_star_gift_num")
|
||||
private String weekStarGiftNum;
|
||||
|
||||
@SerializedName("week_gift_illuminate_num")
|
||||
private String weekGiftIlluminateNum;
|
||||
|
||||
// 对应的getter和setter方法
|
||||
public String getWeekStarGiftNum() {
|
||||
return weekStarGiftNum;
|
||||
}
|
||||
|
||||
public void setWeekStarGiftNum(String weekStarGiftNum) {
|
||||
this.weekStarGiftNum = weekStarGiftNum;
|
||||
}
|
||||
|
||||
public String getWeekGiftIlluminateNum() {
|
||||
return weekGiftIlluminateNum;
|
||||
}
|
||||
|
||||
public void setWeekGiftIlluminateNum(String weekGiftIlluminateNum) {
|
||||
this.weekGiftIlluminateNum = weekGiftIlluminateNum;
|
||||
}
|
||||
//
|
||||
// "week_star_gift_num": 0,
|
||||
// "week_gift_illuminate_num": 0
|
||||
|
||||
|
||||
@SerializedName("is_first_entry")
|
||||
private String isFirstEntry;
|
||||
@SerializedName("is_new_user")
|
||||
private String isNewUser;
|
||||
@SerializedName("is_com_all")
|
||||
private String isComAll;
|
||||
|
||||
public String getIsComAll() {
|
||||
return isComAll;
|
||||
}
|
||||
|
||||
public void setIsComAll(String isComAll) {
|
||||
this.isComAll = isComAll;
|
||||
}
|
||||
|
||||
public String getIsFirstEntry() {
|
||||
return isFirstEntry;
|
||||
}
|
||||
|
||||
public void setIsFirstEntry(String isFirstEntry) {
|
||||
this.isFirstEntry = isFirstEntry;
|
||||
}
|
||||
|
||||
public String getIsNewUser() {
|
||||
return isNewUser;
|
||||
}
|
||||
|
||||
public void setIsNewUser(String isNewUser) {
|
||||
this.isNewUser = isNewUser;
|
||||
}
|
||||
|
||||
public LivePkMicModel getConnectionInfo() {
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class HotStrategyBean {
|
||||
private String id;
|
||||
private String title;
|
||||
private String english_title;
|
||||
private String url;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getEnglish_title() {
|
||||
return english_title;
|
||||
}
|
||||
|
||||
public void setEnglish_title(String english_title) {
|
||||
this.english_title = english_title;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -19,21 +19,6 @@ public class LiveAiRobotBean extends BaseModel {
|
||||
@SerializedName("ai_gz")
|
||||
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||
|
||||
@SerializedName("ai_langue")//0中文1英文
|
||||
private int aiLangue;
|
||||
|
||||
public int getAiLangue() {
|
||||
return aiLangue;
|
||||
}
|
||||
|
||||
public Boolean isLangueCn(){
|
||||
return aiLangue==0;
|
||||
}
|
||||
|
||||
public void setAiLangue(int aiLangue) {
|
||||
this.aiLangue = aiLangue;
|
||||
}
|
||||
|
||||
public LiveAiRobotBean() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
@@ -34,9 +32,6 @@ public class LiveAnchorSayModel extends BaseModel{
|
||||
private int isShow;
|
||||
private String content;
|
||||
private String styleImage;
|
||||
@Nullable
|
||||
private String title;
|
||||
|
||||
|
||||
public LivePreview() {
|
||||
}
|
||||
@@ -53,15 +48,6 @@ public class LiveAnchorSayModel extends BaseModel{
|
||||
return content;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(@Nullable String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* 直播数据
|
||||
*/
|
||||
public class LiveDataHistoryBean extends BaseModel {
|
||||
private String giftid;
|
||||
private String anchor_profit_coin;
|
||||
private String addtime;
|
||||
private String giftname;
|
||||
private String cate_name;
|
||||
private String english_cate_name;
|
||||
|
||||
|
||||
public String getGiftid() {
|
||||
return giftid;
|
||||
}
|
||||
|
||||
public void setGiftid(String giftid) {
|
||||
this.giftid = giftid;
|
||||
}
|
||||
|
||||
public String getAnchor_profit_coin() {
|
||||
return anchor_profit_coin;
|
||||
}
|
||||
|
||||
public void setAnchor_profit_coin(String anchor_profit_coin) {
|
||||
this.anchor_profit_coin = anchor_profit_coin;
|
||||
}
|
||||
|
||||
public String getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(String addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public void setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
}
|
||||
|
||||
public String getCateName() {
|
||||
return WordUtil.isNewZh()?cate_name:english_cate_name;
|
||||
}
|
||||
|
||||
public void setCate_name(String cate_name) {
|
||||
this.cate_name = cate_name;
|
||||
}
|
||||
|
||||
public String getEnglish_cate_name() {
|
||||
return english_cate_name;
|
||||
}
|
||||
|
||||
public void setEnglish_cate_name(String english_cate_name) {
|
||||
this.english_cate_name = english_cate_name;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
public class LiveDataInfoNowModel extends BaseModel {
|
||||
private String color;
|
||||
private String title;
|
||||
private String data;
|
||||
|
||||
public LiveDataInfoNowModel(String color, String title, String data) {
|
||||
this.color = color;
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel(String title, String data) {
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel() {
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
/**
|
||||
* 开播提示
|
||||
*/
|
||||
public class LiveOpenTipsBean extends BaseModel{
|
||||
private String content;
|
||||
private String english_content;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getEnglish_content() {
|
||||
return english_content;
|
||||
}
|
||||
|
||||
public void setEnglish_content(String english_content) {
|
||||
this.english_content = english_content;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class LiveTaskModel extends BaseModel {
|
||||
|
||||
public String getEndTime() {
|
||||
if (!StringUtil.isEmpty(endTime)) {
|
||||
endTime = new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault()).format(new Date(Long.parseLong(endTime) * 1000));
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class NewPeopleTaskModel extends BaseModel {
|
||||
@@ -12,12 +10,9 @@ public class NewPeopleTaskModel extends BaseModel {
|
||||
private GiftModel gift = new GiftModel();
|
||||
@SerializedName("reward_all")
|
||||
private RewardAllModel rewardAll = new RewardAllModel();
|
||||
|
||||
@SerializedName("reward_one")
|
||||
private RewardAllModel rewardOne = new RewardAllModel();
|
||||
|
||||
@SerializedName("is_free_gift")
|
||||
private String isFreeGift = "1";
|
||||
|
||||
public TaskModel getTask() {
|
||||
return task;
|
||||
}
|
||||
@@ -27,20 +22,6 @@ public class NewPeopleTaskModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsFreeGift() {
|
||||
return isFreeGift;
|
||||
}
|
||||
|
||||
public void setIsFreeGift(String isFreeGift) {
|
||||
this.isFreeGift = isFreeGift;
|
||||
}
|
||||
|
||||
public boolean hasFreeGift(){
|
||||
Log.i("hasFreeGift",isFreeGift);
|
||||
return isFreeGift.equals("0");
|
||||
}
|
||||
|
||||
|
||||
public GiftModel getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
@@ -58,16 +58,6 @@ public class UserBean implements Parcelable {
|
||||
private String is_bind;
|
||||
private String mobile;
|
||||
private String front_task;
|
||||
|
||||
public String getNoble_img() {
|
||||
return noble_img;
|
||||
}
|
||||
|
||||
public void setNoble_img(String noble_img) {
|
||||
this.noble_img = noble_img;
|
||||
}
|
||||
|
||||
private String noble_img;
|
||||
private String is_admin;
|
||||
@SerializedName("user_love_num")
|
||||
private int praise;
|
||||
|
||||
@@ -27,7 +27,6 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
|
||||
protected Context mContext;
|
||||
protected View mRootView;
|
||||
protected Dialog dialog;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -38,7 +37,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
} else {
|
||||
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
|
||||
}
|
||||
dialog = new Dialog(mContext, getDialogStyle());
|
||||
Dialog dialog = new Dialog(mContext, getDialogStyle());
|
||||
dialog.setContentView(mRootView);
|
||||
dialog.setCancelable(canCancel());
|
||||
dialog.setCanceledOnTouchOutside(canCancel());
|
||||
@@ -67,7 +66,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
|
||||
protected abstract void setWindowAttributes(Window window);
|
||||
|
||||
protected <T extends View> T findViewById(int id) {
|
||||
protected View findViewById(int id) {
|
||||
if (mRootView != null) {
|
||||
return mRootView.findViewById(id);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -85,7 +86,7 @@ public class GiftWallAchieveDialog extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
if (isFullWindows ||getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
@@ -80,6 +81,7 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall;
|
||||
@@ -87,13 +89,18 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight() - DpUtil.dp2px(10);
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
} else {
|
||||
return super.getPopupHeight() - DpUtil.dp2px(10);
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvTips = findViewById(R.id.v_tips);
|
||||
@@ -196,6 +203,10 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
if (isTab2) {
|
||||
mTvTab2.callOnClick();
|
||||
}
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
findViewById(R.id.rootView).setOnClickListener(v -> dismiss());
|
||||
mIvBg.setOnClickListener(v -> {});
|
||||
}
|
||||
}
|
||||
|
||||
private void resetWindows() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -117,7 +118,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
if (isFullWindows || getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
@@ -277,7 +278,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
|
||||
void initData() {
|
||||
adapter.setList_type(list_type);
|
||||
if (isAnchor || (isTab2Enter && isStar)) {
|
||||
if (isAnchor) {
|
||||
if (isStar) {
|
||||
gift_hall_type = 2;
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||
import com.yunbao.common.custom.RatioRoundImageView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.ChatMsgTypeUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
@@ -94,7 +93,7 @@ public class MessageChatNotifyDialog extends AbsDialogPositionPopupWindow {
|
||||
if (StringUtil.isEmpty(liveBean.getExtras())) {
|
||||
((TextView) findViewById(R.id.description)).setText(liveBean.getUser().getSignature());
|
||||
} else {
|
||||
((TextView) findViewById(R.id.description)).setText(ChatMsgTypeUtils.getMsg(liveBean.getExtras()));
|
||||
((TextView) findViewById(R.id.description)).setText(liveBean.getExtras());
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
dismiss();
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
// Bus.getOff(this);
|
||||
Bus.getOff(this);
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
// Bus.getOn(this);
|
||||
Bus.getOn(this);
|
||||
editSearch = findViewById(R.id.edit_search);
|
||||
// listHistory = findViewById(R.id.list_history);
|
||||
listRoom = findViewById(R.id.list_room);
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.common.fragment;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
@@ -24,7 +23,6 @@ import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||
import com.yunbao.common.utils.ChatMsgTypeUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -143,7 +141,7 @@ public abstract class AbsMainMessageChatListFragment extends Fragment {
|
||||
isNet = true;
|
||||
for (BaseUiConversation conversation : srcList) {
|
||||
map.put(conversation.mCore.getTargetId(), conversation);
|
||||
if (conversation.mCore.getConversationType() == Conversation.ConversationType.PRIVATE&& !conversation.mCore.getTargetId().equals("__system__")) {
|
||||
if (conversation.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
|
||||
uids.add(conversation.mCore.getTargetId());
|
||||
}
|
||||
}
|
||||
@@ -160,7 +158,7 @@ public abstract class AbsMainMessageChatListFragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
}
|
||||
srcList.get(i).mConversationContent =new SpannableString(ChatMsgTypeUtils.getMsg(srcList.get(i).mConversationContent.toString()));
|
||||
|
||||
}
|
||||
onRefreshListener.onFinish(srcList);
|
||||
isNet = false;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.facebook.all.All;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
|
||||
public class ChatViewModel extends ViewModel {
|
||||
|
||||
private int mChatFilter = UiConversationCodeUtil.FILTER_ALL;
|
||||
|
||||
public int getChatFilter() {
|
||||
return mChatFilter;
|
||||
}
|
||||
|
||||
public void setChatFilter(int mChatFilter) {
|
||||
this.mChatFilter = mChatFilter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getTitleTextId() {
|
||||
int id = R.string.all_chats;
|
||||
switch (mChatFilter) {
|
||||
case UiConversationCodeUtil.FILTER_ALL:
|
||||
id = R.string.all_chats;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_ONLINE:
|
||||
id = R.string.online_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_OFFLINE:
|
||||
id = R.string.offline_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_READ:
|
||||
id = R.string.read_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_UNREAD:
|
||||
id = R.string.unread_only;
|
||||
break;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveDataHistoryAdapter;
|
||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
|
||||
public class LiveDataHistoryFragment extends Fragment {
|
||||
|
||||
protected SmartRefreshLayout mRefreshLayout;
|
||||
protected RecyclerView mList;
|
||||
private LiveDataHistoryAdapter mAdapter;
|
||||
List<LiveDataHistoryBean> list = new ArrayList<>();
|
||||
private View emptyView;
|
||||
private Context mContext;
|
||||
private String mStream;
|
||||
private int mPageCount = 1;//页数
|
||||
|
||||
public LiveDataHistoryFragment(Context context,String stream) {
|
||||
this.mContext =context;
|
||||
this.mStream = stream;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
emptyView = inflater.inflate(R.layout.view_layout_msg,container, false);
|
||||
ViewUtils.findViewById(emptyView,R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_addressbook_not_search);
|
||||
ViewUtils.findViewById(emptyView,R.id.textView, TextView.class).setText(R.string.not_data_message_address_book_list);
|
||||
return inflater.inflate(R.layout.live_data_history_list_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mAdapter = new LiveDataHistoryAdapter(mContext,list);
|
||||
this.mList = (RecyclerView) view.findViewById(R.id.rc_conversation_list);
|
||||
this.mRefreshLayout = (SmartRefreshLayout) view.findViewById(R.id.rc_refresh);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getActivity());
|
||||
this.mList.setLayoutManager(layoutManager);
|
||||
mList.setAdapter(mAdapter);
|
||||
initRefreshView();
|
||||
initData();
|
||||
}
|
||||
|
||||
protected void initRefreshView() {
|
||||
this.mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
this.mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
mPageCount = 1;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
mPageCount++;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
CommonHttpUtil.getLiveDataHistoryList(mStream, String.valueOf(mPageCount),new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
List<LiveDataHistoryBean> tempList = JSON.parseArray(obj.getString("data"), LiveDataHistoryBean.class);
|
||||
if(mPageCount==1){
|
||||
list = tempList;
|
||||
mAdapter.setDataCollection(list);
|
||||
mRefreshLayout.finishRefresh(true);
|
||||
}else{
|
||||
list.addAll(tempList);
|
||||
mAdapter.setDataCollection(list);
|
||||
mRefreshLayout.finishLoadMore(true);
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import static com.umeng.commonsdk.stateless.UMSLEnvelopeBuild.mContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveDataInfoRecyclerAdapter;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoNowModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataNowFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private LiveDataInfoRecyclerAdapter adapter;
|
||||
private List<LiveDataInfoNowModel> list;
|
||||
private String mLiveUid;
|
||||
private onDataResult onDataResult;
|
||||
private String mStream;
|
||||
|
||||
public LiveDataNowFragment(Context context, String liveUid,String mStream,LiveDataNowFragment.onDataResult onDataResult) {
|
||||
this.mLiveUid = liveUid;
|
||||
this.onDataResult = onDataResult;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.live_data_now_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
recyclerView = view.findViewById(R.id.live_data_list);
|
||||
adapter = new LiveDataInfoRecyclerAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), getContext().getString(R.string.live_data_loading)));
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveData(mLiveUid,mStream, new HttpCallback<LiveDataInfoModel>() {
|
||||
@Override
|
||||
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
||||
list.clear();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), data.getTotalCoin() + ""));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), data.getTotalGold() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), data.getAcceptNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), data.getEnterNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), data.getAttentionNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), data.getFanGroupNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + ""));
|
||||
adapter.setList(list);
|
||||
if(onDataResult!=null){
|
||||
onDataResult.Result(data.getTotalCoin() + "",data.getAcceptNum() + "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface onDataResult{
|
||||
void Result(String countZs,String countPerson);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -20,7 +19,6 @@ import com.yunbao.common.bean.WishModel2;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -36,11 +34,7 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
private RecyclerView wishList;
|
||||
private LiveNewWishAdapter liveNewWishAdapter;
|
||||
private ImageView imageView2, tvDone;
|
||||
private CommonCallback<Boolean> mSetResultCallback ;
|
||||
|
||||
public void setResultCallback(CommonCallback<Boolean> mCommonCallback) {
|
||||
this.mSetResultCallback = mCommonCallback;
|
||||
}
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.view_live_new_wish, viewGroup, false);
|
||||
@@ -157,9 +151,6 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -192,10 +183,6 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
//这里需要通知刷新心愿信息
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,9 +202,6 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -11,13 +9,11 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -30,20 +26,16 @@ import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.event.Event;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
import io.rong.imlib.model.SearchConversationResult;
|
||||
|
||||
public class MainMessageChatFragment extends ConversationListFragment {
|
||||
|
||||
private static final String TAG = "融云列表";
|
||||
int listHashCode = 0;
|
||||
// ChatViewModel chatViewModel;
|
||||
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
Log.i(TAG, "onCreateView: 创建融云");
|
||||
// chatViewModel = (ChatViewModel)(new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
return inflater.inflate(R.layout.rc_conversationlist_fragment, container, false);
|
||||
}
|
||||
|
||||
@@ -54,12 +46,10 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
mConversationListViewModel.getConversationListLiveData().observe(this.getViewLifecycleOwner(), new Observer<List<BaseUiConversation>>() {
|
||||
@Override
|
||||
public void onChanged(List<BaseUiConversation> uiConversations) {
|
||||
int hashCode = uiConversations.hashCode();
|
||||
if (listHashCode != hashCode) {
|
||||
listHashCode = hashCode;
|
||||
if (listHashCode != uiConversations.hashCode()) {
|
||||
listHashCode = uiConversations.hashCode();
|
||||
((MainConversationListAdapter) mAdapter).onFinish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mConversationListViewModel.getRefreshEventLiveData().observe(this.getViewLifecycleOwner(), new Observer<Event.RefreshEvent>() {
|
||||
@@ -68,6 +58,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
listHashCode = 0;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setEmptyView(int viewLayoutMsgId) {
|
||||
@@ -79,16 +70,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
}
|
||||
|
||||
|
||||
public void refreshData() {
|
||||
mRefreshLayout.autoRefresh();
|
||||
//onConversationListRefresh(mRefreshLayout)
|
||||
}
|
||||
|
||||
public void search(String search) {
|
||||
if (TextUtils.isEmpty(search)){
|
||||
mRefreshLayout.autoRefresh();
|
||||
return;
|
||||
}
|
||||
((MainConversationListAdapter) mAdapter).setSearch();
|
||||
getContactsList(search);
|
||||
}
|
||||
@@ -102,11 +84,10 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
List<String> uidList = new ArrayList<>();
|
||||
|
||||
BaseUiConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setMessage(new Message());
|
||||
conversation.mCore.setObjectName("SEARCH_TITLE" + WordUtil.getNewString(R.string.activity_msg_list_title_contacts));
|
||||
Log.i("聊天数据源设置数据", "聊天数据源: " + conversation.mCore.getObjectName());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
list.add(conversation);
|
||||
|
||||
List<BaseUiConversation> data = new ArrayList<>();
|
||||
System.err.println(" ----------------------->" + mAdapter.getData().size());
|
||||
for (BaseUiConversation cn : ((MainConversationListAdapter) mAdapter).getSrcList()) {
|
||||
@@ -145,9 +126,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
@Override
|
||||
public void onSuccess(List<SearchConversationResult> searchConversationResults) {
|
||||
BaseUiConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setMessage(new Message());
|
||||
conversation.mCore.setObjectName("SEARCH_TITLE" + WordUtil.getNewString(R.string.activity_msg_list_title_chat_records));
|
||||
Log.i("聊天数据源设置数据", "聊天数据源: " + conversation.mCore.getObjectName());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
list.add(conversation);
|
||||
List<BaseUiConversation> data = new ArrayList<>();
|
||||
@@ -165,10 +144,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
list.remove(list.size() - 1);
|
||||
}
|
||||
list.addAll(data);
|
||||
for (BaseUiConversation cn : list){
|
||||
Log.i("聊天数据源搜索前的", cn.mCore.getConversationTitle() + "|" + cn.mCore.getPortraitUrl() + "|" + cn.mCore.getTargetId());
|
||||
}
|
||||
((MainConversationListAdapter) mAdapter).setDataCollectionV2(list,true);
|
||||
mAdapter.setDataCollection(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -180,19 +156,17 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
}
|
||||
|
||||
public void onChatList() {
|
||||
if (mConversationListViewModel == null) return;
|
||||
if(mConversationListViewModel==null)return;
|
||||
((MainConversationListAdapter) mAdapter).setChat();
|
||||
((MainConversationListAdapter) mAdapter).clear();
|
||||
System.out.println(">!>!>!>!!>" + mConversationListViewModel);
|
||||
System.out.println(">!>!>!>!!>"+mConversationListViewModel);
|
||||
subscribeUi();
|
||||
mRefreshLayout.autoRefresh();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConversationListAdapter onResolveAdapter() {
|
||||
MainConversationListAdapter adapter = new MainConversationListAdapter(getContext());
|
||||
// adapter.setFilter(chatViewModel.getChatFilter());
|
||||
this.mAdapter = adapter;
|
||||
this.mAdapter = new MainConversationListAdapter(getContext());
|
||||
return this.mAdapter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.yunbao.common.fragment;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -13,7 +12,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
@@ -25,7 +23,6 @@ import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ChatMsgTypeUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
@@ -42,7 +39,6 @@ import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
import io.rong.message.VoiceMessage;
|
||||
|
||||
public class MainMessageChatListFragment extends AbsMainMessageChatListFragment {
|
||||
private static final String TAG = "MainMessageChatListFragment";
|
||||
@@ -50,7 +46,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
public MainMessageChatListFragment(Context mContext) {
|
||||
this.mContext =mContext;
|
||||
}
|
||||
ChatViewModel chatViewModel;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
@@ -63,10 +59,8 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
chatViewModel = (new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
conversationListFragment = new MainMessageChatFragment();
|
||||
setAdapter(conversationListFragment.getAdapter());
|
||||
mAdapter.setFilter(chatViewModel.getChatFilter());
|
||||
FragmentManager manager = getChildFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationListFragment);
|
||||
@@ -78,9 +72,6 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
@Override
|
||||
public void onFinish(List<BaseUiConversation> baseUiConversations) {
|
||||
InstructorRemarkManager.get(mContext).getNetInstructorRemark();
|
||||
for (int i = 0; i <baseUiConversations.size(); i++) {
|
||||
baseUiConversations.get(i).mCore.getMessage();
|
||||
}
|
||||
loadLiveLookTime(baseUiConversations, new OnRecyclerListRefreshListener<Map<String, Integer>>() {
|
||||
@Override
|
||||
public void onFinish(Map<String, Integer> stringIntegerMap) {
|
||||
@@ -107,7 +98,6 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
uids.add(conversation.mCore.getTargetId());
|
||||
}
|
||||
}
|
||||
Log.i("更新的用户数据信息", "getUserInfo");
|
||||
getUserInfo(uids);
|
||||
}
|
||||
});
|
||||
@@ -131,7 +121,9 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
baseUiConversation.mCore.setPortraitUrl(datum.getAvatar());
|
||||
String remark = InstructorRemarkManager.get(getContext()).getInstructorRemark().get(datum.getId());
|
||||
baseUiConversation.mCore.setConversationTitle(StringUtil.isEmpty(remark) ? datum.getUserNiceName() : remark);
|
||||
|
||||
list.add(baseUiConversation);
|
||||
|
||||
UserInfo userInfo = new UserInfo(baseUiConversation.mCore.getTargetId(),
|
||||
baseUiConversation.mCore.getConversationTitle(),
|
||||
Uri.parse(baseUiConversation.mCore.getPortraitUrl()));
|
||||
@@ -152,9 +144,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
}
|
||||
mAdapter.setDataCollection(srcList);
|
||||
//mAdapter.onFinish();
|
||||
if ( recyclerView!=null && mAdapter.getSrcList().size()>position){
|
||||
recyclerView.scrollToPosition(position);
|
||||
}
|
||||
recyclerView.scrollToPosition(position);
|
||||
}
|
||||
onRefreshFinished();
|
||||
onLoadMoreFinished();
|
||||
@@ -169,16 +159,6 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
|
||||
}
|
||||
|
||||
public int getFilter() {
|
||||
return mAdapter.getFilter();
|
||||
}
|
||||
|
||||
public void setFilter(int mFilter) {
|
||||
mAdapter.setFilter(mFilter);
|
||||
chatViewModel.setChatFilter(mFilter);
|
||||
conversationListFragment.refreshData();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -281,12 +280,13 @@ public class ImgLoader {
|
||||
if (width != -1 && height != -1) {
|
||||
builder = builder.override(width, height);
|
||||
}
|
||||
builder.skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
||||
builder.thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
||||
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
if (callback != null) {
|
||||
callback.onLoadSuccess(resource);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CommonHttpConsts {
|
||||
public static final String DOWNLOAD_GIF = "downloadGif";
|
||||
public static final String GET_BALANCE = "getBalance";
|
||||
public static final String CHECK_TOKEN_INVALID = "checkTokenInvalid";
|
||||
public static final String NOTIFY_GOOGLE = "Charge.goole_validate_panduola";
|
||||
public static final String NOTIFY_GOOGLE = "Charge.google_pay";
|
||||
public static final String COMMUNITY_SETREPORT = "Community.setReport";
|
||||
|
||||
public static final String GET_USER_HOME = "getUserHome";
|
||||
|
||||
@@ -417,15 +417,18 @@ public class CommonHttpUtil {
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("productId", productId)
|
||||
.params("orderno", orderno)
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.params("package_name", "com.pandora.sy")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void notifyGoogle(String purchaseToken, String productId, HttpCallback callback) {
|
||||
public static void notifyGoogle(String purchaseToken, String orderNo, String tradeNo, String allData, String gps_adid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("productId", productId)
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("allData", allData)
|
||||
.params("gps_adid", gps_adid)
|
||||
.params("package_name", "com.pandora.sy")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -434,7 +437,7 @@ public class CommonHttpUtil {
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.params("package_name", "com.pandora.sy")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -720,16 +723,6 @@ public class CommonHttpUtil {
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
*获取聊天列表用户在线状态
|
||||
* @param callback
|
||||
*/
|
||||
public static void getLiveDataHistoryList(String stream,String page,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("live.getLiveGiftList", "live.getLiveGiftList")
|
||||
.params("stream",stream)
|
||||
.params("page",page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,28 +31,19 @@ public class LiveHttpUtil {
|
||||
HttpClient.getInstance().cancel(tag);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p,String is_noble,HttpCallback callback) {
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getUserLists", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("liveuid", liveuid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
.params("p", p)
|
||||
.params("is_noble", is_noble)
|
||||
.params("version", "" + VersionUtil.getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
getUserList(liveuid,stream,type,p,"0",callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播用户日榜/周榜
|
||||
*
|
||||
@@ -552,13 +543,6 @@ public class LiveHttpUtil {
|
||||
HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版) -用于获取联系方式时的礼物设置
|
||||
*/
|
||||
public static void getHotGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Gift.getHotGiftList", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取包裹列表
|
||||
@@ -611,7 +595,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -620,22 +604,12 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("type", type)
|
||||
.params("liveuid", liveuid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTaskNew(String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
.params("liveuid", liveuid)
|
||||
.params("token", true)
|
||||
.params("uid", true)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改心愿单列表
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,105 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.*;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CareerBean;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.FansCheckRed;
|
||||
import com.yunbao.common.bean.FansGroupGiftPack;
|
||||
import com.yunbao.common.bean.FansGroupGiftPackInfo;
|
||||
import com.yunbao.common.bean.FirstLoginBean;
|
||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MainMessageChatListTimer;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.MessageChatIsAnchor;
|
||||
import com.yunbao.common.bean.MessageChatUserBean;
|
||||
import com.yunbao.common.bean.MessageHiBean;
|
||||
import com.yunbao.common.bean.MessageSayHiBean;
|
||||
import com.yunbao.common.bean.MessageSayHiStartBean;
|
||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftResultBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.PrankProgressBean;
|
||||
import com.yunbao.common.bean.QiniuLog;
|
||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
import com.yunbao.common.bean.RedPacketGiftModel;
|
||||
import com.yunbao.common.bean.RedPacketInfoModel;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.ShareBean;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
import com.yunbao.common.bean.SwTokenModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
|
||||
import java.util.List;
|
||||
@@ -40,7 +138,6 @@ public interface PDLiveApi {
|
||||
@Field("user_pass") String passWord,
|
||||
@Field("uuid_Device") String uuidDevice,
|
||||
@Field("pushid") String pushid,
|
||||
@Field("app_from") String PDL,
|
||||
@Field("lastlogindevice") String lastlogindevice,
|
||||
@Field("langue") String langue
|
||||
);
|
||||
@@ -215,15 +312,6 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Live.getHourChartRank")
|
||||
Observable<ResponseModel<List<HourRank>>> getHourChartRank(@Query("liveuid") String liveuid);
|
||||
|
||||
|
||||
/**
|
||||
* 小时榜接口
|
||||
*
|
||||
* @param liveuid 直播间id
|
||||
*/
|
||||
@GET("/api/public/?service=Tasknew.sendFreeGift")
|
||||
Observable<ResponseModel<List<BaseModel>>> sendFreeGift(@Query("liveuid") String liveuid);
|
||||
|
||||
/**
|
||||
* 清除系统消息的未读数
|
||||
*/
|
||||
@@ -255,7 +343,7 @@ public interface PDLiveApi {
|
||||
* 【新人特惠】【趣味游戏】【幸运天使】
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveRoomActivtyBanner")
|
||||
Observable<ResponseModel<List<LiveRoomActivityBanner>>> getLiveRoomActivityBanner(@Query("langue") String language,@Query("version") String version);
|
||||
Observable<ResponseModel<List<LiveRoomActivityBanner>>> getLiveRoomActivityBanner();
|
||||
|
||||
/**
|
||||
* 新侧边栏请求
|
||||
@@ -272,7 +360,7 @@ public interface PDLiveApi {
|
||||
/**
|
||||
* PK排位赛接口
|
||||
*/
|
||||
@GET("/api/public/?service=Ranking.getAnchorRankData&app_from=PDL")
|
||||
@GET("/api/public/?service=Ranking.getAnchorRankData")
|
||||
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId, @Query("anchor_id2") String pkUid);
|
||||
|
||||
/**
|
||||
@@ -566,8 +654,7 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveStatisticalData")
|
||||
Observable<ResponseModel<LiveDataInfoModel>> getLiveDataInfo(
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("stream") String stream
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -597,7 +684,6 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<String>> setLivePreviewInfo(
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("isShow") int isShow,
|
||||
@Query("title") String title ,
|
||||
@Query("content") String content,
|
||||
@Query("styleImage") String styleImage
|
||||
);
|
||||
@@ -1209,7 +1295,7 @@ public interface PDLiveApi {
|
||||
@Query("open_off") int status
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Pdlmsg.sendBefore&new_pop=1")
|
||||
@GET("/api/public/?service=Pdlmsg.sendBefore")
|
||||
Observable<ResponseModel<MessageSayHiBean>> getMessageSayHiTimer(
|
||||
);
|
||||
|
||||
@@ -1403,10 +1489,4 @@ public interface PDLiveApi {
|
||||
@Query("live_uid")String liveUid
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取開播提示
|
||||
*/
|
||||
@GET("/api/public/?service=live.getStartTips")
|
||||
Observable<ResponseModel<List<LiveOpenTipsBean>>> getLiveDataInfo();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.yunbao.common.http.live;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -56,7 +54,6 @@ import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveOpenTipsBean;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
@@ -350,17 +347,8 @@ public class LiveNetManager {
|
||||
* 获取 【新人特惠】【趣味游戏】【幸运天使】
|
||||
*/
|
||||
public void getLiveRoomActivityBanner(HttpCallback<List<LiveRoomActivityBanner>> callback) {
|
||||
//获取版本名称
|
||||
String versionName = "";
|
||||
try {
|
||||
PackageManager manager = mContext.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(mContext.getPackageName(), 0);
|
||||
versionName = info.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveRoomActivityBanner( WordUtil.isNewZh()?"chinese":"english",versionName)
|
||||
.getLiveRoomActivityBanner()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -1227,9 +1215,9 @@ public class LiveNetManager {
|
||||
/**
|
||||
* 获取直播数据
|
||||
*/
|
||||
public void getLiveData(String liveUid,String stream, HttpCallback<LiveDataInfoModel> callback) {
|
||||
public void getLiveData(String liveUid, HttpCallback<LiveDataInfoModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveDataInfo(liveUid,stream)
|
||||
.getLiveDataInfo(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -1286,11 +1274,10 @@ public class LiveNetManager {
|
||||
*/
|
||||
public void setLivePreviewInfo(String liveUid,
|
||||
int isShow,
|
||||
String title,
|
||||
String content,
|
||||
String styleImage, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setLivePreviewInfo(liveUid, isShow,title, content, styleImage)
|
||||
.setLivePreviewInfo(liveUid, isShow, content, styleImage)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -4256,6 +4243,7 @@ public class LiveNetManager {
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
}
|
||||
|
||||
|
||||
public void getSwToken( HttpCallback<SwTokenModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getSwToken()
|
||||
@@ -4277,29 +4265,7 @@ public class LiveNetManager {
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开播提示信息
|
||||
*/
|
||||
public void getLiveOpenTips(HttpCallback<List<LiveOpenTipsBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveDataInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,7 +55,7 @@ public class MainNetManager {
|
||||
* @param callback 网络请求回调
|
||||
*/
|
||||
public void login(String phoneNum, String pwd, String uuid, HttpCallback<IMLoginModel> callback) {
|
||||
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "PDL","Android", WordUtil.isNewZh()?"chinese":"english")
|
||||
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android", WordUtil.isNewZh()?"chinese":"english")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||
|
||||
@@ -40,24 +40,6 @@ public class GiftQuantityManager extends BaseCacheManager {
|
||||
return giftQuantityModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指导员备注信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<GiftQuantityModel> getGiftQuantityNew() {
|
||||
List<GiftQuantityModel> giftQuantityModels = getList(KEY_GIFT_QUANTITY, new TypeToken<List<GiftQuantityModel>>() {}.getType());
|
||||
if (giftQuantityModels == null || giftQuantityModels.size() == 0) {
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("9999").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("3344").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("1314").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("520").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("50").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("10").setFontColour("#ffffff"));
|
||||
}
|
||||
return giftQuantityModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
|
||||
@@ -536,7 +536,6 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
.params("uid", uid)
|
||||
.params("token", token)
|
||||
.params("key1", RongcloudIMManager.RONG_IM_KEY)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
@@ -123,7 +123,6 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void run() {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
if(userInfo==null)return;
|
||||
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.params("token", userInfo.getToken(), true)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.yunbao.common.manager.imrongcloud;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
|
||||
public class PDRongUserInfoManager {
|
||||
public static void saveUserInfo(UserInfo userInfo) {
|
||||
RongUserInfoManager instance = RongUserInfoManager.getInstance();
|
||||
try {
|
||||
Method method = instance.getClass().getDeclaredMethod("saveUserInfoCache", userInfo.getClass());
|
||||
method.setAccessible(true);
|
||||
method.invoke(instance, userInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class RongcloudIMManager {
|
||||
if (CommonAppConfig.HOST.contains("ceshi")) {
|
||||
RONG_IM_KEY = "pvxdm17jpd3hr"; //测试服key
|
||||
} else {
|
||||
RONG_IM_KEY = "6tnym1br6lhu7"; //正式服key //上一个Key值uwd1c0sxu1p71
|
||||
RONG_IM_KEY = "uwd1c0sxu1p71"; //正式服key
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,297 +0,0 @@
|
||||
package com.yunbao.common.pay.google;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.android.billingclient.api.BillingClientStateListener;
|
||||
import com.android.billingclient.api.BillingFlowParams;
|
||||
import com.android.billingclient.api.BillingResult;
|
||||
import com.android.billingclient.api.ConsumeParams;
|
||||
import com.android.billingclient.api.ProductDetails;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.PurchasesUpdatedListener;
|
||||
import com.android.billingclient.api.QueryProductDetailsParams;
|
||||
import com.android.billingclient.api.QueryPurchasesParams;
|
||||
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
//谷歌支付
|
||||
public class GooglePlay implements PurchasesUpdatedListener {
|
||||
|
||||
private String TAG = "mLog";
|
||||
private BillingClient billingClient;
|
||||
private GoogleBillingListener billingListener;
|
||||
|
||||
private GooglePlay() {
|
||||
init();
|
||||
}
|
||||
|
||||
private boolean init() {
|
||||
if (getGoogleService() && billingClient == null) {
|
||||
billingClient = BillingClient.newBuilder(CommonAppContext.sInstance)
|
||||
.setListener(this)
|
||||
.enablePendingPurchases()
|
||||
.build();
|
||||
startConnection();
|
||||
return true;
|
||||
}
|
||||
if (billingClient != null && !billingClient.isReady()) {//没有连接的话去连接
|
||||
startConnection();
|
||||
}
|
||||
if (billingClient == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void startConnection() {
|
||||
if (!billingClient.isReady()) {
|
||||
//请求连接到GooglePay
|
||||
billingClient.startConnection(new BillingClientStateListener() {
|
||||
@Override
|
||||
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "连接到GooglePay失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "连接到GooglePay成功");
|
||||
}
|
||||
|
||||
//连接失败
|
||||
@Override
|
||||
public void onBillingServiceDisconnected() {
|
||||
Log.e(TAG, "连接到GooglePay失败,请重试");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//点击商品,先查询商品 然后出来支付界面,调用下单
|
||||
public void purchase(Activity activity, String orderNumber, String id) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
ImmutableList<QueryProductDetailsParams.Product> productList = ImmutableList.of(QueryProductDetailsParams.Product.newBuilder()
|
||||
.setProductId(id)
|
||||
.setProductType(BillingClient.ProductType.INAPP)
|
||||
.build());
|
||||
QueryProductDetailsParams queryProductDetailsParams =
|
||||
QueryProductDetailsParams.newBuilder()
|
||||
.setProductList(productList)
|
||||
.build();
|
||||
billingClient.queryProductDetailsAsync(
|
||||
queryProductDetailsParams,
|
||||
(billingResult, list) -> {
|
||||
//查询商品成功
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK || list == null || list.isEmpty()) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "查询商品失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "查询商品成功");
|
||||
buyIt(activity, orderNumber, list.get(0));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//开始下单,准备生成订单了
|
||||
private void buyIt(Activity activity, String orderNumber, ProductDetails productDetails) {
|
||||
List<BillingFlowParams.ProductDetailsParams> productDetailsParamsList = new ArrayList<>();
|
||||
productDetailsParamsList.add(BillingFlowParams.ProductDetailsParams.newBuilder()
|
||||
// retrieve a value for "productDetails" by calling queryProductDetailsAsync()
|
||||
.setProductDetails(productDetails)
|
||||
// For one-time products, "setOfferToken" method shouldn't be called.
|
||||
// For subscriptions, to get an offer token, call
|
||||
// ProductDetails.subscriptionOfferDetails() for a list of offers
|
||||
// that are available to the user.
|
||||
//一次性商品不需要传token
|
||||
// .setOfferToken(selectedOfferToken)
|
||||
.build());
|
||||
|
||||
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
|
||||
.setProductDetailsParamsList(productDetailsParamsList)
|
||||
.setObfuscatedAccountId(orderNumber)//好像是账号id
|
||||
.build();
|
||||
|
||||
BillingResult billingResult = billingClient.launchBillingFlow(activity, billingFlowParams);
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "购买商品失败 code = " + code + " msg = " + msg);
|
||||
// ToastUtil.show(getString(R.string.pay_suc));
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "购买商品 " + productDetails.toString());
|
||||
}
|
||||
|
||||
//消耗商品 支付成功之后,调用我们后台下发商品成功之后,调用消耗
|
||||
public void consume(List<Purchase> list) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
for (Purchase purchase : list) {
|
||||
getConsumeGoods(purchase);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗所有商品
|
||||
*/
|
||||
public void consumeAll() {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
//以下示例展示了如何提取用户的订阅购买交易。请注意,queryPurchasesAsync() 仅返回有效订阅和非消耗型一次性购买交易。
|
||||
QueryPurchasesParams inAppPurchasesQuery = QueryPurchasesParams.newBuilder().setProductType(BillingClient.ProductType.INAPP).build();
|
||||
billingClient.queryPurchasesAsync(inAppPurchasesQuery, (billingResult, list) -> {
|
||||
if (BillingClient.BillingResponseCode.OK == billingResult.getResponseCode()) {
|
||||
for (Purchase purchase : list) {
|
||||
//0:PurchaseState.UNSPECIFIED_STATE:未知状态
|
||||
//1:PurchaseState.PURCHASED:付款完成
|
||||
//2:PurchaseState.PENDING:购买正在等待付款完成。
|
||||
if (Purchase.PurchaseState.PURCHASED == purchase.getPurchaseState()) {
|
||||
//调用google去消费
|
||||
//如果之后还出现谷歌掉单的行为在来处理
|
||||
CommonHttpUtil.notifyGoogle(purchase.getPurchaseToken(),
|
||||
purchase.getProducts().get(0), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
getConsumeGoods(purchase);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共消费商品接口
|
||||
*/
|
||||
private void getConsumeGoods(Purchase purchase) {
|
||||
if (purchase != null) {
|
||||
Log.i(TAG, "-----开始消耗商品:" + purchase.toString());
|
||||
ConsumeParams.Builder consumeParams = ConsumeParams.newBuilder();
|
||||
consumeParams.setPurchaseToken(purchase.getPurchaseToken());
|
||||
//调用消耗商品方法
|
||||
consumeAsync(consumeParams.build(), purchase);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗商品
|
||||
* int SERVICE_TIMEOUT = -3; //服务超时
|
||||
* int FEATURE_NOT_SUPPORTED = -2; //不支持功能
|
||||
* int SERVICE_DISCONNECTED = -1; //服务单元已断开
|
||||
* int OK = 0; //成功
|
||||
* int USER_CANCELED = 1; //用户按上一步或取消对话框
|
||||
* int SERVICE_UNAVAILABLE = 2; //网络连接断开
|
||||
* int BILLING_UNAVAILABLE = 3; //所请求的类型不支持 Google Play 结算服务 AIDL 版本
|
||||
* int ITEM_UNAVAILABLE = 4; //请求的商品已不再出售。
|
||||
* int DEVELOPER_ERROR = 5; //提供给 API 的参数无效。此错误也可能说明应用未针对结算服务正确签名或设置,或者在其清单中缺少必要的权限。
|
||||
* int ERROR = 6; //API 操作期间出现严重错误
|
||||
* int ITEM_ALREADY_OWNED = 7; //未能购买,因为已经拥有此商品
|
||||
* int ITEM_NOT_OWNED = 8; //未能消费,因为尚未拥有此商品
|
||||
*/
|
||||
private void consumeAsync(ConsumeParams consumeParams, Purchase purchase) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
billingClient.consumeAsync(consumeParams, (billingResult, purchaseToken) -> {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
||||
Log.i(TAG, "-----消耗商品成功");
|
||||
} else {
|
||||
Log.i(TAG, "-----消耗商品失败" + billingResult.toString() + "---" + purchaseToken + "--code:" + billingResult.getResponseCode());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
|
||||
&& purchases != null) {
|
||||
//支付成功
|
||||
if (billingListener != null)//消耗掉商品放到外面调用我们服务器成功的时候去消耗 todo 暂时注释掉 这样可以模拟掉单的问题
|
||||
billingListener.onPaySuccess(purchases);
|
||||
/*
|
||||
* 一旦您验证了购买交易,您的应用就可以向用户授予使用权了。若要确认与购买交易相关联的用户账号,
|
||||
* 您可以使用 Purchases.products:get 返回的 ProductPurchase.obfuscatedExternalAccountId(适用于应用内商品的购买交易)
|
||||
* 和 Purchases.subscriptions:get 返回的 SubscriptionPurchase.obfuscatedExternalAccountId(适用于服务器端的订阅),
|
||||
* 或者 Purchase.getAccountIdentifiers() 在客户端返回的 obfuscatedAccountId(如果在交易时已使用 setObfuscatedAccountId 设置该 ID)。
|
||||
* */
|
||||
// purchases.get(0).getAccountIdentifiers()
|
||||
for (Purchase purchase : purchases) {
|
||||
Log.d("mLog", "谷歌支付的回调 " + purchase);
|
||||
}
|
||||
} else if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED) {
|
||||
//取消支付了
|
||||
if (billingListener != null)
|
||||
billingListener.onPayFailed(CommonAppContext.sInstance.getString(R.string.pay_cancel));
|
||||
} else {
|
||||
//支付失败
|
||||
if (billingListener != null)
|
||||
billingListener.onPayFailed(CommonAppContext.sInstance.getString(R.string.pay_fail));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测GooglePlay服务是否可用(需要导入包api "com.google.android.gms:play-services-location:11.8.0",也可以不检查,跳过这个代码)
|
||||
*/
|
||||
public boolean getGoogleService() {
|
||||
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
|
||||
if (googleApiAvailability != null) {
|
||||
int resultCode = googleApiAvailability.isGooglePlayServicesAvailable(CommonAppContext.sInstance);
|
||||
return resultCode == ConnectionResult.SUCCESS;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getAdId() {
|
||||
try {
|
||||
return AdvertisingIdClient.getAdvertisingIdInfo(CommonAppContext.sInstance).getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("GooglePlay", "获取谷歌的id错误了");
|
||||
}
|
||||
return "google_default_id";
|
||||
}
|
||||
|
||||
public void setBillingListener(GoogleBillingListener listener) {
|
||||
billingListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义接口返回支付结果
|
||||
*/
|
||||
public interface GoogleBillingListener {
|
||||
void onPaySuccess(List<Purchase> purchases);
|
||||
|
||||
void onPayFailed(String msg);
|
||||
}
|
||||
|
||||
public static class GooglePlayHelper {
|
||||
static GooglePlay googlePlay = new GooglePlay();
|
||||
}
|
||||
|
||||
public static GooglePlay getInstance() {
|
||||
return GooglePlayHelper.googlePlay;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import android.util.Log;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.sud.decorator.game.JumpEvent;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||
@@ -373,8 +372,6 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onGameMGCommonGameCreateOrder(handle, mgCommonGameCreateOrder);
|
||||
}
|
||||
// 调用创建订单接口
|
||||
JumpEvent.hit(mgCommonGameCreateOrder);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_PLAYER_ROLE_ID: // 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
||||
SudMGPMGState.MGCommonPlayerRoleId mgCommonPlayerRoleId = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonPlayerRoleId.class);
|
||||
|
||||
@@ -144,7 +144,7 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
if (isLog) {
|
||||
CommonHttpUtil.getUploadQiNiuTokenLog(mGetUploadTokenCallback, list.get(0).getOriginFile().getName());
|
||||
} else {
|
||||
CommonHttpUtil.getUploadQiNiuTokenNew(mGetUploadTokenCallback, isImg);
|
||||
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,14 @@ public class AppManager {
|
||||
activityStack.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅在debug下运行的代码
|
||||
*/
|
||||
public static void runDebugCode(Runnable runnable) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
/**
|
||||
* 消息类型翻译管理器
|
||||
*/
|
||||
public class ChatMsgTypeUtils {
|
||||
public static String getMsg(String msg) {
|
||||
String rsult = msg;
|
||||
switch (msg) {
|
||||
case "[小视频]":
|
||||
rsult = WordUtil.isNewZh() ? "[小視頻]" : "[Video]";
|
||||
break;
|
||||
case "[语音]":
|
||||
rsult = WordUtil.isNewZh() ? "[語音]" : "[Voice]";
|
||||
break;
|
||||
case "[图片]":
|
||||
rsult = WordUtil.isNewZh() ? "[圖片]" : "[Image]";
|
||||
break;
|
||||
}
|
||||
return rsult;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import android.text.TextUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.utils.language.LangUtils;
|
||||
@@ -44,45 +43,6 @@ public class DateFormatUtil {
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static String getTimeLiveEndString(long time) {
|
||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); // 设置日期格式
|
||||
String formattedDate = sdf.format(date); // 格式化日期字符串
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static String getDiffInMilliseconds(String time1, String time2, String day, String hour, String minute) {
|
||||
return getTime(Long.parseLong(time1), Long.parseLong(time2), day, hour, minute);
|
||||
}
|
||||
|
||||
|
||||
//根据时间计算出 分钟,小时,天
|
||||
private static String getTime(Long startTime, Long endTime, String day, String hour, String minute) {
|
||||
if (startTime == null || endTime == null || startTime >= endTime) {
|
||||
return "Invalid time range";
|
||||
}
|
||||
|
||||
long diff = endTime - startTime;
|
||||
long days = TimeUnit.MILLISECONDS.toDays(diff);
|
||||
long hours = TimeUnit.MILLISECONDS.toHours(diff) - (days * 24);
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff) - (TimeUnit.MILLISECONDS.toHours(diff) * 60);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (days > 0) {
|
||||
stringBuilder.append(days).append(day).append(" ");
|
||||
}
|
||||
if (hours > 0) {
|
||||
stringBuilder.append(hours).append(hour).append(" ");
|
||||
}
|
||||
if (minutes > 0) {
|
||||
stringBuilder.append(minutes).append(minute);
|
||||
}else {
|
||||
stringBuilder.append("0"+minute);
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
public static String getTimeStrings(long time) {
|
||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
|
||||
@@ -145,7 +105,7 @@ public class DateFormatUtil {
|
||||
formatDate = formatDate(date, "yyyy/M/d");
|
||||
|
||||
if (showTime) {
|
||||
formatDate = formatDate;//+ " " + getTimeString(dateMillis, context);
|
||||
formatDate = formatDate ;//+ " " + getTimeString(dateMillis, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.BuildConfig;
|
||||
|
||||
public class DebugUtils {
|
||||
/**
|
||||
* 打印堆栈信息
|
||||
*/
|
||||
public static void showStackTrace(){
|
||||
StackTraceElement[] stackTrace = new Throwable().getStackTrace();
|
||||
StringBuilder sb=new StringBuilder();
|
||||
for (StackTraceElement element : stackTrace) {
|
||||
if(element!=null){
|
||||
sb.append(element).append("\n");
|
||||
}
|
||||
}
|
||||
Log.e("DebugUtils",sb.toString());
|
||||
}
|
||||
/**
|
||||
* 仅在debug下运行的代码
|
||||
*/
|
||||
public static void runDebugCode(Runnable runnable) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -168,15 +168,6 @@ public class DialogUitl {
|
||||
showSimpleDialog(context, content, false, callback);
|
||||
}
|
||||
|
||||
public static void showSimpleDialogString(Context context, String content,String confirmString, SimpleCallback callback) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
new Builder(context).setTitle(null).setContent(content).setCancelable(false).setClickCallback(callback).setConfirmString(confirmString).build().show();
|
||||
}
|
||||
|
||||
public static void showSimpleDialog(Context context, String content, boolean cancelable, SimpleCallback callback) {
|
||||
showSimpleDialog(context, null, content, cancelable, callback);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -660,7 +659,6 @@ public class JavascriptInterfaceUtils {
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
|
||||
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
|
||||
.params("key1", RongcloudIMManager.RONG_IM_KEY)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
public class NavigationBarUtils {
|
||||
|
||||
public static boolean hasNavigationBar(Activity activity) {
|
||||
boolean hasNavigationBar = false;
|
||||
int resourceId = activity.getResources().getIdentifier("config_showNavigationBar", "bool", "android");
|
||||
if (resourceId > 0) {
|
||||
hasNavigationBar = activity.getResources().getBoolean(resourceId);
|
||||
}
|
||||
|
||||
try {
|
||||
hasNavigationBar |= (Boolean) ViewConfiguration.class.getDeclaredMethod("hasNavigationBar").invoke(ViewConfiguration.get(activity));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Fall back on checking the navigation bar height, if available
|
||||
if (!hasNavigationBar && hasNavBarHeight()) {
|
||||
hasNavigationBar = true;
|
||||
}
|
||||
|
||||
return hasNavigationBar;
|
||||
}
|
||||
|
||||
public static boolean hasNavBarHeight() {
|
||||
Resources res = Resources.getSystem();
|
||||
int resourceId = res.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
return res.getDimensionPixelSize(resourceId) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 示例:在Activity中使用该方法
|
||||
public static boolean checkNavigationBar(Activity activity) {
|
||||
return hasNavigationBar(activity);
|
||||
}
|
||||
|
||||
public static int checkBarHeight(Activity activity) {
|
||||
int result = 0;
|
||||
Resources resources = activity.getResources();
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = resources.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void setBarStatus(RelativeLayout rt_main_tab, Activity mContext){
|
||||
if("Xiaomi".equals(Build.BRAND)&&"2210132C".equals(Build.MODEL)){
|
||||
ViewGroup.LayoutParams params = rt_main_tab.getLayoutParams();
|
||||
params.height =params.height+ NavigationBarUtils.checkBarHeight(mContext);
|
||||
rt_main_tab.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,21 +3,13 @@ package com.yunbao.common.utils;
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.ImageDecoder;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.PickVisualMediaRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.yalantis.ucrop.util.FileUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@@ -47,7 +39,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
private ImageResultCallback mResultCallback;
|
||||
private boolean mNeedCrop;//是否需要裁剪
|
||||
private boolean mNeedGif;//允许gif图
|
||||
ActivityResultLauncher<PickVisualMediaRequest> launcher;
|
||||
|
||||
public void setNeedGif(boolean mNeedGif) {
|
||||
this.mNeedGif = mNeedGif;
|
||||
@@ -92,7 +83,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
if (mNeedCrop) {
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() +".fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pandora.sy.fileprovider", mCameraResult);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
}
|
||||
@@ -126,19 +117,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
return;
|
||||
}
|
||||
String path = FileUtils.getPath(mContext, intent.getData());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ImageDecoder.Source source = ImageDecoder.createSource(mContext.getContentResolver(), intent.getData());
|
||||
try {
|
||||
Bitmap bitmap = ImageDecoder.decodeBitmap(source);
|
||||
path=BitmapUtil.getInstance().saveBitmap(bitmap);
|
||||
bitmap.recycle();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
File file = new File(path);
|
||||
if (file.exists()) {
|
||||
mResultCallback.onSuccess(file);
|
||||
@@ -175,19 +153,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
}
|
||||
}
|
||||
};
|
||||
launcher = ((AppCompatActivity) mContext).registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new androidx.activity.result.ActivityResultCallback<Uri>() {
|
||||
@Override
|
||||
public void onActivityResult(Uri result) {
|
||||
LogUtils.e("result:" + result);
|
||||
if (result == null) {
|
||||
mAlumbResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setData(result);
|
||||
mAlumbResultCallback.onSuccess(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,28 +173,15 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
/**
|
||||
* 相册获取图片
|
||||
*/
|
||||
public void getImageByAlbum() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
public void getImageByAlumb() {
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
public void getImageByAlbum(boolean needCrop) {
|
||||
public void getImageByAlumb(boolean needCrop) {
|
||||
this.mNeedCrop = needCrop;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
private void showSystemPick() {
|
||||
PickVisualMediaRequest.Builder builder = new PickVisualMediaRequest.Builder()
|
||||
.setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE);
|
||||
launcher.launch(builder.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启摄像头,执行照相
|
||||
@@ -243,7 +195,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
mCameraResult = getNewFile();
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pandora.sy.fileprovider", mCameraResult);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
@@ -303,7 +255,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
startActivityForResult(intent, mCropResultCallback);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCorpResult);
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, "com.pandora.sy.fileprovider", mCorpResult);
|
||||
if (resultUri == null || mFragment == null || mContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,15 +66,6 @@ public class RouteUtil {
|
||||
public static final String PATH_SudSwGameActivity = "/live/SudSwGameActivity";
|
||||
public static final String PATH_SudRyGameActivity = "/live/SudRyGameActivity";
|
||||
|
||||
public static final String PATH_LiveROOMMANAGE = "/live/RoomManageActivity";
|
||||
|
||||
/**
|
||||
* 跳转到房间管理页面
|
||||
*/
|
||||
public static void forwardRoomManageActivity() {
|
||||
ARouter.getInstance().build(PATH_LiveROOMMANAGE)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardVideoPlayNewActivity(ActiveBean bean) {
|
||||
ARouter.getInstance().build(PATH_VIDEO_NEW_PLAY)
|
||||
|
||||
@@ -95,38 +95,13 @@ public class StringUtil {
|
||||
int minutes = (int) ((mms % (1000 * 60 * 60)) / (1000 * 60));
|
||||
int seconds = (int) ((mms % (1000 * 60)) / 1000);
|
||||
sStringBuilder.delete(0, sStringBuilder.length());
|
||||
if (hours < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(hours));
|
||||
sStringBuilder.append(":");
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) {
|
||||
if (hours > 0) {
|
||||
if (hours < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(minutes));
|
||||
sStringBuilder.append(String.valueOf(hours));
|
||||
sStringBuilder.append(":");
|
||||
} else {
|
||||
sStringBuilder.append("00:");
|
||||
}
|
||||
if (seconds > 0) {
|
||||
if (seconds < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(seconds));
|
||||
} else {
|
||||
sStringBuilder.append("00");
|
||||
}
|
||||
return sStringBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 把一个long类型的总毫秒数转成时长
|
||||
*/
|
||||
public static String getDurationText2(long mms) {
|
||||
int minutes = (int) ((mms % (1000 * 60 * 60)) / (1000 * 60));
|
||||
int seconds = (int) ((mms % (1000 * 60)) / 1000);
|
||||
sStringBuilder.delete(0, sStringBuilder.length());
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) {
|
||||
sStringBuilder.append("0");
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class UiConversationCodeUtil {
|
||||
|
||||
|
||||
public static final int FILTER_OFFLINE = 0;
|
||||
public static final int FILTER_ONLINE = 1;
|
||||
public static final int FILTER_UNREAD = 2;
|
||||
public static final int FILTER_READ = 4;
|
||||
public static final int FILTER_ALL = 7;
|
||||
|
||||
|
||||
public static boolean checkIsSame(List<BaseUiConversation> list1, List<BaseUiConversation> list2) {
|
||||
if (list1.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
if (list1.size() != list2.size()) return false;
|
||||
int hashCode1 = getListHasCode(list1);
|
||||
int hashCode2 = getListHasCode(list2);
|
||||
return hashCode1 == hashCode2;
|
||||
}
|
||||
|
||||
public static boolean checkIsSame(int hashCode1, List<BaseUiConversation> list2) {
|
||||
int hashCode2 = getListHasCode(list2);
|
||||
return hashCode1 == hashCode2;
|
||||
}
|
||||
|
||||
public static int getListHasCode(List<BaseUiConversation> list) {
|
||||
int hashCodeValue = 1;
|
||||
if (list == null || list.isEmpty())
|
||||
return 1;
|
||||
for (BaseUiConversation conversation : list) {
|
||||
if (conversation != null) {
|
||||
hashCodeValue = 31 * hashCodeValue + getBaseUiConversationHashCode(conversation);
|
||||
}
|
||||
}
|
||||
return hashCodeValue;
|
||||
}
|
||||
|
||||
|
||||
//根据BaseUiConversation对象的属性计算hashCode
|
||||
private static int getBaseUiConversationHashCode(BaseUiConversation item) {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
Conversation mCore = item.mCore;
|
||||
result = prime * result + ((mCore.getPortraitUrl() == null) ? 0 : mCore.getPortraitUrl().hashCode());
|
||||
result = prime * result + ((mCore.getConversationTitle() == null) ? 0 : mCore.getConversationTitle().hashCode());
|
||||
// result = prime * result + ((item.mConversationContent == null) ? 0 : item.mConversationContent.hashCode());
|
||||
result = prime * result + (int) (mCore.getSentTime() ^ (mCore.getSentTime() >>> 32));
|
||||
result = prime * result + ((mCore.getDraft() == null) ? 0 : mCore.getDraft().hashCode());
|
||||
result = prime * result + mCore.getUnreadMessageCount();
|
||||
|
||||
Message message = mCore.getMessage();
|
||||
if (message != null) {
|
||||
Message.MessageDirection direction = message.getMessageDirection();
|
||||
if (direction != null) {
|
||||
result = prime * result + direction.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
result = prime * result + ((mCore.getSentStatus() == null) ? 0 : mCore.getSentStatus().hashCode());
|
||||
result = prime * result + ((mCore.getReceivedStatus() == null) ? 0 : mCore.getReceivedStatus().hashCode());
|
||||
result = prime * result + ((mCore.getTargetId() == null) ? 0 : mCore.getTargetId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isContains(List<BaseUiConversation> list, BaseUiConversation item) {
|
||||
// 根据 item.mCore.getChannelId() 判断 list 是否包含
|
||||
if (list == null || list.isEmpty() || item == null || item.mCore == null) {
|
||||
return false;
|
||||
}
|
||||
for (BaseUiConversation conversation : list) {
|
||||
// 增加空值检查
|
||||
if (conversation != null && conversation.mCore != null
|
||||
&& conversation.mCore.getTargetId() != null
|
||||
&& conversation.mCore.getTargetId().equals(item.mCore.getTargetId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<BaseUiConversation> FilterData(int filterType, List<BaseUiConversation> keyList,List<BaseUiConversation> srcList) {
|
||||
List<BaseUiConversation> showData = new ArrayList<>();
|
||||
if (keyList == null || keyList.isEmpty())
|
||||
return showData;
|
||||
Log.i("MainConversationListAdapter", "FilterData: 源" + keyList.size());
|
||||
switch (filterType) {
|
||||
case FILTER_ALL:
|
||||
showData = keyList;
|
||||
break;
|
||||
case FILTER_ONLINE:
|
||||
for (BaseUiConversation conversation : srcList) {
|
||||
if ("0".equals(conversation.mCore.getDraft()) && isContains(keyList, conversation)) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_OFFLINE:
|
||||
for (BaseUiConversation conversation : keyList) {
|
||||
if (!"0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_READ:
|
||||
for (BaseUiConversation conversation : keyList)
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_UNREAD:
|
||||
for (BaseUiConversation conversation : keyList) {
|
||||
boolean isRead;
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() != Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
Log.i("MainConversationListAdapter", "FilterData: 结果" + showData.size());
|
||||
return showData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static List<BaseUiConversation> FilterData(int filterType, List<BaseUiConversation> data) {
|
||||
List<BaseUiConversation> showData = new ArrayList<>();
|
||||
if (data == null || data.isEmpty())
|
||||
return showData;
|
||||
Log.i("MainConversationListAdapter", "设置数据源 FilterData: 源" + data.size());
|
||||
switch (filterType) {
|
||||
case FILTER_ALL:
|
||||
showData = data;
|
||||
break;
|
||||
case FILTER_ONLINE:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if ("0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_OFFLINE:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if (!"0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_READ:
|
||||
for (BaseUiConversation conversation : data)
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_UNREAD:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() != Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
Log.i("MainConversationListAdapter", " 设置数据源 FilterData: 结果" + showData.size());
|
||||
return showData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.sy"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.sy"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
|
||||
@@ -35,9 +35,7 @@ public class WordUtil {
|
||||
|
||||
public static boolean isNewZh() {
|
||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINA;
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ;
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
|
||||
@@ -128,7 +128,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
public void onViewClicks() {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+mContext.getPackageName()));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.sy"));
|
||||
mContext.startActivity(i);
|
||||
mContext.finish();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
|
||||
@@ -26,13 +26,7 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
mTag = getClass().getSimpleName();
|
||||
mContext = context;
|
||||
mParentView = parentView;
|
||||
try {
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
}catch (Exception e){
|
||||
L.e("AbsViewHolder",e.toString());
|
||||
}
|
||||
if (mContentView == null)
|
||||
L.e("AbsViewHolder","mContentView==null");
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -41,13 +35,7 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
processArguments(args);
|
||||
mContext = context;
|
||||
mParentView = parentView;
|
||||
try {
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
}catch (Exception e){
|
||||
L.e("AbsViewHolder",e.toString());
|
||||
}
|
||||
if (mContentView == null)
|
||||
L.e("AbsViewHolder","mContentView==null");
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -55,6 +43,11 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
|
||||
}
|
||||
|
||||
public void onConfigureChange() {
|
||||
//如果 mParentView
|
||||
}
|
||||
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
public abstract void init();
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GiftNumberPopup extends BottomPopupView {
|
||||
super.onCreate();
|
||||
RecyclerView giftList = findViewById(R.id.gift_list);
|
||||
giftList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
GiftNumberAdapter giftNumberAdapter = new GiftNumberAdapter(new GiftQuantityManager(getContext()).getGiftQuantityNew());
|
||||
GiftNumberAdapter giftNumberAdapter = new GiftNumberAdapter(new GiftQuantityManager(getContext()).getGiftQuantity());
|
||||
giftList.setAdapter(giftNumberAdapter);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_can), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
|
||||
@@ -33,16 +33,11 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
private TextView titleSDText, titleHDText, titleFHDText, mTips;
|
||||
private int banSelect;
|
||||
private boolean isUser = false;
|
||||
private SelectPositionListener selectPositionListener;
|
||||
|
||||
public int getSelectClarity() {
|
||||
return selectClarity;
|
||||
}
|
||||
|
||||
public void setSelectPositionListener(SelectPositionListener selectPositionListener) {
|
||||
this.selectPositionListener = selectPositionListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param banSelect 禁止选项,{@link #BAN_720} 禁止高清和超高清。 {@link #BAN_1080} 禁止超高清
|
||||
* @param isUser 是否为观众,true 观众,false 主播
|
||||
@@ -232,13 +227,6 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
iconFhd.setVisibility(VISIBLE);
|
||||
break;
|
||||
}
|
||||
if(selectPositionListener!=null){
|
||||
selectPositionListener.onSelect(selectClarity);
|
||||
}
|
||||
}
|
||||
|
||||
public interface SelectPositionListener{
|
||||
void onSelect(int position);
|
||||
}
|
||||
|
||||
private Handler netHandler = new Handler();
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.yunbao.common.views;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -30,7 +28,6 @@ import com.yunbao.common.event.PopupViewDismissEvent;
|
||||
import com.yunbao.common.fragment.LiveNewWishListFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -64,12 +61,6 @@ public class LiveNewWishListPopup extends BottomPopupView {
|
||||
private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment;
|
||||
private ImageView wishListTop;
|
||||
|
||||
private CommonCallback<Boolean> mSetResultCallback ;
|
||||
|
||||
public void setResultCallback(CommonCallback<Boolean> mCommonCallback) {
|
||||
this.mSetResultCallback = mCommonCallback;
|
||||
}
|
||||
|
||||
public LiveNewWishListPopup(@NonNull FragmentActivity context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
@@ -207,10 +198,6 @@ public class LiveNewWishListPopup extends BottomPopupView {
|
||||
zhouXinFragment = LiveNewWishListFragment.newInstance(2);
|
||||
lunarWishFragment = LiveNewWishListFragment.newInstance(3);
|
||||
seasonalWishFragment = LiveNewWishListFragment.newInstance(4);
|
||||
dayWishFragment.setResultCallback(mSetResultCallback);
|
||||
zhouXinFragment.setResultCallback(mSetResultCallback);
|
||||
lunarWishFragment.setResultCallback(mSetResultCallback);
|
||||
seasonalWishFragment.setResultCallback(mSetResultCallback);
|
||||
ViewList.add(dayWishFragment);
|
||||
ViewList.add(zhouXinFragment);
|
||||
ViewList.add(lunarWishFragment);
|
||||
|
||||
@@ -5,14 +5,12 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
@@ -20,10 +18,7 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
//清晰度
|
||||
private int selectClarity;
|
||||
//直播类型
|
||||
@@ -31,12 +26,10 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
//房间类型
|
||||
private LiveRoomTypeBean liveRoomTypeBean;
|
||||
|
||||
private TextView textClarity, textLiveClass, textLiveWishlist, textRobot, textSay, textCall;
|
||||
private TextView textClarity, textLiveRoomType, textLiveClass, textLiveWishlist, textRobot, textSay, textCall;
|
||||
|
||||
private int status_say, status_call;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public LiveOpenCustomPopup setClassBean(LiveClassBean classBean) {
|
||||
this.classBean = classBean;
|
||||
textLiveClass.setText(classBean.getName());
|
||||
@@ -45,12 +38,17 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
|
||||
public LiveOpenCustomPopup setLiveRoomTypeBean(LiveRoomTypeBean liveRoomTypeBean) {
|
||||
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||
if (liveRoomTypeBean.getId()== Constants.LIVE_TYPE_PWD){
|
||||
textLiveRoomType.setText(WordUtil.isNewZh() ? "密碼房" : "password room");
|
||||
}else {
|
||||
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveOpenCustomPopup(@NonNull Context context, int selectClarity, LiveClassBean classBean, LiveRoomTypeBean liveRoomTypeBean) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
this.selectClarity = selectClarity;
|
||||
this.classBean = classBean;
|
||||
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||
@@ -72,6 +70,7 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
|
||||
private void initView() {
|
||||
textClarity = findViewById(R.id.text_clarity);
|
||||
textLiveRoomType = findViewById(R.id.text_live_room_type);
|
||||
textLiveClass = findViewById(R.id.text_live_class);
|
||||
textLiveWishlist = findViewById(R.id.text_live_wishlist);
|
||||
textRobot = findViewById(R.id.text_robot);
|
||||
@@ -80,6 +79,13 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
if (classBean != null) {
|
||||
textLiveClass.setText(classBean.getName());
|
||||
}
|
||||
if (liveRoomTypeBean != null) {
|
||||
if (liveRoomTypeBean.getId()== Constants.LIVE_TYPE_PWD){
|
||||
textLiveRoomType.setText(WordUtil.isNewZh() ? "密碼房" : "password room");
|
||||
}else {
|
||||
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||
}
|
||||
}
|
||||
setSelectClarity(selectClarity);
|
||||
//關閉彈窗
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), () -> dismiss());
|
||||
@@ -102,6 +108,12 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
callBack.selectClarity(selectClarity);
|
||||
}
|
||||
});
|
||||
//設置房間類型
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_room_type), () -> {
|
||||
if (callBack != null) {
|
||||
callBack.openLiveRoomType(liveRoomTypeBean);
|
||||
}
|
||||
});
|
||||
//打開心願單
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_wishlist), () -> {
|
||||
if (callBack != null) {
|
||||
@@ -170,7 +182,7 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
}
|
||||
|
||||
public void initDate() {
|
||||
textSay.setText(IMLoginManager.get(mContext).getAnchorSayStatus() == 1 ? R.string.do_set : R.string.not_set);
|
||||
textSay.setText(status_say == 1 ? R.string.do_set : R.string.not_set);
|
||||
textCall.setText(status_call == 1 ? R.string.robot_yes : R.string.robot_no);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()),
|
||||
@@ -178,7 +190,7 @@ public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
@Override
|
||||
public void onSuccess(LiveStetUpStatusModel data) {
|
||||
textLiveWishlist.setText(data.getWishListState() ? R.string.do_set : R.string.not_set);
|
||||
textRobot.setText(data.getAiStateState() ? R.string.robot_on : R.string.robot_off);
|
||||
textRobot.setText(data.getAiStateState() ? R.string.robot_yes : R.string.robot_no);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -8,8 +7,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -24,12 +21,6 @@ import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.MicUserManager;
|
||||
import com.yunbao.common.manager.MicedUserManager;
|
||||
import com.yunbao.common.manager.RandomPkManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@@ -41,11 +32,6 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
private String time = "";
|
||||
private ImageView robotState;
|
||||
|
||||
private ImageView languageZhImgView;
|
||||
private AppCompatTextView languageZhTv;
|
||||
private ImageView languageEnImgView;
|
||||
private AppCompatTextView languageEnTv;
|
||||
private int lastLanguage = 1;
|
||||
private int robotStateInt = 1;
|
||||
|
||||
public int getRobotStateInt() {
|
||||
@@ -74,22 +60,17 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||
robotNameText = findViewById(R.id.robot_name_text);
|
||||
robotState = findViewById(R.id.robot_state);
|
||||
languageZhImgView = findViewById(R.id.languageZhImgView);
|
||||
languageZhTv = findViewById(R.id.languageZhTv);
|
||||
languageEnImgView = findViewById(R.id.languageEnImgView);
|
||||
languageEnTv = findViewById(R.id.languageEnTv);
|
||||
automaticGreetingNumber = findViewById(R.id.automatic_greeting_number);
|
||||
automaticMessageNumber = findViewById(R.id.automatic_message_number);
|
||||
findViewById(R.id.automatic_message_sending).setOnClickListener(this);
|
||||
findViewById(R.id.automatic_greeting_setting).setOnClickListener(this);
|
||||
robotNameText.setOnClickListener(this);
|
||||
robotState.setOnClickListener(this);
|
||||
robotNameSetting.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
L.e("EditorInfo.IME_ACTION_DONE");
|
||||
// 修改助手名字
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {
|
||||
@@ -110,65 +91,8 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
languageZhImgView.setOnClickListener(v -> {
|
||||
if (lastLanguage == 0) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(0);
|
||||
});
|
||||
languageZhTv.setOnClickListener(v -> {
|
||||
if (lastLanguage == 0) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(0);
|
||||
});
|
||||
|
||||
languageEnImgView.setOnClickListener(v -> {
|
||||
if (lastLanguage == 1) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(1);
|
||||
});
|
||||
languageEnTv.setOnClickListener(v -> {
|
||||
if (lastLanguage == 1) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void ShowChangeLanguagePopup(int i) {
|
||||
DialogUitl.showSimpleDialogString(getContext(), getContext().getString(R.string.chang_langue_tips), getContext().getString(R.string.aristocrat_determine) ,new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_langue", i+"", new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (i==0) {
|
||||
languageZhImgView.setSelected(true);
|
||||
languageEnImgView.setSelected(false);
|
||||
lastLanguage = 0;
|
||||
} else {
|
||||
languageZhImgView.setSelected(false);
|
||||
languageEnImgView.setSelected(true);
|
||||
lastLanguage = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int viewID = v.getId();
|
||||
@@ -319,15 +243,6 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
robotNameText.setText(data.getName());
|
||||
automaticGreetingNumber.setText(String.valueOf(data.getAutoSeyHiNumber()));
|
||||
automaticMessageNumber.setText(String.valueOf(data.getAutoRequestFollowNumber()));
|
||||
if (data.isLangueCn()) {
|
||||
languageZhImgView.setSelected(true);
|
||||
languageEnImgView.setSelected(false);
|
||||
lastLanguage = 0;
|
||||
} else {
|
||||
languageZhImgView.setSelected(false);
|
||||
languageEnImgView.setSelected(true);
|
||||
lastLanguage = 1;
|
||||
}
|
||||
time = String.valueOf(data.getTime());
|
||||
robotStateInt = data.getStatus();
|
||||
if (data.getStatus() == 1) {
|
||||
@@ -337,7 +252,7 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import static io.rong.imlib.publicservice.model.PublicServiceMenu.PublicServiceMenuItemType.View;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.repackage.com.zui.opendeviceidlibrary.OpenDeviceId;
|
||||
|
||||
public class MsgChatTypeSelectPoPupView extends AttachPopupView implements android.view.View.OnClickListener {
|
||||
|
||||
private TextView chatTypeTv1, chatTypeTv2, chatTypeTv3, chatTypeTv4, chatTypeTv5;
|
||||
private ImageView chatTypeImg1, chatTypeImg2, chatTypeImg3, chatTypeImg4, chatTypeImg5;
|
||||
|
||||
private ResultCallBack mResultCallBack;
|
||||
private int lastType;
|
||||
|
||||
public MsgChatTypeSelectPoPupView(@NonNull Context context, int type, ResultCallBack itemDelListener) {
|
||||
super(context);
|
||||
mResultCallBack = itemDelListener;
|
||||
lastType = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_msg_select_chat_type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
|
||||
// 获取屏幕宽度
|
||||
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
|
||||
// 设置弹窗宽度为屏幕宽度的 3/4
|
||||
View view = findViewById(R.id.root);
|
||||
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
|
||||
layoutParams.width = screenWidth*3/4;
|
||||
view.setLayoutParams(layoutParams);
|
||||
|
||||
chatTypeTv1 = findViewById(R.id.chatTypeTv1);
|
||||
chatTypeImg1 = findViewById(R.id.chatTypeImg1);
|
||||
chatTypeTv2 = findViewById(R.id.chatTypeTv2);
|
||||
chatTypeImg2 = findViewById(R.id.chatTypeImg2);
|
||||
chatTypeTv3 = findViewById(R.id.chatTypeTv3);
|
||||
chatTypeImg3 = findViewById(R.id.chatTypeImg3);
|
||||
chatTypeTv4 = findViewById(R.id.chatTypeTv4);
|
||||
chatTypeImg4 = findViewById(R.id.chatTypeImg4);
|
||||
chatTypeTv5 = findViewById(R.id.chatTypeTv5);
|
||||
chatTypeImg5 = findViewById(R.id.chatTypeImg5);
|
||||
|
||||
chatTypeImg1.setOnClickListener(this);
|
||||
chatTypeImg2.setOnClickListener(this);
|
||||
chatTypeImg3.setOnClickListener(this);
|
||||
chatTypeImg4.setOnClickListener(this);
|
||||
chatTypeImg5.setOnClickListener(this);
|
||||
|
||||
handleChatTypeClick(lastType);
|
||||
}
|
||||
|
||||
|
||||
private void handleChatTypeClick(int type) {
|
||||
switch (type) {
|
||||
case MainConversationListAdapter.FILTER_ALL:
|
||||
chatTypeImg1.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv1.setTextColor(ContextCompat.getColor(chatTypeTv1.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_ONLINE:
|
||||
chatTypeImg2.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv2.setTextColor(ContextCompat.getColor(chatTypeTv2.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_OFFLINE:
|
||||
chatTypeImg3.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv3.setTextColor(ContextCompat.getColor(chatTypeTv3.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_READ:
|
||||
chatTypeImg4.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv4.setTextColor(ContextCompat.getColor(chatTypeTv4.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_UNREAD:
|
||||
chatTypeImg5.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv5.setTextColor(ContextCompat.getColor(chatTypeTv5.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(android.view.View v) {
|
||||
if (v.getId() == R.id.chatTypeImg1) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_ALL, chatTypeTv1.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg2) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_ONLINE, chatTypeTv2.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg3) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_OFFLINE, chatTypeTv3.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg4) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_READ, chatTypeTv4.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg5) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_UNREAD, chatTypeTv5.getText().toString());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
|
||||
public interface ResultCallBack {
|
||||
void callBack(int i, String string);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.AsyncTask;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -258,35 +256,14 @@ public class NobleNoticeView extends FrameLayout {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@Override
|
||||
public void onStep(int frame, double v) {
|
||||
System.out.println("frame = " + frame);
|
||||
System.out.println("scrollLayout.getMeasuredWidth() = " + scrollLayout.getMeasuredWidth());
|
||||
if (frame == 21) {
|
||||
setButtonPosition(roleType);
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
// 在这里执行后台任务
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void aVoid) {
|
||||
super.onPostExecute(aVoid);
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(scrollLayout.getMeasuredHeight(), -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
animationSet1.setFillAfter(true);
|
||||
animationSet1.setDuration((animationTime - 1000) / 2);
|
||||
animationSet1.setAnimationListener(animationListener);
|
||||
scrollLayout.startAnimation(animationSet1);
|
||||
}
|
||||
}.execute();
|
||||
/*observable.observeOn(AndroidSchedulers.mainThread())
|
||||
observable.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(bitmap -> {
|
||||
L.e("44444");
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
@@ -296,7 +273,8 @@ public class NobleNoticeView extends FrameLayout {
|
||||
scrollLayout.startAnimation(animationSet1);
|
||||
}, throwable -> {
|
||||
|
||||
}).isDisposed();*/
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
if (frame == 135) {
|
||||
contextLayout.setVisibility(GONE);
|
||||
@@ -399,10 +377,12 @@ public class NobleNoticeView extends FrameLayout {
|
||||
Animation.AnimationListener animationListener = new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
|
||||
scrollLayout.clearAnimation();
|
||||
if (svagaBc.isAnimating()) {
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="19dp"/>
|
||||
<solid android:color="#40000000"/>
|
||||
<corners
|
||||
android:radius="16dp"/>
|
||||
<solid android:color="#2A2C3B" />
|
||||
</shape>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#8D8D8D" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#40E4E4E4" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FF666666" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.8 KiB |
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ff171724" />
|
||||
<corners
|
||||
android:topLeftRadius="17dp"
|
||||
android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 7%不透明度的白色-->
|
||||
<solid android:color="#11FFFFFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="4dp"
|
||||
android:bottomRightRadius="4dp"
|
||||
android:topLeftRadius="4dp"
|
||||
android:topRightRadius="4dp" />
|
||||
</shape>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="1dp" />
|
||||
<solid android:color="#26000000" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="1dp" />
|
||||
<gradient
|
||||
android:endColor="#FFC949"
|
||||
android:startColor="#FFC949" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="1dp" />
|
||||
<solid android:color="#15FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="1dp" />
|
||||
<gradient
|
||||
android:endColor="#DED9A5"
|
||||
android:startColor="#DED9A5" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 7%不透明度的白色-->
|
||||
<solid android:color="#11FFFFFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="17dp"
|
||||
android:bottomRightRadius="17dp"
|
||||
android:topLeftRadius="17dp"
|
||||
android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFF026" />
|
||||
<corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#48FFF026" />
|
||||
<corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#73FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#FFFFFF"
|
||||
android:startColor="#FFFFFF" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#ff6e84e7" />
|
||||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,11 +0,0 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"> <!-- 设置形状为圆形 -->
|
||||
|
||||
<solid android:color="#6DFF7C" /> <!-- 设置填充颜色 -->
|
||||
|
||||
<!-- 可以添加额外的属性如边框等 -->
|
||||
<!-- <stroke
|
||||
android:width="2dp"
|
||||
android:color="#000000" /> -->
|
||||
|
||||
</shape>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="355dp" android:height="121dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#F3F3F3" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,17 +0,0 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:gravity="center_horizontal">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#1a000000" /> <!-- 外圈 -->
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#2a000000" /> <!-- 深蓝色 -->
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="18dp"
|
||||
android:topRightRadius="18dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,10 +0,0 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"> <!-- 设置形状为圆形 -->
|
||||
|
||||
<solid android:color="#ffff4874" /> <!-- 设置填充颜色 -->
|
||||
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#30ff4874" /> <!-- 设置边框颜色为黑色并带有 70% 的不透明度 (BB 是 alpha 值) -->
|
||||
|
||||
</shape>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="20dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
|
||||
</shape>
|
||||
138
common/src/main/res/layout-land/dialog_gift_wall.xml
Normal file
138
common/src/main/res/layout-land/dialog_gift_wall.xml
Normal file
@@ -0,0 +1,138 @@
|
||||
<?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/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_root_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/bg_gift_wall_main_root"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintWidth_percent="0.48"
|
||||
app:riv_corner_radius="16dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/v_achievement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_root_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_root_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/bg_gift_wall_main_achievement"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/dialog_gift_wall_text_honors"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="6.8sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/v_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="11dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/v_achievement"
|
||||
app:layout_constraintEnd_toStartOf="@+id/v_achievement"
|
||||
app:layout_constraintTop_toTopOf="@+id/v_achievement"
|
||||
app:srcCompat="@mipmap/icon_gift_wall_main_tips" />
|
||||
|
||||
<com.yunbao.common.views.CustomEllipsizeTextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="111111111的礼物展馆"
|
||||
android:textColor="#6BCDFF"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/v_achievement"
|
||||
app:layout_constraintEnd_toStartOf="@+id/v_tips"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||
app:layout_constraintTop_toTopOf="@+id/v_achievement" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:background="@mipmap/icon_gift_wall_main_switch_main"
|
||||
android:gravity="center"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_root_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_root_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/v_achievement">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/dialog_gift_wall_text_personal_hal"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#9CE7FF"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/dialog_gift_wall_text_site_hal"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_root_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_root_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_root_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_layout" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:src="@mipmap/icon_sud_rule_close_bottom"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/user_name"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_root_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/user_name" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
93
common/src/main/res/layout-land/dialog_gift_wall_achieve.xml
Normal file
93
common/src/main/res/layout-land/dialog_gift_wall_achieve.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_root_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/dialog_gift_wall_achieve" />
|
||||
|
||||
<View
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@+id/top_bar"
|
||||
android:paddingEnd="25dp"
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/dialog_gift_wall_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@+id/top_bar"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_wall_achieve_title"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_below="@+id/iv_back"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@mipmap/dialog_gift_wall_achieve_top_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/top_icon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@mipmap/dialog_gift_wall_achieve_top_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical"
|
||||
android:text="0/1"
|
||||
android:textColor="#FDE9D8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/honor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/wall_honor"
|
||||
android:textColor="#E0E0E0"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:src="@mipmap/dialog_gift_wall_more" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/topLayout"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="10dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
450
common/src/main/res/layout-land/dialog_live_gift_popup.xml
Normal file
450
common/src/main/res/layout-land/dialog_live_gift_popup.xml
Normal file
@@ -0,0 +1,450 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:paddingBottom="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/operate_image"
|
||||
android:layout_width="122dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/blind_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:visibility="invisible">
|
||||
|
||||
<include
|
||||
layout="@layout/view_blind_box" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/naming_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginBottom="5dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/background_live_gift_gift_itle" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_itle"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginStart="13dp"
|
||||
android:src="@mipmap/icon_live_gift_gift_itle" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/naming_avatar"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="6dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/naming_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/gift_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="323dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/git_background2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/backgroud_custom_gift2"
|
||||
app:riv_corner_radius_bottom_left="10dp"
|
||||
app:riv_corner_radius_bottom_right="10dp"
|
||||
app:riv_corner_radius_top_left="10dp"
|
||||
app:riv_corner_radius_top_right="10dp" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/git_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/leveling_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:background="@mipmap/icon_grade_angle_mark">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lv_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Lv.8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="18dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_bg_user" />
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/leave_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="2dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:text="@string/leveling_points"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="9sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:background="@mipmap/icon_right" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/gift_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/btn_luck_gift_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<include layout="@layout/view_nobility" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/gift_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:paddingStart="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/diamond_linear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/background_gift_money"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:src="@mipmap/diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/diamond_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:background="@mipmap/icon_right" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gold_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toRightOf="@id/diamond_linear"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:src="@mipmap/gold_coin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gold_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text="10000000"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/gift_send_layout"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="14dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/gift_number_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="42dp"
|
||||
android:background="@drawable/background_gift_money2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15dp"
|
||||
android:text="1"
|
||||
android:textColor="#F5C05A"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_arrow"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:src="@mipmap/icon_arrow_right_2" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/live_gift_send"
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/bg_live_gift_send_new"
|
||||
android:gravity="center"
|
||||
android:text="@string/live_gift_send"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/gift_bottom"
|
||||
android:layout_below="@id/git_title"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/gift_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="27dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/icon_covering_layer"
|
||||
android:scaleType="centerCrop" />
|
||||
</FrameLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="11dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/white" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/live_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@string/live_wrap"
|
||||
android:textColor="#CCCDCE"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/red_point"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@drawable/bg_red_point" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/context_layout_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="196dp"
|
||||
android:layout_marginTop="12dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/btn_send_lian"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@mipmap/icon_live_gift_lian"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/live_gift_send_lian"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lian_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="35dp"
|
||||
android:textColor="#fff"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user