Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bec6c1b79 | ||
|
|
1df8d443f7 | ||
|
|
6e7d27cbc3 |
4
.gitignore
vendored
@@ -15,7 +15,3 @@ local.properties
|
||||
/main/build/
|
||||
/video/build/
|
||||
/tmp/full-r8-config.txt
|
||||
/outputs/apk
|
||||
/TabLayout/build
|
||||
/app/google_test/release
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
>
|
||||
|
||||
<queries>
|
||||
<package android:name="${applicationId}"/>
|
||||
<package android:name="com.pandora.sy"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.yunbao.share;
|
||||
import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||
@@ -17,22 +15,12 @@ import java.io.File;
|
||||
public abstract class AbsShareInterface {
|
||||
protected final Context mContext;
|
||||
|
||||
|
||||
public AbsShareInterface(Context context) {
|
||||
this.mContext = context;
|
||||
IntentFilter filter = new IntentFilter(TweetUploadService.UPLOAD_SUCCESS);
|
||||
filter.addAction(TweetUploadService.UPLOAD_FAILURE);
|
||||
filter.addAction(TweetUploadService.TWEET_COMPOSE_CANCEL);
|
||||
|
||||
TwitterResultReceiver receiver = new TwitterResultReceiver();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { // API 33+
|
||||
// Android 13 (API 33) 及以上版本使用导出标志
|
||||
context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
|
||||
} else {
|
||||
// Android 12 (API 32) 以下版本
|
||||
context.registerReceiver(receiver, filter);
|
||||
}
|
||||
context.registerReceiver(new TwitterResultReceiver(), filter);
|
||||
}
|
||||
|
||||
public abstract void share(ShareBean builder, ICallback callback);
|
||||
|
||||
@@ -33,12 +33,12 @@ public class ShareBean {
|
||||
|
||||
|
||||
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||
return String.format(CommonAppConfig.HOST +"/h5/home/share.html?uid=%s&user_id=%s&isGoogle=%s",
|
||||
return String.format(CommonAppConfig.HOST +
|
||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||
anchorId,
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static String createInviteLink(String shareUid) {
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
<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">快來 Yola觀看%s直播,認識更多有趣的朋友吧!</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>
|
||||
@@ -14,6 +13,6 @@
|
||||
<string name="dialog_share_app_instagram" >Instagram</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 Yola觀看直播,認識更多有趣的朋友吧!</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 Yola and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to Yola 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
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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" />
|
||||
@@ -104,7 +103,6 @@
|
||||
|
||||
</queries>
|
||||
<application
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:name="com.shayu.phonelive.AppContext"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@@ -133,7 +131,6 @@
|
||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppLunTheme.Theme"
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
mBtnSkipVideo = findViewById(R.id.btn_skip_video);
|
||||
mBtnSkipImage.setOnClickListener(this);
|
||||
mBtnSkipVideo.setOnClickListener(this);
|
||||
// ImgLoader.display(mContext, R.mipmap.screen, mCover);
|
||||
ImgLoader.display(mContext, R.mipmap.screen, mCover);
|
||||
mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
android:background="#000" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/btn_skip_img"
|
||||
@@ -53,32 +53,12 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_yola_splash_log">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/ic_yola_splash_log"
|
||||
app:layout_constraintWidth_percent="0.34" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 22 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Yola</string>
|
||||
<string name="app_name">PandoraLive</string>
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">upload-z0.qiniup.com</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
@@ -56,7 +56,7 @@ allprojects {
|
||||
ext {
|
||||
IS_PUBLISH_LOCAL=true
|
||||
LIB_VERSION="1.0.6"
|
||||
AGORA_RTC_SDK= 'io.agora.rtc:agora-special-full:4.2.6.19'
|
||||
AGORA_RTC_SDK= 'io.agora.rtc:agora-special-full:4.2.6.14'
|
||||
// AGORA_RTC_SDK= "${rootProject.rootDir.absolutePath}/sdk"
|
||||
// AGORA_RTC_SDK="io.agora.rtc:full-sdk:4.2.6"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -134,7 +133,6 @@ public class CommonAppConfig {
|
||||
private boolean mLaunched;//App是否启动了
|
||||
private String mJPushAppKey;//极光推送的AppKey
|
||||
private List<UserItemBean> mUserItemList;//个人中心功能列表
|
||||
private List<List<UserItemBean>> mYolaUserItemList;//个人中心功能列表
|
||||
private SparseArray<FansMedalBean> mAnchorFansMedalMap;
|
||||
private String mGiftListJson;
|
||||
private String mWrapListJson;
|
||||
@@ -552,37 +550,6 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
public List<List<UserItemBean>> geYolatUserItemList() {
|
||||
if (mYolaUserItemList == null || mYolaUserItemList.size() == 0) {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
JSONObject obj = JSON.parseObject(userBeanJson);
|
||||
if (obj != null) {
|
||||
setYolatUserItemList(obj.getString("yola_list"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return mYolaUserItemList;
|
||||
}
|
||||
|
||||
public void setYolatUserItemList(String yola_list) {
|
||||
JSONObject obj = JSON.parseObject(yola_list);
|
||||
List<List<UserItemBean>> newList = new ArrayList<>();
|
||||
if (obj != null) {
|
||||
List<UserItemBean> list1 = JSON.parseArray(obj.getString("user_rights"), UserItemBean.class);
|
||||
newList.add(list1);
|
||||
List<UserItemBean> list2 = JSON.parseArray(obj.getString("creation_center"), UserItemBean.class);
|
||||
newList.add(list2);
|
||||
List<UserItemBean> list3 = JSON.parseArray(obj.getString("other_functions"), UserItemBean.class);
|
||||
newList.add(list3);
|
||||
}
|
||||
mYolaUserItemList = newList;
|
||||
}
|
||||
|
||||
|
||||
public void setUserItemList(String listString) {
|
||||
UserItemBean[][] arr = JSON.parseObject(listString, UserItemBean[][].class);
|
||||
if (arr != null && arr.length > 0) {
|
||||
|
||||
@@ -7,13 +7,12 @@ package com.yunbao.common;
|
||||
public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/h5/page/index.html?id=733"; //隐私政策
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/h5/page/index.html?id=732";//用户协议
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=68";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=67";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/h5/page/index.html?id=735";//用户服务协议
|
||||
public static final String REG_PRIVCAY2 = CommonAppConfig.HOST + "/h5/page/index.html?id=733";//隐私政策
|
||||
public static final String ANCHOR_AGREEMENT = CommonAppConfig.HOST + "/h5/page/index.html?id=734";//主播协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
public static final String REG_PRIVCAY2 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
|
||||
//直播间贡献榜
|
||||
public static final String LIVE_LIST = CommonAppConfig.HOST + "/index.php?g=Appapi&m=contribute&a=index&uid=";
|
||||
@@ -34,7 +33,7 @@ public class HtmlConfig {
|
||||
public static final String LUCK_GIFT_TIP = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=26";
|
||||
|
||||
//直播间玩家看到的心愿单
|
||||
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/h5/wish/index.html?1=1";
|
||||
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Wish&a=index";
|
||||
|
||||
//直播间玩家看到的转盘
|
||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||
@@ -49,7 +48,7 @@ public class HtmlConfig {
|
||||
public static final String PERSONAL = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ/Personal";
|
||||
|
||||
//我的徽章 右上角问号
|
||||
public static final String MEDAL_QUESTION = CommonAppConfig.HOST + "/h5/fans/rule.html?isfans=1";
|
||||
public static final String MEDAL_QUESTION = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Fans&a=rule&isfans=1";
|
||||
|
||||
//我的明细
|
||||
public static final String DETAIL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Detail&a=index";
|
||||
@@ -59,7 +58,4 @@ public class HtmlConfig {
|
||||
//充值说明
|
||||
public static final String CHARGE_EXPLAIN = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=41";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -297,19 +297,11 @@ public class WebViewActivity extends AbsActivity {
|
||||
mIsLive = isLive;
|
||||
if (Constants.LoginKefu) {
|
||||
if (addArgs) {
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
}}
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
if (url.contains("?")) {
|
||||
url += "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
} else {
|
||||
url += "?isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
}
|
||||
Intent intent = new Intent(context, WebViewActivity.class);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,6 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
replyTextView.setTag(bean);
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||
name.setText(bean.getUser_name());
|
||||
report.setVisibility(bean.getUid().equals(myUid)?View.GONE: View.VISIBLE);
|
||||
content.setText(bean.getContent());
|
||||
if (bean.getUser_id().equals(authorId)) {
|
||||
author.setVisibility(View.VISIBLE);
|
||||
@@ -165,7 +164,6 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
replyCount.setText(String.format(mContext.getResources().getString(R.string.active_count), String.valueOf(bean.getReplyCommentList().size())));
|
||||
if (bean.getReplyCommentList().size() > 0) {
|
||||
report1.setTag(bean.getReplyCommentList().get(0));
|
||||
report1.setVisibility( bean.getReplyCommentList().get(0).getUid().equals(myUid)?View.GONE: View.VISIBLE);
|
||||
del1.setTag(bean.getReplyCommentList().get(0));
|
||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||
|
||||
@@ -94,7 +94,6 @@ public class CommentReplyAdapter extends RecyclerView.Adapter {
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar01);
|
||||
name.setText(bean.getUser_name());
|
||||
replyContent.setText(bean.getContent());
|
||||
report.setVisibility(bean.getUid().equals(myUid)?View.GONE: View.VISIBLE);
|
||||
if (bean.getUser_id().equals(authorId)) {
|
||||
author.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
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.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.GameTypeItemBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.SudTitleSelectViewHolder;
|
||||
|
||||
import net.lucode.hackware.magicindicator.buildins.UIUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GameTypeItemAdapter extends RecyclerView.Adapter<GameTypeItemAdapter.GameTypeViewHolder> implements View.OnClickListener {
|
||||
|
||||
private List<CustomSidebarChildModel> itemList;
|
||||
private Context mContext;
|
||||
private int mChoice;
|
||||
// public GameTypeItemAdapter(List<GameTypeItemBean> itemList, Context context) {
|
||||
// this.itemList = itemList;
|
||||
// mContext=context;
|
||||
// }
|
||||
|
||||
public GameTypeItemAdapter(List<CustomSidebarChildModel> customSidebarChildModels, Context context) {
|
||||
this.itemList = customSidebarChildModels;
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object object =v.getTag();
|
||||
if (object!=null && object instanceof Integer){
|
||||
if (mChoice != (int) object) {
|
||||
mChoice = (int) object;
|
||||
notifyDataSetChanged();
|
||||
if (mChoice == 0){
|
||||
Bus.get().post(new SudGameListEvent()
|
||||
.setInteractionID(0L)
|
||||
.setId("0")
|
||||
.setTitle(mContext.getString(R.string.interactive_game_room_all)));
|
||||
}else {
|
||||
Bus.get().post(new SudGameListEvent()
|
||||
.setInteractionID(Long.parseLong(itemList.get(mChoice-1).getSrc()))
|
||||
.setId(itemList.get(mChoice-1).getId())
|
||||
.setTitle(itemList.get(mChoice-1).getTitle()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GameTypeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_game_type_select_view, parent, false);
|
||||
UIUtil.getScreenWidth(mContext);
|
||||
itemView.setLayoutParams(new ViewGroup.LayoutParams(UIUtil.getScreenWidth(mContext) / 4, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
itemView.setOnClickListener(this);
|
||||
return new GameTypeViewHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull GameTypeViewHolder holder, int position) {
|
||||
holder.itemView.setTag(position);
|
||||
if (position == 0) {
|
||||
holder.gameBg.setImageResource(getGameBgResId(position));
|
||||
holder.gameName.setText(R.string.interactive_game_room_all);
|
||||
holder.gameIcon.setImageResource(R.mipmap.ic_yola_game_1);
|
||||
} else {
|
||||
CustomSidebarChildModel item = itemList.get(position - 1);
|
||||
holder.gameBg.setImageResource(getGameBgResId(position));
|
||||
ImgLoader.display(holder.gameIcon.getContext(), item.getIcon(), holder.gameIcon);
|
||||
holder.gameName.setText(item.getTitle());
|
||||
}
|
||||
|
||||
if (mChoice == position) {
|
||||
holder.gameName.setTypeface(null, Typeface.BOLD);
|
||||
holder.gameName.setTextColor(ContextCompat.getColor(mContext,R.color.color_111111));
|
||||
}else {
|
||||
holder.gameName.setTypeface(null, Typeface.NORMAL);
|
||||
holder.gameName.setTextColor(ContextCompat.getColor(mContext,R.color.color_605c58));
|
||||
}
|
||||
}
|
||||
|
||||
private int getGameBgResId(int position) {
|
||||
Integer p = position % 4;
|
||||
switch (p) {
|
||||
case 0:
|
||||
return R.mipmap.ic_yola_game_bg_1;
|
||||
case 1:
|
||||
return R.mipmap.ic_yola_game_bg_2;
|
||||
case 2:
|
||||
return R.mipmap.ic_yola_game_bg_3;
|
||||
case 3:
|
||||
return R.mipmap.ic_yola_game_bg_4;
|
||||
default:
|
||||
return R.mipmap.ic_yola_game_bg_1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return itemList.size() + 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class GameTypeViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView gameBg;
|
||||
public ImageView gameIcon;
|
||||
public TextView gameName;
|
||||
|
||||
public GameTypeViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
gameBg = itemView.findViewById(R.id.gameBg);
|
||||
gameIcon = itemView.findViewById(R.id.gameIcon);
|
||||
gameName = itemView.findViewById(R.id.gameName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,55 +39,27 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnRefreshListener(OnRecyclerListRefreshListener<List<BaseUiConversation>> onRefreshListener) {
|
||||
this.onRefreshListener = 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,83 +119,21 @@ 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);
|
||||
@@ -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())) {
|
||||
Log.i("聊天数据源", item.mCore.getConversationTitle() + "|" + item.mCore.getPortraitUrl() + "|" + item.mCore.getTargetId());
|
||||
BaseUiConversation cn = new SingleConversation(mContext, item.mCore);
|
||||
srcList.add(cn);
|
||||
tmpUids.add(item.mCore.getTargetId());
|
||||
}
|
||||
|
||||
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);
|
||||
// ToastUtil.showDebug("消息数:"+data.size());
|
||||
super.setDataCollection(tmp);
|
||||
}
|
||||
}
|
||||
if (showData != null && !UiConversationCodeUtil.checkIsSame(showData, mDataList)) {
|
||||
// Log.i("聊天数据源", "数据源有变化" + showData.size());
|
||||
super.setDataCollection(showData);
|
||||
} else {
|
||||
// Log.i("聊天数据源", "数据源无变化");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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();
|
||||
@@ -475,15 +337,10 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
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{
|
||||
conversation.mConversationContent = new SpannableString(((TextMessage) bean.getContent()).getContent());
|
||||
}
|
||||
|
||||
mDataList.set(id, conversation);
|
||||
notifyItemChanged(id);
|
||||
}
|
||||
@@ -499,6 +356,4 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class MsgRecommendAdapter extends RecyclerView.Adapter<MsgRecommendAdapte
|
||||
ImgLoader.display(holder.itemView.getContext(), mList.get(position).getAvatar(), holder.mAvatar);
|
||||
holder.rc_conversation_title.setText(mList.get(position).getUser_nicename());
|
||||
holder.sayHi.setText(mList.get(position).isSayHi()? (WordUtil.isNewZh()?"已打招呼":"Said Hallo"):(WordUtil.isNewZh()?"打招呼":"Greet"));
|
||||
holder.sayHi.setBackground(mList.get(position).isSayHi()? mContext.getDrawable(R.drawable.bg_msg_recommended):mContext.getDrawable(R.drawable.bg_msg_yola_recommend));
|
||||
holder.sayHi.setBackground(mList.get(position).isSayHi()? mContext.getDrawable(R.drawable.bg_msg_recommended):mContext.getDrawable(R.drawable.bg_msg_recommend));
|
||||
holder.sayHi.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -9,7 +9,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
import com.yunbao.common.views.SudGameListViewHolder2;
|
||||
|
||||
public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
private boolean isHome = false;
|
||||
@@ -23,7 +22,7 @@ public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome){
|
||||
return new SudGameListViewHolder2(mInflater.inflate(R.layout.item_home_sud_game_list2, parent, false));
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
}else {
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
@@ -31,13 +30,7 @@ public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (isHome){
|
||||
SudGameListViewHolder2 sudGameListViewHolder = (SudGameListViewHolder2) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position));
|
||||
}else {
|
||||
SudGameListViewHolder sudGameListViewHolder = (SudGameListViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position),isHome);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class GameTypeItemBean {
|
||||
|
||||
private String gameName;
|
||||
private String iconUrl;
|
||||
private int iconId=-1;
|
||||
private int gameBgResId;
|
||||
|
||||
public GameTypeItemBean(String gameName, String gameIconUrl, int gameBgResId) {
|
||||
this.gameName = gameName;
|
||||
this.iconUrl = gameIconUrl;
|
||||
this.gameBgResId = gameBgResId;
|
||||
}
|
||||
|
||||
public int getIconId() {
|
||||
return iconId;
|
||||
}
|
||||
|
||||
public void setIconId(int iconId) {
|
||||
this.iconId = iconId;
|
||||
}
|
||||
|
||||
public String getGameName() {
|
||||
return gameName;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public int getGameBgResId() {
|
||||
return gameBgResId;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ public class UserBean implements Parcelable {
|
||||
private String token_rong = "";
|
||||
private String noble_end_time;
|
||||
private String slide;
|
||||
private String slide_pic;
|
||||
private String users_type;
|
||||
private String is_bind;
|
||||
private String mobile;
|
||||
@@ -273,14 +272,6 @@ public class UserBean implements Parcelable {
|
||||
return slide;
|
||||
}
|
||||
|
||||
public String getSlide_pic() {
|
||||
return slide_pic;
|
||||
}
|
||||
|
||||
public void setSlide_pic(String slide_pic) {
|
||||
this.slide_pic = slide_pic;
|
||||
}
|
||||
|
||||
public void setSlide(String slide) {
|
||||
this.slide = slide;
|
||||
}
|
||||
|
||||
@@ -411,9 +411,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
public RecyclerView getRefreshView() {
|
||||
return mRecyclerView;
|
||||
}
|
||||
|
||||
public interface DataHelperNew {
|
||||
void loadData(int p);
|
||||
|
||||
|
||||
@@ -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,12 +89,17 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
@@ -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 {
|
||||
|
||||
@@ -91,7 +91,7 @@ public class GiftWallRuleDialog extends AbsDialogPopupWindow {
|
||||
} else {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/%E4%B8%AD%E6%96%87.png" : "https://downs.yaoulive.com/%E8%8B%B1%E6%96%87.png", -1, -1, new ImgLoader.DrawableCallback() {
|
||||
ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/%E4%B8%AD%E6%96%87%E8%A7%84%E5%88%99.png" : "https://downs.yaoulive.com/%E8%8B%B1%E6%96%87%E8%A7%84%E5%88%99.png", -1, -1, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
iv_rule.setImageDrawable(drawable);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -127,14 +127,14 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
}
|
||||
});
|
||||
} else if (mType == 1) {
|
||||
selectString.add(getContext().getString(R.string.unlimited_threshold));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_0_1));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_1_2));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_5));
|
||||
selectString.add(getContext().getString(R.string.room_sill0_100));
|
||||
selectString.add(getContext().getString(R.string.room_sill100_500));
|
||||
selectString.add(getContext().getString(R.string.room_sill500_m));
|
||||
selectSill.put(getContext().getString(R.string.unlimited_threshold), "0,0,0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0,0,0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_0_1), "0,1,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_1_2), "1,5,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_5), "5,0,3");
|
||||
@@ -161,10 +161,10 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
}
|
||||
});
|
||||
} else if (mType == 2) {
|
||||
selectString.add(getContext().getString(R.string.unrestricted_players));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.live_anchor));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_player));
|
||||
selectSill.put(getContext().getString(R.string.unrestricted_players), "0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.live_anchor), "1");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_player), "2");
|
||||
index = 0;
|
||||
|
||||
@@ -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,57 +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 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;
|
||||
// <string name="all_chats">All Chats</string>
|
||||
// <string name="online_only">Show Online </string>
|
||||
// <string name="offline_only">Show Offline </string>
|
||||
// <string name="read_only">Show Read </string>
|
||||
// <string name="unread_only">Show Unread </string>
|
||||
|
||||
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,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,13 +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) {
|
||||
Log.i("nwq", "刷新数据");
|
||||
listHashCode = hashCode;
|
||||
if (listHashCode != uiConversations.hashCode()) {
|
||||
listHashCode = uiConversations.hashCode();
|
||||
((MainConversationListAdapter) mAdapter).onFinish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mConversationListViewModel.getRefreshEventLiveData().observe(this.getViewLifecycleOwner(), new Observer<Event.RefreshEvent>() {
|
||||
@@ -69,6 +58,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
listHashCode = 0;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setEmptyView(int viewLayoutMsgId) {
|
||||
@@ -80,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);
|
||||
}
|
||||
@@ -103,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()) {
|
||||
@@ -146,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<>();
|
||||
@@ -166,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
|
||||
@@ -186,14 +161,12 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
((MainConversationListAdapter) mAdapter).clear();
|
||||
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) {
|
||||
@@ -168,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) {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class API extends BaseApi {
|
||||
.addInterceptor(initQuery(isNeedUid, isNeedToken, CommonAppContext.sInstance.getApplicationContext()))
|
||||
.addInterceptor(loggingInterceptor);
|
||||
return create(builder.build(),
|
||||
JavaConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||
}
|
||||
|
||||
//公共参数
|
||||
|
||||
@@ -20,8 +20,8 @@ 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 COMMUNITY_SETREPORT = "ylapyonghushequdongtaijubao";
|
||||
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";
|
||||
public static final String GET_USER_BASEINFO = "getUserBaseinfo";
|
||||
|
||||
@@ -176,7 +176,7 @@ public class CommonHttpUtil {
|
||||
}
|
||||
Log.i("来了", lang);
|
||||
//或者仅仅使用 locale = Locale.getDefault(); 不需要考虑接口 deprecated(弃用)问题
|
||||
HttpClient.getInstance().get("ylahuoquzhuyepeizhixinxi", CommonHttpConsts.GET_CONFIG)
|
||||
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG)
|
||||
.params("langue", lang)
|
||||
.params("version", "" + VersionUtil.getVersion())
|
||||
.params("from", "android")
|
||||
@@ -243,7 +243,7 @@ public class CommonHttpUtil {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "info[0]:" + info[0] + "\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
}
|
||||
} else if (code == 1000) {
|
||||
@@ -313,7 +313,7 @@ public class CommonHttpUtil {
|
||||
ToastUtil.show(WordUtil.getString(R.string.cannot_follow_self));
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("ylashezhiguanzhu", tag)
|
||||
HttpClient.getInstance().get("User.setAttents", tag)
|
||||
.params("touid", touid)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
@@ -347,7 +347,7 @@ public class CommonHttpUtil {
|
||||
} else {
|
||||
isGoogle = "-1";
|
||||
}
|
||||
HttpClient.getInstance().get("ylahuoquwodezuanshi", CommonHttpConsts.GET_BALANCE)
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE)
|
||||
.params("type", 0)
|
||||
.params("isGooglePay", isGoogle)
|
||||
.execute(callback);
|
||||
@@ -404,7 +404,7 @@ public class CommonHttpUtil {
|
||||
* 检查token是否失效
|
||||
*/
|
||||
public static void checkTokenInvalid() {
|
||||
HttpClient.getInstance().get("ylashezhijiaoyouzhaopianzhuangtai", CommonHttpConsts.CHECK_TOKEN_INVALID)
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID)
|
||||
.execute(NO_CALLBACK);
|
||||
}
|
||||
|
||||
@@ -417,24 +417,27 @@ 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);
|
||||
}
|
||||
|
||||
public static void Google_sec_pay(String purchaseToken, String orderNo, String tradeNo, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylagugedingdanyanzheng", "Charge.Google_sec_pay")
|
||||
HttpClient.getInstance().get("Charge.Google_sec_pay", "Charge.Google_sec_pay")
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.params("package_name", "com.pandora.sy")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -483,7 +486,7 @@ public class CommonHttpUtil {
|
||||
* 用户个人主页信息
|
||||
*/
|
||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquyonghujichuxinxi", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
} /**
|
||||
@@ -494,14 +497,21 @@ public class CommonHttpUtil {
|
||||
if(StringUtil.isEmpty(uid)){
|
||||
uid="NotLogin_"+ DeviceUtils.getUniqueDeviceId();
|
||||
}
|
||||
HttpClient.getInstance().get("ylahuoquqiniushangchuanlingpaiv3", "Pdluserhome.getQiNiuToken3")
|
||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken3", "Pdluserhome.getQiNiuToken3")
|
||||
.params("uid",uid)
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("file_name", fileName)
|
||||
.params("ext", ".zip")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
//
|
||||
// //埋点唯一性
|
||||
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||
// HttpClient.getInstance().get("Tx.setAdvertisingChannels", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
// .params("operation", operation)
|
||||
// .params("marking", Adjust.getAdid())
|
||||
// .execute(callback);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 发送动态
|
||||
@@ -514,7 +524,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String videoUrl, String createAt, HttpCallback callback) {
|
||||
HttpClient.getInstance().post("ylapfabudongtai", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
HttpClient.getInstance().post("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
||||
.params("content", content)
|
||||
.params("talk_id", talkId)
|
||||
@@ -530,7 +540,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getCommunityHotList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoquremendongtai", "Pdlcommunity.getHotDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getHotDynamicList", "Pdlcommunity.getHotDynamicList")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -541,7 +551,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getCommunityComment(String dynamic_id, String dynamic_uid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoqudongtaipinglunliebiao", "Pdlcommunity.getDynamicCommentList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("dynamic_uid", dynamic_uid)
|
||||
.params("p", p)
|
||||
@@ -554,7 +564,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void dynamicLove(String dynamic_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoqudongtaidianzan", "Pdlcommunity.dynamicLove")
|
||||
HttpClient.getInstance().get("Pdlcommunity.dynamicLove", "Pdlcommunity.dynamicLove")
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -565,7 +575,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void dynamicReply(String dynamic_id, String to_comment_id, String content, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylapfabudongtaipinglun", "Pdlcommunity.sendDynamicComment")
|
||||
HttpClient.getInstance().get("Pdlcommunity.sendDynamicComment", "Pdlcommunity.sendDynamicComment")
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("content", content)
|
||||
.params("to_comment_id", to_comment_id)
|
||||
@@ -576,7 +586,7 @@ public class CommonHttpUtil {
|
||||
* 获取动态-发现
|
||||
*/
|
||||
public static void getCommunityFind(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoqufaxiandongtai", "Pdlcommunity.getFindDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -585,7 +595,7 @@ public class CommonHttpUtil {
|
||||
* 获取动态-关注
|
||||
*/
|
||||
public static void getCommunityFollow(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoquguanzhudongtai", "Pdlcommunity.getAttentionDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getAttentionDynamicList", "Pdlcommunity.getAttentionDynamicList")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -594,19 +604,19 @@ public class CommonHttpUtil {
|
||||
* 获取动态-分类
|
||||
*/
|
||||
public static void getTag(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquzuixinhuati", "Pdlcommunity.getHotTalk")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getHotTalk", "Pdlcommunity.getHotTalk")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getTalkHotDynamicList(int talkId, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoquremenhuatidongtai", "Pdlcommunity.getTalkHotDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getTalkHotDynamicList", "Pdlcommunity.getTalkHotDynamicList")
|
||||
.params("talk_id", talkId)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getOtherDynamicList(String toUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaphuoquqitadongtai", "Pdlcommunity.getOtherDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getOtherDynamicList", "Pdlcommunity.getOtherDynamicList")
|
||||
.params("tuid", toUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -615,7 +625,7 @@ public class CommonHttpUtil {
|
||||
* 动态-评论-删除
|
||||
*/
|
||||
public static void delCom(String comment_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylapshanchuzijidongtaizijipinglun", "Pdlcommunity.delComment")
|
||||
HttpClient.getInstance().get("Pdlcommunity.delComment", "Pdlcommunity.delComment")
|
||||
.params("comment_id", comment_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -624,7 +634,7 @@ public class CommonHttpUtil {
|
||||
* 动态-不感兴趣
|
||||
*/
|
||||
public static void noInterest(String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaquxiaolahei", "User.setBlack")
|
||||
HttpClient.getInstance().get("Pdluser.setBlack", "User.setBlack")
|
||||
.params("touid", uid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -633,7 +643,7 @@ public class CommonHttpUtil {
|
||||
* 用户主页-用户数据
|
||||
*/
|
||||
public static void getUserInfoTop(String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqugerenzhuyetoubuxinxi", "Pdluserhome.getUserHomeTopInfo")
|
||||
HttpClient.getInstance().get("Pdluserhome.getUserHomeTopInfo", "Pdluserhome.getUserHomeTopInfo")
|
||||
.params("select_uid", uid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -642,7 +652,7 @@ public class CommonHttpUtil {
|
||||
* 上传文件 获取七牛云token的接口
|
||||
*/
|
||||
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
||||
HttpClient.getInstance().get("ylahuoquqiniushangchuanlingpai", "Pdluserhome.getQiNiuToken")
|
||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken", "Pdluserhome.getQiNiuToken")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||
@@ -652,7 +662,7 @@ public class CommonHttpUtil {
|
||||
* 上传文件 获取七牛云token的接口
|
||||
*/
|
||||
public static void getUploadQiNiuTokenNew(HttpCallback callback, boolean isImg) {
|
||||
HttpClient.getInstance().get("ylahuoquqiniushangchuanlingpaiv2", "Pdluserhome.getQiNiuToken2")
|
||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||
@@ -662,7 +672,7 @@ public class CommonHttpUtil {
|
||||
* 修改用户背景墙
|
||||
*/
|
||||
public static void uploadUserInfoImg(String imgs, HttpCallback callback) {
|
||||
HttpClient.getInstance().post("ylabaocungerenzhuyebanner", "Userhome.saveUserHomeBanner")
|
||||
HttpClient.getInstance().post("Pdluserhome.saveUserHomeBanner", "Userhome.saveUserHomeBanner")
|
||||
.params("home_banner_url_ary", imgs)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -671,7 +681,7 @@ public class CommonHttpUtil {
|
||||
* 动态-删除
|
||||
*/
|
||||
public static void delActive(String dynamic_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylapyonghushanchudongtai", "Pdlcommunity.delDynamic")
|
||||
HttpClient.getInstance().get("Pdlcommunity.delDynamic", "Pdlcommunity.delDynamic")
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -680,7 +690,7 @@ public class CommonHttpUtil {
|
||||
* 获取打招呼推荐列表
|
||||
*/
|
||||
public static void getMainMsgRecommend(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhubotuijianye", "Pdluser.getRecommendUser")
|
||||
HttpClient.getInstance().get("Pdluser.getRecommendUser", "Pdluser.getRecommendUser")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -690,13 +700,13 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void sayHi(String toUid,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhubodazhaohu", "Pdluser.liveCall")
|
||||
HttpClient.getInstance().get("Pdluser.liveCall", "Pdluser.liveCall")
|
||||
.params("target_uid",toUid)
|
||||
.params("behavior_type","5")
|
||||
.execute(callback);
|
||||
}
|
||||
public static void sayHi(String toUid,String type,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhubodazhaohu", "Pdluser.liveCall")
|
||||
HttpClient.getInstance().get("Pdluser.liveCall", "Pdluser.liveCall")
|
||||
.params("target_uid",toUid)
|
||||
.params("behavior_type",type)
|
||||
.execute(callback);
|
||||
@@ -708,7 +718,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getUserOnline(String toUid,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquyonghuzaixianzhuangtai", "Pdluser.getUserOnline")
|
||||
HttpClient.getInstance().get("Pdluser.getUserOnline", "Pdluser.getUserOnline")
|
||||
.params("uids",toUid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class HttpClient {
|
||||
private String mUrl;
|
||||
|
||||
private HttpClient() {
|
||||
mUrl = CommonAppConfig.HOST + "/";//去掉 api/public/?service="
|
||||
mUrl = CommonAppConfig.HOST + "/api/public/?service=";
|
||||
}
|
||||
|
||||
public static HttpClient getInstance() {
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.utils.AesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Base64;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public final class JavaConverterFactory extends Converter.Factory {
|
||||
/**
|
||||
* Create an instance using a default {@link Gson} instance for conversion. Encoding to JSON and
|
||||
* decoding from JSON (when no charset is specified by a header) will use UTF-8.
|
||||
*/
|
||||
public static JavaConverterFactory create() {
|
||||
return create(new Gson());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance using {@code gson} for conversion. Encoding to JSON and
|
||||
* decoding from JSON (when no charset is specified by a header) will use UTF-8.
|
||||
*/
|
||||
public static JavaConverterFactory create(Gson gson) {
|
||||
return new JavaConverterFactory(gson);
|
||||
}
|
||||
|
||||
private final Gson gson;
|
||||
|
||||
private JavaConverterFactory(Gson gson) {
|
||||
if (gson == null) throw new NullPointerException("gson == null");
|
||||
this.gson = gson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
||||
TypeAdapter<?> adapter = gson.getAdapter(TypeToken.get(type));
|
||||
return new JsonResponseBodyConverter<>(gson, adapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||
return super.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||
}
|
||||
|
||||
final class JsonResponseBodyConverter<T> implements Converter<ResponseBody, T> {
|
||||
private final Gson gson;
|
||||
private final TypeAdapter<T> adapter;
|
||||
|
||||
JsonResponseBodyConverter(Gson gson, TypeAdapter<T> adapter) {
|
||||
this.gson = gson;
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T convert(ResponseBody value) throws IOException {
|
||||
String response = value.string();
|
||||
String allResponseData;
|
||||
L.e("解密前::" + response);
|
||||
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||
allResponseData = jsonObject.getString("data");
|
||||
if (allResponseData.indexOf(":") <= 0) {
|
||||
byte[] decodedData = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
decodedData = Base64.getDecoder().decode(allResponseData);
|
||||
}
|
||||
response = AesUtils.decryptToString(decodedData);
|
||||
jsonObject.put("data", JSONObject.parseObject(response));
|
||||
|
||||
response = JSON.toJSONString(jsonObject);
|
||||
L.e("解密后::" + response);
|
||||
//获取加密数据,解密,之后再让adapter去处理json串,解析具体的数据就可以了
|
||||
try {
|
||||
return adapter.fromJson(response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
value.close();
|
||||
}
|
||||
} else {
|
||||
return adapter.fromJson(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,5 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.bean.AdBean;
|
||||
import com.yunbao.common.utils.AesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/5.
|
||||
*/
|
||||
@@ -20,7 +7,7 @@ import java.util.List;
|
||||
public class JsonBean {
|
||||
private int ret;
|
||||
private String msg;
|
||||
private String data;
|
||||
private Data data;
|
||||
|
||||
public int getRet() {
|
||||
return ret;
|
||||
@@ -39,47 +26,10 @@ public class JsonBean {
|
||||
}
|
||||
|
||||
public Data getData() {
|
||||
L.e("data:" + data);
|
||||
if (data.indexOf(":") > 0) {
|
||||
L.e("未加密::" + data);
|
||||
return JSON.parseObject(data, Data.class);
|
||||
//return GsonUtils.fromJson(data, Data.class);
|
||||
} else {
|
||||
Data resultData = new Data();
|
||||
byte[] decodedData = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
decodedData = Base64.getDecoder().decode(data);
|
||||
}
|
||||
String decryptedText = AesUtils.decryptToString(decodedData);
|
||||
L.e("解码前:" + data);
|
||||
L.e("解码前-转成base64:" + decodedData);
|
||||
L.e("解码前-解密後:" + decryptedText);
|
||||
JSONObject object = JSON.parseObject(decryptedText);
|
||||
try {
|
||||
JSONArray jsonArray = object.getJSONArray("info");
|
||||
String[] array = new String[jsonArray.size()];
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
array[i] = jsonArray.getString(i);
|
||||
}
|
||||
resultData.setInfo(array);
|
||||
resultData.setCode(object.getInteger("code"));
|
||||
resultData.setMsg(object.getString("msg"));
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
String[] array = new String[1];
|
||||
array[0] = object.getString("info");
|
||||
resultData.setInfo(array);
|
||||
resultData.setCode(object.getInteger("code"));
|
||||
resultData.setMsg(object.getString("msg"));
|
||||
} catch (JSONException ex) {
|
||||
L.e("字符串格式错误");
|
||||
}
|
||||
}
|
||||
return resultData;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
public void setData(Data data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianyonghuliebiao", LiveHttpConsts.GET_USER_LIST)
|
||||
HttpClient.getInstance().get("Live.getUserLists", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("liveuid", liveuid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
@@ -51,7 +51,7 @@ public class LiveHttpUtil {
|
||||
* @param callback 回调
|
||||
*/
|
||||
public static void getUserRankList(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaxiaofeitongji", LiveHttpConsts.GET_USER_LIST)
|
||||
HttpClient.getInstance().get("Contribute.index", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("uid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的连麦用户列表
|
||||
*/
|
||||
public static void getMicList(String liveuid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqulianmaizhuangtai", "ylahuoqulianmaizhuangtai")
|
||||
HttpClient.getInstance().get("Live.getDrLm", "Live.getDrLm")
|
||||
.params("uid", liveuid, true)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class LiveHttpUtil {
|
||||
* 获取活动列表
|
||||
*/
|
||||
public static void getHDList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquhuodongliebiao", "ylahuoquhuodongliebiao")
|
||||
HttpClient.getInstance().get("Active.getActiveList", "Active.getActiveList")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void roomCharge(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylafangjiankoufei", LiveHttpConsts.ROOM_CHARGE)
|
||||
HttpClient.getInstance().get("Live.roomCharge", LiveHttpConsts.ROOM_CHARGE)
|
||||
.params("stream", stream)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -94,7 +94,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void timeCharge(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylafangjianjishikoufei", LiveHttpConsts.TIME_CHARGE)
|
||||
HttpClient.getInstance().get("Live.timeCharge", LiveHttpConsts.TIME_CHARGE)
|
||||
.params("stream", stream)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -105,7 +105,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户余额
|
||||
*/
|
||||
public static void getCoin(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianhuoquyonghuyue", LiveHttpConsts.GET_COIN)
|
||||
HttpClient.getInstance().get("Live.getCoin", LiveHttpConsts.GET_COIN)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class LiveHttpUtil {
|
||||
* @param touid 对方的uid
|
||||
*/
|
||||
public static void getLiveRecord(String touid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquzhibojilu", LiveHttpConsts.GET_LIVE_RECORD)
|
||||
HttpClient.getInstance().get("User.getLiverecord", LiveHttpConsts.GET_LIVE_RECORD)
|
||||
.params("touid", touid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -127,7 +127,7 @@ public class LiveHttpUtil {
|
||||
* @param recordId 视频的id
|
||||
*/
|
||||
public static void getAliCdnRecord(String recordId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqulubojilu", LiveHttpConsts.GET_ALI_CDN_RECORD)
|
||||
HttpClient.getInstance().get("User.getAliCdnRecord", LiveHttpConsts.GET_ALI_CDN_RECORD)
|
||||
.params("id", recordId)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class LiveHttpUtil {
|
||||
* 获取主播印象列表
|
||||
*/
|
||||
public static void getAllImpress(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquyonghuyingxiangbiaoqian", LiveHttpConsts.GET_ALL_IMPRESS)
|
||||
HttpClient.getInstance().get("User.getUserLabel", LiveHttpConsts.GET_ALL_IMPRESS)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class LiveHttpUtil {
|
||||
* 给主播设置印象
|
||||
*/
|
||||
public static void setImpress(String touid, String ImpressIDs, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhiyonghuyingxiangbiaoqian", LiveHttpConsts.SET_IMPRESS)
|
||||
HttpClient.getInstance().get("User.setUserLabel", LiveHttpConsts.SET_IMPRESS)
|
||||
.params("touid", touid)
|
||||
.params("labels", ImpressIDs)
|
||||
.execute(callback);
|
||||
@@ -157,7 +157,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的管理员列表
|
||||
*/
|
||||
public static void getAdminList(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquguanliyuanliebiao", LiveHttpConsts.GET_ADMIN_LIST)
|
||||
HttpClient.getInstance().get("Live.getAdminList", LiveHttpConsts.GET_ADMIN_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class LiveHttpUtil {
|
||||
* 主播设置或取消直播间的管理员
|
||||
*/
|
||||
public static void setAdmin(String liveUid, String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhiguanliyuanzhuangtai", LiveHttpConsts.SET_ADMIN)
|
||||
HttpClient.getInstance().get("Live.setAdmin", LiveHttpConsts.SET_ADMIN)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
@@ -176,7 +176,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间的禁言列表
|
||||
*/
|
||||
public static void getLiveShutUpList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajinyanyonghu", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST)
|
||||
HttpClient.getInstance().get("Livemanage.getShutList", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -186,7 +186,7 @@ public class LiveHttpUtil {
|
||||
* 直播间解除禁言
|
||||
*/
|
||||
public static void liveCancelShutUp(String liveUid, String toUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajiechujinyan", LiveHttpConsts.LIVE_CANCEL_SHUT_UP)
|
||||
HttpClient.getInstance().get("Livemanage.cancelShut", LiveHttpConsts.LIVE_CANCEL_SHUT_UP)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", toUid)
|
||||
.execute(callback);
|
||||
@@ -196,7 +196,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间的拉黑列表
|
||||
*/
|
||||
public static void getLiveBlackList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylatichuyonghu", LiveHttpConsts.GET_LIVE_BLACK_LIST)
|
||||
HttpClient.getInstance().get("Livemanage.getKickList", LiveHttpConsts.GET_LIVE_BLACK_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -206,7 +206,7 @@ public class LiveHttpUtil {
|
||||
* 直播间解除拉黑
|
||||
*/
|
||||
public static void liveCancelBlack(String liveUid, String toUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajiechutichu", LiveHttpConsts.LIVE_CANCEL_BLACK)
|
||||
HttpClient.getInstance().get("Livemanage.cancelKick", LiveHttpConsts.LIVE_CANCEL_BLACK)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", toUid)
|
||||
.execute(callback);
|
||||
@@ -217,7 +217,7 @@ public class LiveHttpUtil {
|
||||
* 直播结束后,获取直播收益,观看人数,时长等信息
|
||||
*/
|
||||
public static void getLiveEndInfo(String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojieshuxinxi", LiveHttpConsts.GET_LIVE_END_INFO)
|
||||
HttpClient.getInstance().get("Live.stopInfo", LiveHttpConsts.GET_LIVE_END_INFO)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间举报内容列表
|
||||
*/
|
||||
public static void getLiveReportList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqujubaopeizhixinxi", LiveHttpConsts.GET_LIVE_REPORT_LIST)
|
||||
HttpClient.getInstance().get("Live.getReportClass", LiveHttpConsts.GET_LIVE_REPORT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class LiveHttpUtil {
|
||||
* 举报用户
|
||||
*/
|
||||
public static void setReport(String touid, String content, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylayonghujubao", LiveHttpConsts.SET_REPORT)
|
||||
HttpClient.getInstance().get("Live.setReport", LiveHttpConsts.SET_REPORT)
|
||||
.params("touid", touid)
|
||||
.params("content", content)
|
||||
.execute(callback);
|
||||
@@ -244,7 +244,7 @@ public class LiveHttpUtil {
|
||||
* 举报用户 + 图片
|
||||
*/
|
||||
public static void setReport(String touid,String report_argument, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("ylayonghujubao", LiveHttpConsts.SET_REPORT)
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT)
|
||||
.isMultipart(true)
|
||||
.params("touid", touid)
|
||||
.params("report_argument", report_argument)
|
||||
@@ -268,7 +268,7 @@ public class LiveHttpUtil {
|
||||
* 直播间点击聊天列表和头像出现的弹窗
|
||||
*/
|
||||
public static void getLiveUser(String touid, String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojiantanchuangxinxi", LiveHttpConsts.GET_LIVE_USER)
|
||||
HttpClient.getInstance().get("Live.getPop", LiveHttpConsts.GET_LIVE_USER)
|
||||
.params("touid", touid)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -278,7 +278,7 @@ public class LiveHttpUtil {
|
||||
* 主播或管理员踢人
|
||||
*/
|
||||
public static void kicking(String liveUid, String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojiantiren", LiveHttpConsts.KICKING)
|
||||
HttpClient.getInstance().get("Live.kicking", LiveHttpConsts.KICKING)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
@@ -294,7 +294,7 @@ public class LiveHttpUtil {
|
||||
* @param time 禁言时间 (分)
|
||||
*/
|
||||
public static void setShutUp(String liveUid, String stream, int type, String touid, String time, HttpCallback callback) {
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("ylazhibojianjinyan", LiveHttpConsts.SET_SHUT_UP)
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("Live.setShutUp", LiveHttpConsts.SET_SHUT_UP)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
@@ -312,7 +312,7 @@ public class LiveHttpUtil {
|
||||
* @param type 0表示关闭当前直播 1表示禁播,2表示封禁账号
|
||||
*/
|
||||
public static void superCloseRoom(String liveUid, int type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylachaoguanguanbo", LiveHttpConsts.SUPER_CLOSE_ROOM)
|
||||
HttpClient.getInstance().get("Live.superStopRoom", LiveHttpConsts.SUPER_CLOSE_ROOM)
|
||||
.params("liveuid", liveUid)
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
@@ -323,7 +323,7 @@ public class LiveHttpUtil {
|
||||
* 守护商品类型列表
|
||||
*/
|
||||
public static void getGuardBuyList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashouhuliebiaov2", LiveHttpConsts.GET_GUARD_BUY_LIST)
|
||||
HttpClient.getInstance().get("Guard.getList", LiveHttpConsts.GET_GUARD_BUY_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public class LiveHttpUtil {
|
||||
* 购买守护接口
|
||||
*/
|
||||
public static void buyGuard(String liveUid, String stream, int guardId, int cid, HttpCallback callback) {
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("ylagoumaishouhu", LiveHttpConsts.BUY_GUARD)
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("Guard.buyGuard", LiveHttpConsts.BUY_GUARD)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("guardid", guardId);
|
||||
@@ -347,13 +347,14 @@ public class LiveHttpUtil {
|
||||
* 查看主播的守护列表
|
||||
*/
|
||||
public static void getGuardList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashouhuliebiao", LiveHttpConsts.GET_GUARD_LIST)
|
||||
HttpClient.getInstance().get("Guard.getGuardList", LiveHttpConsts.GET_GUARD_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getContactMsg(int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqulianxifangshixiaoxi", "huoqulianxifangshixiaoxi")
|
||||
HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg")
|
||||
.params("p", page)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -362,7 +363,7 @@ public class LiveHttpUtil {
|
||||
* 观众跟主播连麦时,获取自己的流地址
|
||||
*/
|
||||
public static void getLinkMicStream(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylalianmaituilaliudizhi", LiveHttpConsts.GET_LINK_MIC_STREAM)
|
||||
HttpClient.getInstance().get("Linkmic.requestLVBAddrForLinkMic", LiveHttpConsts.GET_LINK_MIC_STREAM)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -373,7 +374,7 @@ public class LiveHttpUtil {
|
||||
* @param pull_url 连麦用户播流地址
|
||||
*/
|
||||
public static void linkMicShowVideo(String touid, String pull_url) {
|
||||
HttpClient.getInstance().get("ylalianmaixinxi", LiveHttpConsts.LINK_MIC_SHOW_VIDEO)
|
||||
HttpClient.getInstance().get("Live.showVideo", LiveHttpConsts.LINK_MIC_SHOW_VIDEO)
|
||||
.params("liveuid", CommonAppConfig.getInstance().getUid())
|
||||
.params("touid", touid)
|
||||
.params("pull_url", pull_url)
|
||||
@@ -389,7 +390,7 @@ public class LiveHttpUtil {
|
||||
* 主播设置是否允许观众发起连麦
|
||||
*/
|
||||
public static void setLinkMicEnable(boolean linkMicEnable, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhilianmaikaiguan", LiveHttpConsts.SET_LINK_MIC_ENABLE)
|
||||
HttpClient.getInstance().get("Linkmic.setMic", LiveHttpConsts.SET_LINK_MIC_ENABLE)
|
||||
.params("ismic", linkMicEnable ? 1 : 0)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -399,7 +400,7 @@ public class LiveHttpUtil {
|
||||
* 观众检查主播是否允许连麦
|
||||
*/
|
||||
public static void checkLinkMicEnable(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylapanduanzhubaoshifoukaiqilianmai", LiveHttpConsts.CHECK_LINK_MIC_ENABLE)
|
||||
HttpClient.getInstance().get("Linkmic.isMic", LiveHttpConsts.CHECK_LINK_MIC_ENABLE)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -408,7 +409,7 @@ public class LiveHttpUtil {
|
||||
* 连麦pk检查对方主播在线状态
|
||||
*/
|
||||
public static void livePkCheckLive(String liveUid, String stream, String uidStream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqupkzhuangtai", "huoqupkzhuangtai")
|
||||
HttpClient.getInstance().get("Home.getisPk", "Home.getisPk")
|
||||
.params("uid", liveUid, true)
|
||||
// .params("token", CommonAppConfig.getInstance().getToken())
|
||||
// .params("liveuid", liveUid)
|
||||
@@ -473,7 +474,7 @@ public class LiveHttpUtil {
|
||||
* 发送弹幕
|
||||
*/
|
||||
public static void sendDanmu(String content, String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylafasongdanmu", LiveHttpConsts.SEND_DANMU)
|
||||
HttpClient.getInstance().get("Live.sendBarrage", LiveHttpConsts.SEND_DANMU)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", "1")
|
||||
@@ -489,7 +490,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void checkLive(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajianchazhibo", LiveHttpConsts.CHECK_LIVE)
|
||||
HttpClient.getInstance().get("Live.checkLive", LiveHttpConsts.CHECK_LIVE)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -500,13 +501,33 @@ public class LiveHttpUtil {
|
||||
* 观众进入直播间
|
||||
*/
|
||||
public static void enterRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajinruzhibojian", LiveHttpConsts.ENTER_ROOM)
|
||||
HttpClient.getInstance().get("Live.enterRoom", LiveHttpConsts.ENTER_ROOM)
|
||||
.params("city", CommonAppConfig.getInstance().getCity())
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众进入直播间后,还要请求一次
|
||||
*/
|
||||
public static void enterBackRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.userjoinroom", "Tx.userjoinroom")
|
||||
.params("GroupId", "g" + liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众退出直播间后,还要请求一次
|
||||
*/
|
||||
public static void qBackRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.leave_room", "Tx.leave_room")
|
||||
.params("GroupId", "g" + liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱
|
||||
*/
|
||||
@@ -519,14 +540,7 @@ public class LiveHttpUtil {
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版)
|
||||
*/
|
||||
public static void getNewGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianliwuxinxi", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版) -用于获取联系方式时的礼物设置
|
||||
*/
|
||||
public static void getHotGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqusuoyouremenliwu", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -534,7 +548,7 @@ public class LiveHttpUtil {
|
||||
* 获取包裹列表
|
||||
*/
|
||||
public static void getWrapList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianbaoguoxinxi", LiveHttpConsts.GET_WRAP_LIST)
|
||||
HttpClient.getInstance().get("Live.getPackList", LiveHttpConsts.GET_WRAP_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -542,7 +556,7 @@ public class LiveHttpUtil {
|
||||
* 主播获取心愿单列表
|
||||
*/
|
||||
public static void getWishList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquxinyuandan", LiveHttpConsts.GET_WISH_LIST)
|
||||
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -550,7 +564,7 @@ public class LiveHttpUtil {
|
||||
* 用户获取主播的心愿单列表
|
||||
*/
|
||||
public static void getWishList(String liveId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquxinyuandan", LiveHttpConsts.GET_WISH_LIST)
|
||||
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
|
||||
.params("uid", liveId, true)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -561,7 +575,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getFrontTask(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquxinshouyindaozhuangtai", "huoquxinshouyindaozhuangtai")
|
||||
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -571,7 +585,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getFrontTask(String Token, String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquxinshouyindaozhuangtai", "huoquxinshouyindaozhuangtai")
|
||||
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
|
||||
.params("token", Token, true)
|
||||
.params("uid", uid, true)
|
||||
.execute(callback);
|
||||
@@ -581,7 +595,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -590,7 +604,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("type", type)
|
||||
.params("liveuid", liveuid)
|
||||
.execute(callback);
|
||||
@@ -600,7 +614,7 @@ public class LiveHttpUtil {
|
||||
* 修改心愿单列表
|
||||
*/
|
||||
public static void modifyWishList(String list, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhixinyuandan", LiveHttpConsts.SET_WISH_LIST)
|
||||
HttpClient.getInstance().get("Guide.setWishlist", LiveHttpConsts.SET_WISH_LIST)
|
||||
.params("list", list)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -622,7 +636,7 @@ public class LiveHttpUtil {
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianzengsongliwu", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -633,13 +647,14 @@ public class LiveHttpUtil {
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众给主播送礼物 - 包裹
|
||||
*
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGiftForPage(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianzengsongbaoguoliwu", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("Live.sendPackGift", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -650,13 +665,14 @@ public class LiveHttpUtil {
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众给主播送礼物 - 粉丝团
|
||||
*
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGiftForFansGroup(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazengsongfensituanbaoguoliwu", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("Live.fansExclusivePack", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -667,8 +683,9 @@ public class LiveHttpUtil {
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylamangheshiyongquan", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -697,7 +714,7 @@ public class LiveHttpUtil {
|
||||
* 点亮發IM
|
||||
*/
|
||||
public static void sendZAN(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashuangjidianliang", "shuangjidianliang")
|
||||
HttpClient.getInstance().get("Fans.doubleClickLight", "Fans.DoubleClickLight")
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -706,7 +723,7 @@ public class LiveHttpUtil {
|
||||
* 连麦pk搜索主播
|
||||
*/
|
||||
public static void livePkSearchAnchor(String key, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylasousuozhiboyonghu", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR)
|
||||
HttpClient.getInstance().get("Livepk.search", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR)
|
||||
.params("key", key)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -717,7 +734,7 @@ public class LiveHttpUtil {
|
||||
* 获取主播连麦pk列表
|
||||
*/
|
||||
public static void getLivePkList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquzhiboyonghuliebiao", LiveHttpConsts.GET_LIVE_PK_LIST)
|
||||
HttpClient.getInstance().get("Livepk.getLiveList", LiveHttpConsts.GET_LIVE_PK_LIST)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -754,7 +771,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType,boolean isSw, HttpCallback callback) {
|
||||
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("ylachuangjianzhibov2", LiveHttpConsts.CREATE_ROOM)
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
|
||||
.params("title", title)
|
||||
.params("liveclassid", liveClassId)
|
||||
.params("type", type)
|
||||
@@ -773,7 +790,7 @@ public class LiveHttpUtil {
|
||||
* 修改直播状态
|
||||
*/
|
||||
public static void changeLive(String stream) {
|
||||
HttpClient.getInstance().get("ylaxiugaizhibozhuangtai", LiveHttpConsts.CHANGE_LIVE)
|
||||
HttpClient.getInstance().get("Live.changeLive", LiveHttpConsts.CHANGE_LIVE)
|
||||
.params("stream", stream)
|
||||
.params("status", "1")
|
||||
.execute(new HttpCallback() {
|
||||
@@ -788,7 +805,7 @@ public class LiveHttpUtil {
|
||||
* 主播结束直播
|
||||
*/
|
||||
public static void stopLive(String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaguanbizhibo", LiveHttpConsts.STOP_LIVE)
|
||||
HttpClient.getInstance().get("Live.stopRoom", LiveHttpConsts.STOP_LIVE)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -797,12 +814,12 @@ public class LiveHttpUtil {
|
||||
* 主播开播前获取sdk类型 0金山 1腾讯
|
||||
*/
|
||||
public static void getLiveSdk(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqusdk", LiveHttpConsts.GET_LIVE_SDK)
|
||||
HttpClient.getInstance().get("Live.getSDK", LiveHttpConsts.GET_LIVE_SDK)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getisRong(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashifouweirongyunzhubo", "shifouweirongyunzhubo")
|
||||
HttpClient.getInstance().get("Live.isRong", "Live.isRong")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -811,7 +828,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getIsSw(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhiyuanshengduanshengwangpeizhi", "shezhiyuanshengduanshengwangpeizhi")
|
||||
HttpClient.getInstance().get("Tx.setRtcFirm", "Tx.setRtcFirm")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -819,7 +836,7 @@ public class LiveHttpUtil {
|
||||
* 腾讯sdk 跟主播连麦时,获取主播的低延时流
|
||||
*/
|
||||
public static void getTxLinkMicAccUrl(String originStreamUrl, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajianquanliudizhi", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL)
|
||||
HttpClient.getInstance().get("Linkmic.requestPlayUrlWithSignForLinkMic", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL)
|
||||
.params("originStreamUrl", originStreamUrl)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -829,7 +846,7 @@ public class LiveHttpUtil {
|
||||
* 连麦时候 主播混流
|
||||
*/
|
||||
public static void linkMicTxMixStream(String mergeparams) {
|
||||
HttpClient.getInstance().get("ylalianmaihunliu", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM)
|
||||
HttpClient.getInstance().get("Linkmic.mergeVideoStream", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM)
|
||||
.params("mergeparams", mergeparams)
|
||||
.execute(CommonHttpUtil.NO_CALLBACK);
|
||||
}
|
||||
@@ -839,7 +856,7 @@ public class LiveHttpUtil {
|
||||
* 我是哪些直播间的管理员,返回这些直播间列表
|
||||
*/
|
||||
public static void getMyAdminRoomList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquwodefangjian", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST)
|
||||
HttpClient.getInstance().get("Livemanage.getRoomList", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -849,7 +866,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间奖池等级
|
||||
*/
|
||||
public static void getLiveGiftPrizePool(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquyindaoyexinxi", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL)
|
||||
HttpClient.getInstance().get("Jackpot.getJackpot", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -859,7 +876,7 @@ public class LiveHttpUtil {
|
||||
* 主播checkLive
|
||||
*/
|
||||
public static void anchorCheckLive(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylajiancefangjiangzhuangtai", LiveHttpConsts.ANCHOR_CHECK_LIVE)
|
||||
HttpClient.getInstance().get("Live.checkLiveing", LiveHttpConsts.ANCHOR_CHECK_LIVE)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -870,7 +887,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间信息
|
||||
*/
|
||||
public static void getLiveInfo(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquzhiboxinxi", LiveHttpConsts.GET_LIVE_INFO)
|
||||
HttpClient.getInstance().get("Live.getLiveInfo", LiveHttpConsts.GET_LIVE_INFO)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -881,7 +898,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getHcGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquliwudonghualiebiao", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("Live.getSvgaList", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -891,7 +908,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getHczGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylayuxiazai", "yuxiazai")
|
||||
HttpClient.getInstance().get("Home.aoto_load", "Home.aoto_load")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -900,21 +917,29 @@ public class LiveHttpUtil {
|
||||
* 获取活动
|
||||
*/
|
||||
public static void geteEvent(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuodongpeizhixinxi", LiveHttpConsts.GET_EVENT)
|
||||
HttpClient.getInstance().get("Rank.isActivity", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchorUid", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
public static void getAnchorActiveImgStatus(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquzhuboxunfuchuangzhuangtai", LiveHttpConsts.GET_EVENT)
|
||||
HttpClient.getInstance().get("Live.getAnchorActiveImgStatus", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchorUid", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 重置活动
|
||||
*/
|
||||
public static void setEvent(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Rank.crystalTimeEnd", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 整蛊转盘拯救主播
|
||||
*/
|
||||
public static void userHopePrankTurntable(String anchor_id, String prankid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylayonghuzhengjiuzhubo", LiveHttpConsts.USERHOPEPRANKTURNTABLE)
|
||||
HttpClient.getInstance().get("Prank.userHopePrankTurntable", LiveHttpConsts.USERHOPEPRANKTURNTABLE)
|
||||
.params("prankid", prankid)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
@@ -924,7 +949,7 @@ public class LiveHttpUtil {
|
||||
* 倒计时结束
|
||||
*/
|
||||
public static void endPrankTurntable(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhenggudaojishijieshu", LiveHttpConsts.ENDPRANKTURNTABLE)
|
||||
HttpClient.getInstance().get("Prank.endPrankTurntable", LiveHttpConsts.ENDPRANKTURNTABLE)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -933,7 +958,7 @@ public class LiveHttpUtil {
|
||||
* 周星榜数据
|
||||
*/
|
||||
public static void getAnchorLastWeekList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqushangzhouzhouxingbangzhubo", LiveHttpConsts.GETANCHORLASTWEEKLIST)
|
||||
HttpClient.getInstance().get("WeekStar.getAnchorLastWeekList", LiveHttpConsts.GETANCHORLASTWEEKLIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -941,7 +966,7 @@ public class LiveHttpUtil {
|
||||
* 热度加成列表
|
||||
*/
|
||||
public static void useHotCardUserList(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaredukayonghuliebiao", LiveHttpConsts.USEHOTCARDUSERLIST)
|
||||
HttpClient.getInstance().get("Live.useHotCardUserList", LiveHttpConsts.USEHOTCARDUSERLIST)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -950,7 +975,7 @@ public class LiveHttpUtil {
|
||||
* 是否有热度加成
|
||||
*/
|
||||
public static void isHotCard(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibozhongshifoushiyongreduka", LiveHttpConsts.ISHOTCARD)
|
||||
HttpClient.getInstance().get("Live.isHotCard", LiveHttpConsts.ISHOTCARD)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -959,7 +984,7 @@ public class LiveHttpUtil {
|
||||
* 修改im备注信息
|
||||
*/
|
||||
public static void setInstructorRemark(String touid, String remark, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhiyonghubeizhuming", LiveHttpConsts.SETINSTRUCTORREMARK)
|
||||
HttpClient.getInstance().get("User.setInstructorRemark", LiveHttpConsts.SETINSTRUCTORREMARK)
|
||||
.params("touid", touid)
|
||||
.params("remark", remark)
|
||||
.execute(callback);
|
||||
@@ -969,7 +994,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void getNobleTrumpetNum(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquguizulabashuliang", "huoquguizulabashuliang")
|
||||
HttpClient.getInstance().get("Noble.getNobleTrumpetNum", "getNobleTrumpetNum")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -977,7 +1002,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void nobleUseTrumpet(String trumpet_msg, String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylaguizushiyonglaba", "guizushiyonglaba")
|
||||
HttpClient.getInstance().get("Noble.nobleUseTrumpet", "nobleUseTrumpet")
|
||||
.params("", trumpet_msg)
|
||||
.params("", anchor_id)
|
||||
.execute(callback);
|
||||
@@ -987,7 +1012,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void getStarChallengeStatus(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquxingjitiaozhanzhuangtai", "huoquxingjitiaozhanzhuangtai")
|
||||
HttpClient.getInstance().get("StarChallenge.getStarChallengeStatus", "StarChallengeStatus")
|
||||
.params("liveUid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -996,14 +1021,14 @@ public class LiveHttpUtil {
|
||||
* 首页关注直播
|
||||
*/
|
||||
public static void getHomeFollow(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquguanzhuzhuboliebiao", "huoquguanzhuzhuboliebiao")
|
||||
HttpClient.getInstance().get("Home.getFollow", "Home.getFollow")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
|
||||
}
|
||||
|
||||
public static void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoquyouxiliebiao", "huoquyouxiliebiao")
|
||||
HttpClient.getInstance().get("Sudgameserver.getRoomList", "Sudgameserver.getRoomList")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("threshold", threshold)
|
||||
.params("room_holder_type", roomHolderType)
|
||||
@@ -1023,7 +1048,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void gameRecord(String sudGameId, String currencyType, String dateType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylachaxunyouxijilu", "chaxunyouxijilu")
|
||||
HttpClient.getInstance().get("Sudgameserver.gameRecord", "Sudgameserver.gameRecord")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("currency_type", currencyType)
|
||||
.params("date_type", dateType)
|
||||
@@ -1035,9 +1060,8 @@ public class LiveHttpUtil {
|
||||
* 获取短剧Url
|
||||
*/
|
||||
public static void getCoolydrama(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("yladuanjuzhanghaozhuce", "duanjuzhanghaozhuce")
|
||||
HttpClient.getInstance().get("cool.register", "Home.getFollow")
|
||||
.params("lang", WordUtil.isNewZh() ? "zh_CN" : "en")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2358,7 +2358,6 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
//TODO 合并后有POPO了一个参数
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseData;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -56,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, "", "Android", WordUtil.isNewZh()?"chinese":"english",RongcloudIMManager.RONG_IM_KEY)
|
||||
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android", WordUtil.isNewZh()?"chinese":"english")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||
|
||||
@@ -457,7 +457,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private Runnable isInstructorRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
HttpClient.getInstance().get("ylashifouweituiguangzhanghao", "ylashifouweituiguangzhanghao\n")
|
||||
HttpClient.getInstance().get("User.isInstructor", "isInstructor")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.params("token", userInfo.getToken(), true)
|
||||
.execute(new HttpCallback() {
|
||||
@@ -533,10 +533,9 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
String uid = uidAndToken[0];
|
||||
String token = uidAndToken[1];
|
||||
if (TextUtils.isEmpty(token)) return;
|
||||
HttpClient.getInstance().get("ylahuoquyonghujibenxinxiv2", "ylahuoquyonghujibenxinxiv2")
|
||||
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) {
|
||||
@@ -555,7 +554,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public void updateUserCoin() {
|
||||
HttpClient.getInstance().get("ylachaxunyonghuyue", "ylachaxunyonghuyue")
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -573,7 +572,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public void updateUserCoin(OnItemClickListener<JSONObject> listener) {
|
||||
HttpClient.getInstance().get("ylachaxunyonghuyue", "ylachaxunyonghuyue")
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
@@ -123,8 +123,7 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void run() {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
if(userInfo==null)return;
|
||||
HttpClient.getInstance().get("ylahuoqutuiguangbeizhumingliebiao", "ylahuoqutuiguangbeizhumingliebiao")
|
||||
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.params("token", userInfo.getToken(), true)
|
||||
.execute(new HttpCallback() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class NoviceInstructorManager extends BaseCacheManager {
|
||||
IMLoginModel userModel = new Gson().fromJson(model1.getExtra(), IMLoginModel.class);
|
||||
if (userModel != null && TextUtils.equals(userModel.getIsAdmin(), "1")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
HttpClient.getInstance().get("ylashezhizhidaoyuanxiaoxizhuangtai", "ylashezhizhidaoyuanxiaoxizhuangtai")
|
||||
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
|
||||
@@ -131,7 +131,7 @@ public class MessageIMManager {
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("ylahuoquxitongxiaoxiliebiaov2", "ylahuoquxitongxiaoxiliebiaov2")
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
.params("uid", userInfo.getId())
|
||||
.params("token", userInfo.getToken())
|
||||
.execute(new HttpCallback() {
|
||||
@@ -195,7 +195,7 @@ public class MessageIMManager {
|
||||
public void getSystemMessages(SystemMessagesHttpCallback callback) {
|
||||
systemNumber = 0;
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
HttpClient.getInstance().get("ylahuoquxitongxiaoxiliebiaov2", "ylahuoquxitongxiaoxiliebiaov2")
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
.params("uid", userInfo.getId())
|
||||
.params("token", userInfo.getToken())
|
||||
.execute(new HttpCallback() {
|
||||
|
||||
@@ -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,7 +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);
|
||||
|
||||
@@ -54,29 +54,14 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
public void complete(String key, ResponseInfo info, JSONObject response) {
|
||||
System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||
/* try {
|
||||
try {
|
||||
assert response != null;
|
||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||
} catch (JSONException e) {
|
||||
// throw new RuntimeException(e);
|
||||
L.e(e);
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (response == null) {
|
||||
// Handle the null case, e.g., log an error, throw a specific exception, etc.
|
||||
L.e("Response is null");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||
} catch (JSONException e) {
|
||||
L.e(e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mList == null || mList.size() == 0) {
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, false);
|
||||
@@ -159,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class AesUtils {
|
||||
/**
|
||||
* 使用AES/ECB/PKCS5Padding模式解密数据
|
||||
*
|
||||
* @param encryptedData 加密后的字节数组(Base64解码后的结果,如果原始数据是Base64编码的话)
|
||||
* @param keyBytes AES密钥(16/24/32字节长,对应AES-128/192/256)
|
||||
* @return 解密后的明文字节数组,如果解密失败则返回null
|
||||
*/
|
||||
public static byte[] decrypt(byte[] encryptedData, byte[] keyBytes) {
|
||||
try {
|
||||
// 创建密钥规格
|
||||
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES-128-ECB");
|
||||
|
||||
// 获取Cipher实例并初始化为解密模式
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||
// 执行解密
|
||||
byte[] decryptedBytes = cipher.doFinal(encryptedData);
|
||||
// 返回解密后的字节数组
|
||||
return decryptedBytes;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null; // 解密失败时返回null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果需要将解密后的字节数组转换为字符串(注意:这可能会导致数据丢失或乱码)
|
||||
*
|
||||
* @param encryptedData 加密后的字节数组(或Base64解码后的结果)
|
||||
* @return 解密后的字符串,如果解密失败则返回null
|
||||
*/
|
||||
public static String decryptToString(byte[] encryptedData) {
|
||||
byte[] decryptedBytes = decrypt(encryptedData,"LhHBfcsN2VmBpHCn".getBytes());
|
||||
if (decryptedBytes != null) {
|
||||
// 尝试将字节数组转换为字符串(使用指定的字符集)
|
||||
try {
|
||||
return decodeUnicode(new String(decryptedBytes, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String decodeUnicode(String unicode) {
|
||||
/* StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < unicode.length();) {
|
||||
if (unicode.charAt(i) == '\\') {
|
||||
if (i + 5 < unicode.length()) {
|
||||
String codePointStr = unicode.substring(i + 2, i + 6);
|
||||
try {
|
||||
int codePoint = Integer.parseInt(codePointStr, 16);
|
||||
sb.append((char) codePoint);
|
||||
i += 6;
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
// Handle format error
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append(unicode.charAt(i++));
|
||||
}*/
|
||||
return JSON.parseObject(unicode).toString();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -619,7 +618,7 @@ public class JavascriptInterfaceUtils {
|
||||
@JavascriptInterface
|
||||
public void androidClickToTaskPage() {
|
||||
ARouter.getInstance().build(PATH_REWARD).withString("url",
|
||||
CommonAppConfig.HOST + "/h5/task/index.html?uid=" + CommonAppConfig.getInstance().getUid()
|
||||
CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid()
|
||||
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
|
||||
}
|
||||
|
||||
@@ -657,10 +656,9 @@ public class JavascriptInterfaceUtils {
|
||||
|
||||
@JavascriptInterface
|
||||
public void wearOrCancelFanMedal() {
|
||||
HttpClient.getInstance().get("ylahuoquyonghujibenxinxiv2", "ylahuoquyonghujibenxinxiv2")
|
||||
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) {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class MicStatusManager {
|
||||
* 断开连麦
|
||||
*/
|
||||
public void downMic() {
|
||||
HttpClient.getInstance().get("ylatuichuduorenlianmai", "ylatuichuduorenlianmai")
|
||||
HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm")
|
||||
.params("roomid", micLiveId)
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.execute(new HttpCallback() {
|
||||
|
||||
@@ -3,22 +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 android.util.Log;
|
||||
|
||||
|
||||
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;
|
||||
@@ -48,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;
|
||||
@@ -93,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);
|
||||
}
|
||||
@@ -127,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);
|
||||
@@ -176,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启摄像头,执行照相
|
||||
@@ -244,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);
|
||||
@@ -304,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;
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public class RouteUtil {
|
||||
* 跳转到充值页面
|
||||
*/
|
||||
public static void forwardMyCoin(Context context) {
|
||||
String url = CommonAppConfig.HOST + "/h5/Mall/zhifu.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=zhifu&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
ARouter.getInstance().build(PATH_COIN).withString("url", url).navigation();
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -43,6 +43,11 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
|
||||
}
|
||||
|
||||
public void onConfigureChange() {
|
||||
//如果 mParentView
|
||||
}
|
||||
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
public abstract void init();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import java.util.List;
|
||||
public class NineGridLayout extends FrameLayout {
|
||||
|
||||
private Context mContext;
|
||||
private int fullWidth1;
|
||||
private int mWidth1;
|
||||
private int mWidth2;
|
||||
private int mWidth3;
|
||||
@@ -34,11 +33,7 @@ public class NineGridLayout extends FrameLayout {
|
||||
private LayoutParams[] mLayoutParamsArray;
|
||||
private OnClickListener mOnClickListener;
|
||||
private List<?> mDataList;
|
||||
private Boolean onIsFUll = false;
|
||||
|
||||
public void setOnIsFUll(Boolean onIsFUll) {
|
||||
this.onIsFUll = onIsFUll;
|
||||
}
|
||||
|
||||
public NineGridLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -62,13 +57,8 @@ public class NineGridLayout extends FrameLayout {
|
||||
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
||||
float scale = dm.density;
|
||||
int width = dm.widthPixels - space;
|
||||
fullWidth1= width;
|
||||
|
||||
mDividerWidth = dividerWidth;
|
||||
|
||||
mWidth1 = (int) (scale * 220 + 0.5f);
|
||||
|
||||
|
||||
mWidth2 = (width - dividerWidth) / 2;
|
||||
mWidth3 = (width - dividerWidth * 2) / 3;
|
||||
mOnClickListener = new OnClickListener() {
|
||||
@@ -109,25 +99,15 @@ public class NineGridLayout extends FrameLayout {
|
||||
if (dataSize == 1) {
|
||||
RoundedImageView imageView = mViewList.get(0);
|
||||
if (mLayoutParams00 == null) {
|
||||
if (onIsFUll){
|
||||
mLayoutParams00 = new LayoutParams(fullWidth1, fullWidth1);
|
||||
}else {
|
||||
mLayoutParams00 = new LayoutParams(mWidth1, mWidth1);
|
||||
}
|
||||
|
||||
}
|
||||
if (imageView.getLayoutParams() != mLayoutParams00) {
|
||||
imageView.setLayoutParams(mLayoutParams00);
|
||||
}
|
||||
if (imageView.getVisibility() != VISIBLE) {
|
||||
imageView.setVisibility(VISIBLE);
|
||||
}
|
||||
if (onIsFUll){
|
||||
setHeight(fullWidth1);
|
||||
}else {
|
||||
setHeight(mWidth1);
|
||||
}
|
||||
|
||||
if (mActionListener != null) {
|
||||
mActionListener.displayImage(list.get(0), imageView);
|
||||
}
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.event.LiveOpenSudRoomEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.event.SudGameListRefreshEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class SudGameListViewHolder2 extends RecyclerView.ViewHolder {
|
||||
|
||||
public RoundedImageView avatar;
|
||||
public ImageView btnLive;
|
||||
public ImageView topBgImg;
|
||||
public ImageView goldCoin;
|
||||
public TextView goldenBeanNumber;
|
||||
public TextView roomName;
|
||||
public TextView gameNumberTv;
|
||||
public TextView roomNumberTv;
|
||||
|
||||
|
||||
public SudGameListViewHolder2(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
btnLive = itemView.findViewById(R.id.btn_live);
|
||||
topBgImg = itemView.findViewById(R.id.topBgImg);
|
||||
goldCoin = itemView.findViewById(R.id.gold_coin);
|
||||
goldenBeanNumber = itemView.findViewById(R.id.golden_bean_number);
|
||||
roomName = itemView.findViewById(R.id.room_name);
|
||||
gameNumberTv = itemView.findViewById(R.id.gameNumberTv);
|
||||
roomNumberTv = itemView.findViewById(R.id.roomNumberTv);
|
||||
}
|
||||
|
||||
public void setData(SudRoomListModel model) {
|
||||
ImgLoader.display(itemView.getContext(), model.getAvatar(), avatar);
|
||||
roomName.setText(model.getRoomName());
|
||||
|
||||
// playerWeAre.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are), model.getPlayerTotal()));
|
||||
// playerWeAre2.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are_2), model.getTotal()));
|
||||
// gifImageView.setVisibility(TextUtils.equals(model.getLiveUid(), "0") ? View.GONE : View.VISIBLE);
|
||||
|
||||
gameNumberTv.setText(gameNumberTv.getContext().getString(R.string.number_of_players)+":"+model.getTotal());
|
||||
roomNumberTv.setText(gameNumberTv.getContext().getString(R.string.number_of_online)+":"+model.getPlayerTotal() );
|
||||
|
||||
|
||||
goldenBeanNumber.setText(model.getGoldenBeanNumber());
|
||||
if (TextUtils.equals(model.getCurrencyType(), "2")) {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.icon_collectibles, goldCoin);
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.ic_yola_game_dou, goldCoin);
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(itemView.getContext()).checkRoomStatus(model.getId(), new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (TextUtils.equals(data.getRoomStatus(), "0")) {
|
||||
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("房间不存在");
|
||||
} else {
|
||||
ToastUtil.show("The room does not exist");
|
||||
}
|
||||
Bus.get().post(new SudGameListRefreshEvent());
|
||||
} else {
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
createSudRoomModel.setSudGameId(model.getSudGameId());
|
||||
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
|
||||
createSudRoomModel.setAvatar(model.getAvatar());
|
||||
createSudRoomModel.setRoomName(model.getRoomName());
|
||||
createSudRoomModel.setSudGameName(model.getSudGameName());
|
||||
if (TextUtils.equals(model.getLiveUid(), "0")) {
|
||||
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), true, true);
|
||||
} else {
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, true);
|
||||
}
|
||||
} else {
|
||||
String yes = "是";
|
||||
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
yes = "是";
|
||||
} else {
|
||||
yes = "Yes";
|
||||
}
|
||||
new XPopup.Builder(itemView.getContext())
|
||||
.asCustom(new HintCustomPopup(itemView.getContext(),
|
||||
itemView.getContext().getString(R.string.interactive_game_search_room_currently_live),
|
||||
itemView.getContext().getString(R.string.interactive_game_search_room_broadcast_room))
|
||||
.setLiveOpenOk(yes)
|
||||
.setLiveOpenCancel(itemView.getContext().getString(R.string.interactive_game_search_room_bhe_game))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
LiveHttpUtil.getLiveInfo(model.getLiveUid() + "", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw);
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(itemView.getContext(), model.getLiveUid(), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), true, true);
|
||||
} else {
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, true);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import kotlin.Unit;
|
||||
|
||||
/**
|
||||
* View防抖
|
||||
*/
|
||||
public class OnClickShakeListener implements View.OnClickListener{
|
||||
|
||||
|
||||
private long mDuration=800;
|
||||
private View.OnClickListener mListener;
|
||||
private long lastTime=0;
|
||||
public OnClickShakeListener(View.OnClickListener listener){
|
||||
mListener=listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (System.currentTimeMillis()-lastTime<mDuration){
|
||||
return;
|
||||
}
|
||||
lastTime=System.currentTimeMillis();
|
||||
mListener.onClick(v);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#fff"/>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:radius="16dp"/>
|
||||
<solid android:color="#2A2C3B" />
|
||||
</shape>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:radius="10dp"/>
|
||||
<solid android:color="#FFF" />
|
||||
</shape>
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="68dp" android:height="37dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#FFF5E997" />
|
||||
<stroke android:width="1dp" android:color="#EB6FFF" />
|
||||
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp"
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp" />
|
||||
<solid android:color="#FEE540"/>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -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>
|
||||
|
Before Width: | Height: | Size: 77 KiB |
@@ -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>
|
||||
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
@@ -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
@@ -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>
|
||||
@@ -1,35 +1,30 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/bg_loading_dialog"
|
||||
android:minWidth="70dp"
|
||||
android:minHeight="70dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading"
|
||||
android:indeterminateOnly="true" />
|
||||
android:indeterminateOnly="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:maxWidth="140dp"
|
||||
android:gravity="center"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/loading"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout_width="94dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gameBg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:src="@mipmap/ic_yola_game_bg_1"
|
||||
app:layout_constraintDimensionRatio="1.32"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gameIcon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@mipmap/ic_yola_game_1"
|
||||
app:layout_constraintDimensionRatio="1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.48" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gameIcon"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gameIcon"
|
||||
app:layout_constraintVertical_bias="0.36" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gameName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/interactive_game_room_all"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:textColor="@color/color_111111"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gameBg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/gameBg"
|
||||
app:layout_constraintStart_toStartOf="@+id/gameBg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gameIcon"
|
||||
app:layout_constraintVertical_bias="0.34" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_f2edd7_10">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.14"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
android:layout_marginBottom="-8dp"
|
||||
android:id="@+id/btn_live"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@mipmap/icon_user_game_living"
|
||||
tools:visibility="gone"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/topBgImg"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_percent="0.14"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="2.66"
|
||||
android:src="@mipmap/ic_yola_game_radus"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gold_coin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
app:layout_constraintDimensionRatio="1"
|
||||
android:background="@mipmap/ic_yola_game_dou"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/topBgImg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/topBgImg"
|
||||
app:layout_constraintHorizontal_bias="0.78"
|
||||
app:layout_constraintStart_toStartOf="@+id/topBgImg"
|
||||
app:layout_constraintTop_toTopOf="@+id/topBgImg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/golden_bean_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="1dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/topBgImg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gold_coin"
|
||||
app:layout_constraintTop_toTopOf="@+id/topBgImg"
|
||||
tools:text="1000"
|
||||
android:textColor="#FFBA8232"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/interactive_game_create_room_name"
|
||||
android:textColor="#222"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar"
|
||||
app:layout_constraintVertical_bias="0.16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gameNumberTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_players"
|
||||
android:textColor="#777"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintVertical_bias="0.6"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
app:layout_constraintStart_toStartOf="@+id/room_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/room_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roomNumberTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_online"
|
||||
android:textColor="#777"
|
||||
android:textSize="11sp"
|
||||
android:layout_marginStart="9dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gameNumberTv"
|
||||
app:layout_constraintStart_toEndOf="@+id/gameNumberTv"
|
||||
app:layout_constraintTop_toTopOf="@+id/gameNumberTv" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||