Compare commits
161 Commits
新潘多拉上架修改
...
新潘多拉_6.8.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c6189db11 | ||
|
|
c166d0a476 | ||
|
|
a220408853 | ||
|
|
c55b262926 | ||
|
|
461a985799 | ||
|
|
5c369f7215 | ||
|
|
3ddcc944c0 | ||
|
|
7b2f853f2e | ||
|
|
636f5ded6f | ||
|
|
bebfbb3f02 | ||
|
|
eee2648277 | ||
|
|
87e372e8f9 | ||
|
|
fb09b8ef35 | ||
|
|
ecb44e510a | ||
|
|
6b9d951c55 | ||
|
|
f528353dd0 | ||
|
|
54cf21092c | ||
|
|
2799991ef3 | ||
|
|
8efa3b62e2 | ||
|
|
eed77f989f | ||
|
|
417a9ac628 | ||
|
|
1be00c75c4 | ||
|
|
11ac669077 | ||
|
|
9649a7eb01 | ||
|
|
695c28db02 | ||
|
|
94ec0d1d88 | ||
|
|
88cf7ca74b | ||
|
|
1d45fa8d3d | ||
|
|
48f88a5a3b | ||
|
|
045a8708e0 | ||
|
|
b3b127bd0b | ||
|
|
6c92adc0a3 | ||
|
|
9ecfc46467 | ||
|
|
05f5538bc3 | ||
|
|
cb2310914b | ||
|
|
eac77dcdaf | ||
|
|
ce3dc1cd3d | ||
|
|
c24642e75a | ||
|
|
4f2311fbad | ||
|
|
ee53edbe1c | ||
|
|
865bf58108 | ||
|
|
5383e2a4ea | ||
|
|
17dbe82d9b | ||
|
|
548e373310 | ||
|
|
d544de6c1d | ||
|
|
bf7bc0ed81 | ||
|
|
76d24123a7 | ||
|
|
4f44278561 | ||
|
|
beace99a80 | ||
|
|
cc48c7c2e8 | ||
|
|
4f9c671e86 | ||
|
|
1caa595e00 | ||
|
|
4c4d53196a | ||
|
|
121f07fa45 | ||
|
|
e5d546ed6e | ||
|
|
9298ad70f6 | ||
|
|
ea1015b0b4 | ||
|
|
faf5305702 | ||
| 671ae63306 | |||
|
|
949ff20317 | ||
|
|
950bcee232 | ||
|
|
2236a90b31 | ||
|
|
c65a19dc4c | ||
|
|
ab009cf5d7 | ||
|
|
ed1bd72d0a | ||
|
|
c42b3db7d2 | ||
|
|
2b6ba78500 | ||
|
|
362bcce5f6 | ||
|
|
927211379f | ||
|
|
299c78e7c7 | ||
|
|
615416444d | ||
|
|
257b4c51aa | ||
|
|
fef1e49429 | ||
|
|
57e25eaa89 | ||
|
|
195bc56152 | ||
|
|
9454b5407a | ||
|
|
51caa11c07 | ||
|
|
ea391a648a | ||
|
|
f92406efa7 | ||
|
|
de9901707c | ||
|
|
ea558cb22f | ||
|
|
cdf9e75ebd | ||
|
|
b6d715d81c | ||
|
|
729db13ffd | ||
|
|
d7a5d224b2 | ||
|
|
6ba18e8ba2 | ||
| f738a9202b | |||
|
|
b5401503e9 | ||
|
|
5a19c0e1a5 | ||
|
|
4f81d720fd | ||
|
|
ad44be5af8 | ||
|
|
75ddc8d07f | ||
|
|
27776d1761 | ||
|
|
352a49c762 | ||
|
|
7976d36701 | ||
|
|
84bbb0c143 | ||
|
|
76e9748eeb | ||
|
|
fd8e805f78 | ||
|
|
50bdc01ea9 | ||
|
|
dffe681b95 | ||
|
|
31c8365696 | ||
|
|
98fc9f61c3 | ||
|
|
a44dfee38a | ||
|
|
b3c962c03b | ||
|
|
f30144c42c | ||
|
|
81cf2824a7 | ||
|
|
7ae32bbe77 | ||
|
|
0dc4f5b99b | ||
|
|
34a8637c9e | ||
|
|
53f26aee68 | ||
|
|
9d3ed3632a | ||
|
|
4f4034c1d0 | ||
|
|
23ff910ee2 | ||
|
|
14c8a51690 | ||
|
|
86e7abb7ec | ||
|
|
454a024caa | ||
|
|
a55f370871 | ||
|
|
330cf1faa2 | ||
|
|
7356431414 | ||
|
|
91f18b01b9 | ||
|
|
0a08b67fb1 | ||
|
|
73ea623700 | ||
|
|
a86b560996 | ||
|
|
c58b37d111 | ||
|
|
eba7cb1ab8 | ||
|
|
2d6f801f0b | ||
|
|
6f3dd58a8b | ||
|
|
1357eaaac9 | ||
|
|
a349e94bf3 | ||
|
|
ddbce1bdbf | ||
|
|
319fa3c498 | ||
|
|
d2662da0b7 | ||
|
|
6b4f3537c2 | ||
|
|
983bb2837a | ||
|
|
bee903d22a | ||
|
|
b7a96d9b1d | ||
|
|
9b9e2bb2dc | ||
|
|
849f5aa66d | ||
|
|
8cf459b860 | ||
|
|
e3d04c9307 | ||
|
|
faa9adf69a | ||
|
|
e1f59b9223 | ||
|
|
f3945e1b21 | ||
|
|
13646d64c7 | ||
|
|
7f2136320d | ||
|
|
0d1e2c4e6b | ||
|
|
67b79cd306 | ||
|
|
150af4fc2c | ||
|
|
2c56322b1c | ||
|
|
86c7bd56d1 | ||
|
|
06bbca07a1 | ||
|
|
af8ac39e9c | ||
|
|
54ee2fb0b7 | ||
|
|
12749a1183 | ||
|
|
e7d43e2b48 | ||
|
|
732be62f90 | ||
|
|
a7a7bdd058 | ||
|
|
dcdf2c666d | ||
|
|
fc78fd9d1d | ||
|
|
8ddaf20e4f | ||
|
|
6e08a8db35 |
@@ -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) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<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">快來 PandoraLive觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook">Facebook</string>
|
||||
<string name="dialog_share_app_line">Line</string>
|
||||
<string name="dialog_share_app_twitter">Twitter</string>
|
||||
@@ -14,6 +14,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">快來 PandoraLive觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
</resources>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?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_share_info">Come and watch %s live on PandoraLive and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to Yola to discover more and better live streams.</string>
|
||||
<string name="dialog_invite_info">Come to PandoraLive to discover more and better live streams.</string>
|
||||
<string name="dialog_share_copy">Copy</string>
|
||||
<string name="dialog_share_app_internal">Site friends</string>
|
||||
<string name="dialog_share_internal_title">Share To</string>
|
||||
|
||||
1
app/proguard-rules.pro
vendored
@@ -319,3 +319,4 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keep class com.qiniu.**{*;}
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
|
||||
|
||||
@@ -104,7 +104,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 +132,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" />
|
||||
|
||||
@@ -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>
|
||||
@@ -1,4 +1,4 @@
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1
|
||||
# This is a configuration file for ProGuard.
|
||||
# http://proguard.sourceforge.net/index.html#manual/usage.html
|
||||
#
|
||||
@@ -95,8 +95,8 @@
|
||||
# These classes are duplicated between android.jar and core-lambda-stubs.jar.
|
||||
-dontnote java.lang.invoke.**
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\proguard-rules.pro
|
||||
# End of content from D:\AndroidProject\pandorapanP\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\proguard-rules.pro
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /Users/macpro/Library/Android/sdk/tools/proguard/proguard-android.txt
|
||||
@@ -419,8 +419,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\app\proguard-rules.pro
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapanP\app\proguard-rules.pro
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt
|
||||
-keep class androidx.core.app.CoreComponentFactory { <init>(); }
|
||||
-keep class androidx.core.content.FileProvider { <init>(); }
|
||||
-keep class androidx.core.content.FileProvider4Utils { <init>(); }
|
||||
@@ -888,6 +889,8 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
|
||||
-keep class com.yunbao.common.custom.CommonRefreshView { <init>(android.content.Context, android.util.AttributeSet); }
|
||||
|
||||
-keep class com.yunbao.common.custom.CommonRefreshWaterfallView { <init>(android.content.Context, android.util.AttributeSet); }
|
||||
|
||||
-keep class com.yunbao.common.custom.DrawableCheckBox { <init>(android.content.Context, android.util.AttributeSet); }
|
||||
|
||||
-keep class com.yunbao.common.custom.DrawableRadioButton { <init>(android.content.Context, android.util.AttributeSet); }
|
||||
@@ -1091,10 +1094,10 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keepclassmembers class * { *** videoEditClick(android.view.View); }
|
||||
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from D:\AndroidProject\pandorapanP\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from D:\AndroidProject\pandorapanP\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\8d3e3177c15403546de73d87508067d6\transformed\jetified-XPopup-2.10.0\proguard.txt
|
||||
# Generated keep rule for Lifecycle observer adapter.
|
||||
-if class com.lxj.xpopup.core.BasePopupView {
|
||||
@@ -1154,9 +1157,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
|
||||
|
||||
# End of content from C:\Users\CVB88\.gradle\caches\transforms-3\a1df9a6aa192455030f7c9970b70e0e9\transformed\material-1.4.0\proguard.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from D:\AndroidProject\pandorapanP\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\2929985d9627ba3bb45a0ebd18eaf9d3\transformed\jetified-linesdk-5.0.1\proguard.txt
|
||||
-keepattributes *Annotation*
|
||||
|
||||
@@ -1507,9 +1510,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
public boolean isLayoutSuppressed();
|
||||
}
|
||||
# End of content from C:\Users\CVB88\.gradle\caches\transforms-3\e9de7db2640f13ae2ab2a585dfd19337\transformed\recyclerview-1.2.1\proguard.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
|
||||
# End of content from D:\AndroidProject\pandorapan\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from D:\AndroidProject\pandorapanP\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\bb5ec4ef561b90312eb1ca52da1f144d\transformed\jetified-facebook-applinks-15.2.0\proguard.txt
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -282,6 +282,10 @@ public class Constants {
|
||||
|
||||
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
||||
|
||||
public static final String SOCKET_SEND_NEW_TASK_PUSH="SendNewTaskPush";//直播间-新用户完成任务push
|
||||
|
||||
public static final String SOCKET_SEND_NEW_TASK_IM ="SendNewTaskIM"; //直播间—新用户领取礼物IM
|
||||
|
||||
//视频举报获取位置
|
||||
public static int xIndex = 0;
|
||||
public static int yindex = 0;
|
||||
|
||||
@@ -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();
|
||||
}}
|
||||
}
|
||||
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");
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "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);
|
||||
}
|
||||
|
||||
@@ -442,6 +434,8 @@ public class WebViewActivity extends AbsActivity {
|
||||
gotoLive(event.getLiveId());
|
||||
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}else if(TextUtils.equals(event.getMethod(), "toRoomManage")){
|
||||
RouteUtil.forwardRoomManageActivity();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import static com.yunbao.common.utils.StringUtil.isEmpty;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/22.
|
||||
*/
|
||||
|
||||
public class LiveDataHistoryAdapter extends RecyclerView.Adapter<LiveDataHistoryAdapter.Vh> {
|
||||
|
||||
private Context mContext;
|
||||
private List<LiveDataHistoryBean> mList= new ArrayList<>();
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public LiveDataHistoryAdapter(Context context, List<LiveDataHistoryBean> list) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
mList = list;
|
||||
}
|
||||
|
||||
public void setDataCollection(List<LiveDataHistoryBean> data) {
|
||||
if (data == null) {
|
||||
data = new ArrayList();
|
||||
}
|
||||
this.mList = data;
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.live_data_history_item, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh holder, @SuppressLint("RecyclerView") int position) {
|
||||
if (isEmpty() || mList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
holder.time.setText(mList.get(position).getAddtime().substring(0,9)+"\n"+mList.get(position).getAddtime().substring(10));
|
||||
holder.giftTypeName.setText(mList.get(position).getCateName());
|
||||
holder.giftName.setText(mList.get(position).getGiftname());
|
||||
holder.income.setText(String.valueOf(mList.get(position).getAnchor_profit_coin()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
private TextView time;
|
||||
private TextView giftTypeName;
|
||||
private TextView giftName;
|
||||
private TextView income;
|
||||
|
||||
public Vh(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
time = itemView.findViewById(R.id.time);
|
||||
giftTypeName = itemView.findViewById(R.id.giftTypeName);
|
||||
giftName = itemView.findViewById(R.id.giftName);
|
||||
income = itemView.findViewById(R.id.income);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yunbao.live.adapter;
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
@@ -10,21 +10,21 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveDataInfoNowModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataInfoRecyclerAdapter extends RecyclerView.Adapter<LiveDataInfoRecyclerAdapter.LiveDataHolder> {
|
||||
private Context mContext;
|
||||
private List<LiveDataInfoModel> list=new ArrayList<>();
|
||||
private List<LiveDataInfoNowModel> list=new ArrayList<>();
|
||||
|
||||
public LiveDataInfoRecyclerAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<LiveDataInfoModel> list) {
|
||||
public void setList(List<LiveDataInfoNowModel> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -54,12 +54,8 @@ public class LiveDataInfoRecyclerAdapter extends RecyclerView.Adapter<LiveDataIn
|
||||
data = itemView.findViewById(R.id.item_data);
|
||||
}
|
||||
|
||||
public void setData(LiveDataInfoModel model) {
|
||||
if (model.getColor() != null) {
|
||||
data.setText(Html.fromHtml("<font color='" + model.getColor() + "'>" + model.getData() + "</font>"));
|
||||
} else {
|
||||
data.setText(model.getData());
|
||||
}
|
||||
public void setData(LiveDataInfoNowModel model) {
|
||||
data.setText(model.getData());
|
||||
title.setText(model.getTitle());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
SudGameListViewHolder sudGameListViewHolder = (SudGameListViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position),isHome);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,10 +113,67 @@ public class EnterRoomInfoModel extends BaseModel {
|
||||
private String giftWallLightenNumber;
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
private String giftWallLightenTotal;
|
||||
|
||||
@SerializedName("connection_info")
|
||||
private LivePkMicModel connectionInfo;
|
||||
|
||||
@SerializedName("week_star_gift_num")
|
||||
private String weekStarGiftNum;
|
||||
|
||||
@SerializedName("week_gift_illuminate_num")
|
||||
private String weekGiftIlluminateNum;
|
||||
|
||||
// 对应的getter和setter方法
|
||||
public String getWeekStarGiftNum() {
|
||||
return weekStarGiftNum;
|
||||
}
|
||||
|
||||
public void setWeekStarGiftNum(String weekStarGiftNum) {
|
||||
this.weekStarGiftNum = weekStarGiftNum;
|
||||
}
|
||||
|
||||
public String getWeekGiftIlluminateNum() {
|
||||
return weekGiftIlluminateNum;
|
||||
}
|
||||
|
||||
public void setWeekGiftIlluminateNum(String weekGiftIlluminateNum) {
|
||||
this.weekGiftIlluminateNum = weekGiftIlluminateNum;
|
||||
}
|
||||
//
|
||||
// "week_star_gift_num": 0,
|
||||
// "week_gift_illuminate_num": 0
|
||||
|
||||
|
||||
@SerializedName("is_first_entry")
|
||||
private String isFirstEntry;
|
||||
@SerializedName("is_new_user")
|
||||
private String isNewUser;
|
||||
@SerializedName("is_com_all")
|
||||
private String isComAll;
|
||||
|
||||
public String getIsComAll() {
|
||||
return isComAll;
|
||||
}
|
||||
|
||||
public void setIsComAll(String isComAll) {
|
||||
this.isComAll = isComAll;
|
||||
}
|
||||
|
||||
public String getIsFirstEntry() {
|
||||
return isFirstEntry;
|
||||
}
|
||||
|
||||
public void setIsFirstEntry(String isFirstEntry) {
|
||||
this.isFirstEntry = isFirstEntry;
|
||||
}
|
||||
|
||||
public String getIsNewUser() {
|
||||
return isNewUser;
|
||||
}
|
||||
|
||||
public void setIsNewUser(String isNewUser) {
|
||||
this.isNewUser = isNewUser;
|
||||
}
|
||||
|
||||
public LivePkMicModel getConnectionInfo() {
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
@@ -1,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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class HotStrategyBean {
|
||||
private String id;
|
||||
private String title;
|
||||
private String english_title;
|
||||
private String url;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getEnglish_title() {
|
||||
return english_title;
|
||||
}
|
||||
|
||||
public void setEnglish_title(String english_title) {
|
||||
this.english_title = english_title;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,21 @@ public class LiveAiRobotBean extends BaseModel {
|
||||
@SerializedName("ai_gz")
|
||||
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||
|
||||
@SerializedName("ai_langue")//0中文1英文
|
||||
private int aiLangue;
|
||||
|
||||
public int getAiLangue() {
|
||||
return aiLangue;
|
||||
}
|
||||
|
||||
public Boolean isLangueCn(){
|
||||
return aiLangue==0;
|
||||
}
|
||||
|
||||
public void setAiLangue(int aiLangue) {
|
||||
this.aiLangue = aiLangue;
|
||||
}
|
||||
|
||||
public LiveAiRobotBean() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
@@ -32,6 +34,9 @@ public class LiveAnchorSayModel extends BaseModel{
|
||||
private int isShow;
|
||||
private String content;
|
||||
private String styleImage;
|
||||
@Nullable
|
||||
private String title;
|
||||
|
||||
|
||||
public LivePreview() {
|
||||
}
|
||||
@@ -48,6 +53,15 @@ public class LiveAnchorSayModel extends BaseModel{
|
||||
return content;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(@Nullable String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* 直播数据
|
||||
*/
|
||||
public class LiveDataHistoryBean extends BaseModel {
|
||||
private String giftid;
|
||||
private String anchor_profit_coin;
|
||||
private String addtime;
|
||||
private String giftname;
|
||||
private String cate_name;
|
||||
private String english_cate_name;
|
||||
|
||||
|
||||
public String getGiftid() {
|
||||
return giftid;
|
||||
}
|
||||
|
||||
public void setGiftid(String giftid) {
|
||||
this.giftid = giftid;
|
||||
}
|
||||
|
||||
public String getAnchor_profit_coin() {
|
||||
return anchor_profit_coin;
|
||||
}
|
||||
|
||||
public void setAnchor_profit_coin(String anchor_profit_coin) {
|
||||
this.anchor_profit_coin = anchor_profit_coin;
|
||||
}
|
||||
|
||||
public String getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(String addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public void setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
}
|
||||
|
||||
public String getCateName() {
|
||||
return WordUtil.isNewZh()?cate_name:english_cate_name;
|
||||
}
|
||||
|
||||
public void setCate_name(String cate_name) {
|
||||
this.cate_name = cate_name;
|
||||
}
|
||||
|
||||
public String getEnglish_cate_name() {
|
||||
return english_cate_name;
|
||||
}
|
||||
|
||||
public void setEnglish_cate_name(String english_cate_name) {
|
||||
this.english_cate_name = english_cate_name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
public class LiveDataInfoNowModel extends BaseModel {
|
||||
private String color;
|
||||
private String title;
|
||||
private String data;
|
||||
|
||||
public LiveDataInfoNowModel(String color, String title, String data) {
|
||||
this.color = color;
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel(String title, String data) {
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel() {
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
/**
|
||||
* 开播提示
|
||||
*/
|
||||
public class LiveOpenTipsBean extends BaseModel{
|
||||
private String content;
|
||||
private String english_content;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getEnglish_content() {
|
||||
return english_content;
|
||||
}
|
||||
|
||||
public void setEnglish_content(String english_content) {
|
||||
this.english_content = english_content;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class NewPeopleTaskModel extends BaseModel {
|
||||
@@ -10,9 +12,12 @@ public class NewPeopleTaskModel extends BaseModel {
|
||||
private GiftModel gift = new GiftModel();
|
||||
@SerializedName("reward_all")
|
||||
private RewardAllModel rewardAll = new RewardAllModel();
|
||||
@SerializedName("reward_one")
|
||||
|
||||
private RewardAllModel rewardOne = new RewardAllModel();
|
||||
|
||||
@SerializedName("is_free_gift")
|
||||
private String isFreeGift = "1";
|
||||
|
||||
public TaskModel getTask() {
|
||||
return task;
|
||||
}
|
||||
@@ -22,6 +27,20 @@ public class NewPeopleTaskModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsFreeGift() {
|
||||
return isFreeGift;
|
||||
}
|
||||
|
||||
public void setIsFreeGift(String isFreeGift) {
|
||||
this.isFreeGift = isFreeGift;
|
||||
}
|
||||
|
||||
public boolean hasFreeGift(){
|
||||
Log.i("hasFreeGift",isFreeGift);
|
||||
return isFreeGift.equals("0");
|
||||
}
|
||||
|
||||
|
||||
public GiftModel getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
@@ -54,11 +54,20 @@ 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;
|
||||
private String front_task;
|
||||
|
||||
public String getNoble_img() {
|
||||
return noble_img;
|
||||
}
|
||||
|
||||
public void setNoble_img(String noble_img) {
|
||||
this.noble_img = noble_img;
|
||||
}
|
||||
|
||||
private String noble_img;
|
||||
private String is_admin;
|
||||
@SerializedName("user_love_num")
|
||||
private int praise;
|
||||
@@ -273,14 +282,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);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
|
||||
protected Context mContext;
|
||||
protected View mRootView;
|
||||
protected Dialog dialog;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -37,7 +38,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
} else {
|
||||
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
|
||||
}
|
||||
Dialog dialog = new Dialog(mContext, getDialogStyle());
|
||||
dialog = new Dialog(mContext, getDialogStyle());
|
||||
dialog.setContentView(mRootView);
|
||||
dialog.setCancelable(canCancel());
|
||||
dialog.setCanceledOnTouchOutside(canCancel());
|
||||
@@ -66,7 +67,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
|
||||
protected abstract void setWindowAttributes(Window window);
|
||||
|
||||
protected View findViewById(int id) {
|
||||
protected <T extends View> T findViewById(int id) {
|
||||
if (mRootView != null) {
|
||||
return mRootView.findViewById(id);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -22,16 +22,7 @@ public class ChatViewModel extends ViewModel {
|
||||
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;
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveDataHistoryAdapter;
|
||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
|
||||
public class LiveDataHistoryFragment extends Fragment {
|
||||
|
||||
protected SmartRefreshLayout mRefreshLayout;
|
||||
protected RecyclerView mList;
|
||||
private LiveDataHistoryAdapter mAdapter;
|
||||
List<LiveDataHistoryBean> list = new ArrayList<>();
|
||||
private View emptyView;
|
||||
private Context mContext;
|
||||
private String mStream;
|
||||
private int mPageCount = 1;//页数
|
||||
|
||||
public LiveDataHistoryFragment(Context context,String stream) {
|
||||
this.mContext =context;
|
||||
this.mStream = stream;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
emptyView = inflater.inflate(R.layout.view_layout_msg,container, false);
|
||||
ViewUtils.findViewById(emptyView,R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_addressbook_not_search);
|
||||
ViewUtils.findViewById(emptyView,R.id.textView, TextView.class).setText(R.string.not_data_message_address_book_list);
|
||||
return inflater.inflate(R.layout.live_data_history_list_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mAdapter = new LiveDataHistoryAdapter(mContext,list);
|
||||
this.mList = (RecyclerView) view.findViewById(R.id.rc_conversation_list);
|
||||
this.mRefreshLayout = (SmartRefreshLayout) view.findViewById(R.id.rc_refresh);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getActivity());
|
||||
this.mList.setLayoutManager(layoutManager);
|
||||
mList.setAdapter(mAdapter);
|
||||
initRefreshView();
|
||||
initData();
|
||||
}
|
||||
|
||||
protected void initRefreshView() {
|
||||
this.mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
this.mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
mPageCount = 1;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
mPageCount++;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
CommonHttpUtil.getLiveDataHistoryList(mStream, String.valueOf(mPageCount),new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
List<LiveDataHistoryBean> tempList = JSON.parseArray(obj.getString("data"), LiveDataHistoryBean.class);
|
||||
if(mPageCount==1){
|
||||
list = tempList;
|
||||
mAdapter.setDataCollection(list);
|
||||
mRefreshLayout.finishRefresh(true);
|
||||
}else{
|
||||
list.addAll(tempList);
|
||||
mAdapter.setDataCollection(list);
|
||||
mRefreshLayout.finishLoadMore(true);
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import static com.umeng.commonsdk.stateless.UMSLEnvelopeBuild.mContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveDataInfoRecyclerAdapter;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoNowModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataNowFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private LiveDataInfoRecyclerAdapter adapter;
|
||||
private List<LiveDataInfoNowModel> list;
|
||||
private String mLiveUid;
|
||||
private onDataResult onDataResult;
|
||||
private String mStream;
|
||||
|
||||
public LiveDataNowFragment(Context context, String liveUid,String mStream,LiveDataNowFragment.onDataResult onDataResult) {
|
||||
this.mLiveUid = liveUid;
|
||||
this.onDataResult = onDataResult;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.live_data_now_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
recyclerView = view.findViewById(R.id.live_data_list);
|
||||
adapter = new LiveDataInfoRecyclerAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), getContext().getString(R.string.live_data_loading)));
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveData(mLiveUid,mStream, new HttpCallback<LiveDataInfoModel>() {
|
||||
@Override
|
||||
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
||||
list.clear();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), data.getTotalCoin() + ""));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), data.getTotalGold() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), data.getAcceptNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), data.getEnterNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), data.getAttentionNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), data.getFanGroupNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + ""));
|
||||
adapter.setList(list);
|
||||
if(onDataResult!=null){
|
||||
onDataResult.Result(data.getTotalCoin() + "",data.getAcceptNum() + "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface onDataResult{
|
||||
void Result(String countZs,String countPerson);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,6 +20,7 @@ import com.yunbao.common.bean.WishModel2;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -34,7 +36,11 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
private RecyclerView wishList;
|
||||
private LiveNewWishAdapter liveNewWishAdapter;
|
||||
private ImageView imageView2, tvDone;
|
||||
private CommonCallback<Boolean> mSetResultCallback ;
|
||||
|
||||
public void setResultCallback(CommonCallback<Boolean> mCommonCallback) {
|
||||
this.mSetResultCallback = mCommonCallback;
|
||||
}
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.view_live_new_wish, viewGroup, false);
|
||||
@@ -151,6 +157,9 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,6 +192,10 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
//这里需要通知刷新心愿信息
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,6 +215,9 @@ public class LiveNewWishListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
|
||||
if (mSetResultCallback!=null){
|
||||
mSetResultCallback.callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,6 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
public void onChanged(List<BaseUiConversation> uiConversations) {
|
||||
int hashCode = uiConversations.hashCode();
|
||||
if (listHashCode != hashCode) {
|
||||
Log.i("nwq", "刷新数据");
|
||||
listHashCode = hashCode;
|
||||
((MainConversationListAdapter) mAdapter).onFinish();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
chatViewModel = (new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
chatViewModel = (new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
conversationListFragment = new MainMessageChatFragment();
|
||||
setAdapter(conversationListFragment.getAdapter());
|
||||
mAdapter.setFilter(chatViewModel.getChatFilter());
|
||||
@@ -107,6 +107,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
uids.add(conversation.mCore.getTargetId());
|
||||
}
|
||||
}
|
||||
Log.i("更新的用户数据信息", "getUserInfo");
|
||||
getUserInfo(uids);
|
||||
}
|
||||
});
|
||||
@@ -130,9 +131,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
baseUiConversation.mCore.setPortraitUrl(datum.getAvatar());
|
||||
String remark = InstructorRemarkManager.get(getContext()).getInstructorRemark().get(datum.getId());
|
||||
baseUiConversation.mCore.setConversationTitle(StringUtil.isEmpty(remark) ? datum.getUserNiceName() : remark);
|
||||
|
||||
list.add(baseUiConversation);
|
||||
|
||||
UserInfo userInfo = new UserInfo(baseUiConversation.mCore.getTargetId(),
|
||||
baseUiConversation.mCore.getConversationTitle(),
|
||||
Uri.parse(baseUiConversation.mCore.getPortraitUrl()));
|
||||
@@ -153,7 +152,9 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
}
|
||||
mAdapter.setDataCollection(srcList);
|
||||
//mAdapter.onFinish();
|
||||
recyclerView.scrollToPosition(position);
|
||||
if ( recyclerView!=null && mAdapter.getSrcList().size()>position){
|
||||
recyclerView.scrollToPosition(position);
|
||||
}
|
||||
}
|
||||
onRefreshFinished();
|
||||
onLoadMoreFinished();
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -280,13 +281,12 @@ public class ImgLoader {
|
||||
if (width != -1 && height != -1) {
|
||||
builder = builder.override(width, height);
|
||||
}
|
||||
builder.thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
||||
builder.skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
||||
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
if (callback != null) {
|
||||
callback.onLoadSuccess(resource);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
//公共参数
|
||||
|
||||
@@ -21,7 +21,7 @@ public class CommonHttpConsts {
|
||||
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 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);
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ public class CommonHttpUtil {
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -483,7 +483,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 +494,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 +521,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 +537,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 +548,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 +561,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 +572,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 +583,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 +592,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 +601,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 +622,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 +631,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 +640,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 +649,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 +659,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 +669,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 +678,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 +687,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 +697,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,11 +715,21 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
*获取聊天列表用户在线状态
|
||||
* @param callback
|
||||
*/
|
||||
public static void getLiveDataHistoryList(String stream,String page,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("live.getLiveGiftList", "live.getLiveGiftList")
|
||||
.params("stream",stream)
|
||||
.params("page",page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,19 +31,28 @@ public class LiveHttpUtil {
|
||||
HttpClient.getInstance().cancel(tag);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianyonghuliebiao", LiveHttpConsts.GET_USER_LIST)
|
||||
public static void getUserList(String liveuid, String stream, String type, int p,String is_noble,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getUserLists", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("liveuid", liveuid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
.params("p", p)
|
||||
.params("is_noble", is_noble)
|
||||
.params("version", "" + VersionUtil.getVersion())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
getUserList(liveuid,stream,type,p,"0",callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播用户日榜/周榜
|
||||
*
|
||||
@@ -51,7 +60,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 +69,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 +78,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 +89,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 +103,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 +114,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 +124,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 +136,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 +146,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 +155,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 +166,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 +175,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 +185,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 +195,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 +205,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 +215,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 +226,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 +235,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 +243,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 +253,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 +277,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 +287,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 +303,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 +321,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 +332,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 +340,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 +356,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 +372,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 +383,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 +399,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 +409,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 +418,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 +483,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 +499,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 +510,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 +549,14 @@ public class LiveHttpUtil {
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版)
|
||||
*/
|
||||
public static void getNewGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylazhibojianliwuxinxi", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版) -用于获取联系方式时的礼物设置
|
||||
*/
|
||||
public static void getHotGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylahuoqusuoyouremenliwu", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("Gift.getHotGiftList", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -534,7 +564,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 +572,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 +580,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 +591,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 +601,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 +611,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -590,17 +620,27 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("ylashezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
.params("type", type)
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
.params("liveuid", liveuid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTaskNew(String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift")
|
||||
.params("liveuid", liveuid)
|
||||
.params("token", true)
|
||||
.params("uid", true)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改心愿单列表
|
||||
*/
|
||||
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 +662,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 +673,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 +691,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 +709,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 +740,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 +749,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 +760,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 +797,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 +816,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 +831,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 +840,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 +854,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 +862,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 +872,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 +882,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 +892,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 +902,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 +913,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 +924,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 +934,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 +943,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 +975,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 +984,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 +992,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 +1001,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 +1010,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 +1020,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 +1028,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 +1038,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 +1047,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 +1074,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)
|
||||
@@ -1034,10 +1085,9 @@ public class LiveHttpUtil {
|
||||
/**
|
||||
* 获取短剧Url
|
||||
*/
|
||||
public static void getCoolydrama(HttpCallback callback){
|
||||
HttpClient.getInstance().get("yladuanjuzhanghaozhuce", "duanjuzhanghaozhuce")
|
||||
.params("lang", WordUtil.isNewZh()?"zh_CN":"en")
|
||||
public static void getCoolydrama(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("cool.register", "Home.getFollow")
|
||||
.params("lang", WordUtil.isNewZh() ? "zh_CN" : "en")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.yunbao.common.http.live;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -54,6 +56,7 @@ import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveOpenTipsBean;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
@@ -347,8 +350,17 @@ public class LiveNetManager {
|
||||
* 获取 【新人特惠】【趣味游戏】【幸运天使】
|
||||
*/
|
||||
public void getLiveRoomActivityBanner(HttpCallback<List<LiveRoomActivityBanner>> callback) {
|
||||
//获取版本名称
|
||||
String versionName = "";
|
||||
try {
|
||||
PackageManager manager = mContext.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(mContext.getPackageName(), 0);
|
||||
versionName = info.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveRoomActivityBanner()
|
||||
.getLiveRoomActivityBanner( WordUtil.isNewZh()?"chinese":"english",versionName)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -1215,9 +1227,9 @@ public class LiveNetManager {
|
||||
/**
|
||||
* 获取直播数据
|
||||
*/
|
||||
public void getLiveData(String liveUid, HttpCallback<LiveDataInfoModel> callback) {
|
||||
public void getLiveData(String liveUid,String stream, HttpCallback<LiveDataInfoModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveDataInfo(liveUid)
|
||||
.getLiveDataInfo(liveUid,stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -1274,10 +1286,11 @@ public class LiveNetManager {
|
||||
*/
|
||||
public void setLivePreviewInfo(String liveUid,
|
||||
int isShow,
|
||||
String title,
|
||||
String content,
|
||||
String styleImage, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setLivePreviewInfo(liveUid, isShow, content, styleImage)
|
||||
.setLivePreviewInfo(liveUid, isShow,title, content, styleImage)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -2358,7 +2371,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)
|
||||
@@ -4244,7 +4256,6 @@ public class LiveNetManager {
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
}
|
||||
|
||||
|
||||
public void getSwToken( HttpCallback<SwTokenModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getSwToken()
|
||||
@@ -4266,7 +4277,29 @@ public class LiveNetManager {
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开播提示信息
|
||||
*/
|
||||
public void getLiveOpenTips(HttpCallback<List<LiveOpenTipsBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveDataInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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, "", "PDL","Android", WordUtil.isNewZh()?"chinese":"english")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||
|
||||
@@ -40,6 +40,24 @@ public class GiftQuantityManager extends BaseCacheManager {
|
||||
return giftQuantityModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指导员备注信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<GiftQuantityModel> getGiftQuantityNew() {
|
||||
List<GiftQuantityModel> giftQuantityModels = getList(KEY_GIFT_QUANTITY, new TypeToken<List<GiftQuantityModel>>() {}.getType());
|
||||
if (giftQuantityModels == null || giftQuantityModels.size() == 0) {
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("9999").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("3344").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("1314").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("520").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("50").setFontColour("#ffffff"));
|
||||
giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("10").setFontColour("#ffffff"));
|
||||
}
|
||||
return giftQuantityModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
|
||||
@@ -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,7 +533,7 @@ 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)
|
||||
@@ -555,7 +555,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 +573,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) {
|
||||
|
||||
@@ -124,7 +124,7 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
||||
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() {
|
||||
|
||||
@@ -373,6 +373,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onGameMGCommonGameCreateOrder(handle, mgCommonGameCreateOrder);
|
||||
}
|
||||
// 调用创建订单接口
|
||||
JumpEvent.hit(mgCommonGameCreateOrder);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_PLAYER_ROLE_ID: // 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.text.TextUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.utils.language.LangUtils;
|
||||
@@ -43,6 +44,45 @@ public class DateFormatUtil {
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static String getTimeLiveEndString(long time) {
|
||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); // 设置日期格式
|
||||
String formattedDate = sdf.format(date); // 格式化日期字符串
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static String getDiffInMilliseconds(String time1, String time2, String day, String hour, String minute) {
|
||||
return getTime(Long.parseLong(time1), Long.parseLong(time2), day, hour, minute);
|
||||
}
|
||||
|
||||
|
||||
//根据时间计算出 分钟,小时,天
|
||||
private static String getTime(Long startTime, Long endTime, String day, String hour, String minute) {
|
||||
if (startTime == null || endTime == null || startTime >= endTime) {
|
||||
return "Invalid time range";
|
||||
}
|
||||
|
||||
long diff = endTime - startTime;
|
||||
long days = TimeUnit.MILLISECONDS.toDays(diff);
|
||||
long hours = TimeUnit.MILLISECONDS.toHours(diff) - (days * 24);
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff) - (TimeUnit.MILLISECONDS.toHours(diff) * 60);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (days > 0) {
|
||||
stringBuilder.append(days).append(day).append(" ");
|
||||
}
|
||||
if (hours > 0) {
|
||||
stringBuilder.append(hours).append(hour).append(" ");
|
||||
}
|
||||
if (minutes > 0) {
|
||||
stringBuilder.append(minutes).append(minute);
|
||||
}else {
|
||||
stringBuilder.append("0"+minute);
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
public static String getTimeStrings(long time) {
|
||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
|
||||
@@ -105,7 +145,7 @@ public class DateFormatUtil {
|
||||
formatDate = formatDate(date, "yyyy/M/d");
|
||||
|
||||
if (showTime) {
|
||||
formatDate = formatDate ;//+ " " + getTimeString(dateMillis, context);
|
||||
formatDate = formatDate;//+ " " + getTimeString(dateMillis, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +168,15 @@ public class DialogUitl {
|
||||
showSimpleDialog(context, content, false, callback);
|
||||
}
|
||||
|
||||
public static void showSimpleDialogString(Context context, String content,String confirmString, SimpleCallback callback) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
new Builder(context).setTitle(null).setContent(content).setCancelable(false).setClickCallback(callback).setConfirmString(confirmString).build().show();
|
||||
}
|
||||
|
||||
public static void showSimpleDialog(Context context, String content, boolean cancelable, SimpleCallback callback) {
|
||||
showSimpleDialog(context, null, content, cancelable, callback);
|
||||
}
|
||||
|
||||
@@ -619,7 +619,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,7 +657,7 @@ 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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
public class NavigationBarUtils {
|
||||
|
||||
public static boolean hasNavigationBar(Activity activity) {
|
||||
boolean hasNavigationBar = false;
|
||||
int resourceId = activity.getResources().getIdentifier("config_showNavigationBar", "bool", "android");
|
||||
if (resourceId > 0) {
|
||||
hasNavigationBar = activity.getResources().getBoolean(resourceId);
|
||||
}
|
||||
|
||||
try {
|
||||
hasNavigationBar |= (Boolean) ViewConfiguration.class.getDeclaredMethod("hasNavigationBar").invoke(ViewConfiguration.get(activity));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Fall back on checking the navigation bar height, if available
|
||||
if (!hasNavigationBar && hasNavBarHeight()) {
|
||||
hasNavigationBar = true;
|
||||
}
|
||||
|
||||
return hasNavigationBar;
|
||||
}
|
||||
|
||||
public static boolean hasNavBarHeight() {
|
||||
Resources res = Resources.getSystem();
|
||||
int resourceId = res.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
return res.getDimensionPixelSize(resourceId) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 示例:在Activity中使用该方法
|
||||
public static boolean checkNavigationBar(Activity activity) {
|
||||
return hasNavigationBar(activity);
|
||||
}
|
||||
|
||||
public static int checkBarHeight(Activity activity) {
|
||||
int result = 0;
|
||||
Resources resources = activity.getResources();
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = resources.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void setBarStatus(RelativeLayout rt_main_tab, Activity mContext){
|
||||
if("Xiaomi".equals(Build.BRAND)&&"2210132C".equals(Build.MODEL)){
|
||||
ViewGroup.LayoutParams params = rt_main_tab.getLayoutParams();
|
||||
params.height =params.height+ NavigationBarUtils.checkBarHeight(mContext);
|
||||
rt_main_tab.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ 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;
|
||||
|
||||
@@ -66,6 +66,15 @@ public class RouteUtil {
|
||||
public static final String PATH_SudSwGameActivity = "/live/SudSwGameActivity";
|
||||
public static final String PATH_SudRyGameActivity = "/live/SudRyGameActivity";
|
||||
|
||||
public static final String PATH_LiveROOMMANAGE = "/live/RoomManageActivity";
|
||||
|
||||
/**
|
||||
* 跳转到房间管理页面
|
||||
*/
|
||||
public static void forwardRoomManageActivity() {
|
||||
ARouter.getInstance().build(PATH_LiveROOMMANAGE)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardVideoPlayNewActivity(ActiveBean bean) {
|
||||
ARouter.getInstance().build(PATH_VIDEO_NEW_PLAY)
|
||||
@@ -272,7 +281,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();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,13 +95,38 @@ public class StringUtil {
|
||||
int minutes = (int) ((mms % (1000 * 60 * 60)) / (1000 * 60));
|
||||
int seconds = (int) ((mms % (1000 * 60)) / 1000);
|
||||
sStringBuilder.delete(0, sStringBuilder.length());
|
||||
if (hours > 0) {
|
||||
if (hours < 10) {
|
||||
if (hours < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(hours));
|
||||
sStringBuilder.append(":");
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(hours));
|
||||
sStringBuilder.append(String.valueOf(minutes));
|
||||
sStringBuilder.append(":");
|
||||
} else {
|
||||
sStringBuilder.append("00:");
|
||||
}
|
||||
if (seconds > 0) {
|
||||
if (seconds < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(seconds));
|
||||
} else {
|
||||
sStringBuilder.append("00");
|
||||
}
|
||||
return sStringBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 把一个long类型的总毫秒数转成时长
|
||||
*/
|
||||
public static String getDurationText2(long mms) {
|
||||
int minutes = (int) ((mms % (1000 * 60 * 60)) / (1000 * 60));
|
||||
int seconds = (int) ((mms % (1000 * 60)) / 1000);
|
||||
sStringBuilder.delete(0, sStringBuilder.length());
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) {
|
||||
sStringBuilder.append("0");
|
||||
|
||||
@@ -26,7 +26,13 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
mTag = getClass().getSimpleName();
|
||||
mContext = context;
|
||||
mParentView = parentView;
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
try {
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
}catch (Exception e){
|
||||
L.e("AbsViewHolder",e.toString());
|
||||
}
|
||||
if (mContentView == null)
|
||||
L.e("AbsViewHolder","mContentView==null");
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -35,7 +41,13 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
processArguments(args);
|
||||
mContext = context;
|
||||
mParentView = parentView;
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
try {
|
||||
mContentView = LayoutInflater.from(context).inflate(getLayoutId(), mParentView, false);
|
||||
}catch (Exception e){
|
||||
L.e("AbsViewHolder",e.toString());
|
||||
}
|
||||
if (mContentView == null)
|
||||
L.e("AbsViewHolder","mContentView==null");
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GiftNumberPopup extends BottomPopupView {
|
||||
super.onCreate();
|
||||
RecyclerView giftList = findViewById(R.id.gift_list);
|
||||
giftList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
GiftNumberAdapter giftNumberAdapter = new GiftNumberAdapter(new GiftQuantityManager(getContext()).getGiftQuantity());
|
||||
GiftNumberAdapter giftNumberAdapter = new GiftNumberAdapter(new GiftQuantityManager(getContext()).getGiftQuantityNew());
|
||||
giftList.setAdapter(giftNumberAdapter);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_can), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
|
||||
@@ -33,11 +33,16 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
private TextView titleSDText, titleHDText, titleFHDText, mTips;
|
||||
private int banSelect;
|
||||
private boolean isUser = false;
|
||||
private SelectPositionListener selectPositionListener;
|
||||
|
||||
public int getSelectClarity() {
|
||||
return selectClarity;
|
||||
}
|
||||
|
||||
public void setSelectPositionListener(SelectPositionListener selectPositionListener) {
|
||||
this.selectPositionListener = selectPositionListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param banSelect 禁止选项,{@link #BAN_720} 禁止高清和超高清。 {@link #BAN_1080} 禁止超高清
|
||||
* @param isUser 是否为观众,true 观众,false 主播
|
||||
@@ -227,6 +232,13 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
iconFhd.setVisibility(VISIBLE);
|
||||
break;
|
||||
}
|
||||
if(selectPositionListener!=null){
|
||||
selectPositionListener.onSelect(selectClarity);
|
||||
}
|
||||
}
|
||||
|
||||
public interface SelectPositionListener{
|
||||
void onSelect(int position);
|
||||
}
|
||||
|
||||
private Handler netHandler = new Handler();
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.yunbao.common.views;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -28,6 +30,7 @@ import com.yunbao.common.event.PopupViewDismissEvent;
|
||||
import com.yunbao.common.fragment.LiveNewWishListFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -61,6 +64,12 @@ public class LiveNewWishListPopup extends BottomPopupView {
|
||||
private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment;
|
||||
private ImageView wishListTop;
|
||||
|
||||
private CommonCallback<Boolean> mSetResultCallback ;
|
||||
|
||||
public void setResultCallback(CommonCallback<Boolean> mCommonCallback) {
|
||||
this.mSetResultCallback = mCommonCallback;
|
||||
}
|
||||
|
||||
public LiveNewWishListPopup(@NonNull FragmentActivity context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
@@ -198,6 +207,10 @@ public class LiveNewWishListPopup extends BottomPopupView {
|
||||
zhouXinFragment = LiveNewWishListFragment.newInstance(2);
|
||||
lunarWishFragment = LiveNewWishListFragment.newInstance(3);
|
||||
seasonalWishFragment = LiveNewWishListFragment.newInstance(4);
|
||||
dayWishFragment.setResultCallback(mSetResultCallback);
|
||||
zhouXinFragment.setResultCallback(mSetResultCallback);
|
||||
lunarWishFragment.setResultCallback(mSetResultCallback);
|
||||
seasonalWishFragment.setResultCallback(mSetResultCallback);
|
||||
ViewList.add(dayWishFragment);
|
||||
ViewList.add(zhouXinFragment);
|
||||
ViewList.add(lunarWishFragment);
|
||||
|
||||
@@ -5,12 +5,14 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
@@ -18,7 +20,10 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public class LiveOpenCustomPopup extends BottomPopupView {
|
||||
//清晰度
|
||||
private int selectClarity;
|
||||
//直播类型
|
||||
@@ -26,10 +31,12 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
//房间类型
|
||||
private LiveRoomTypeBean liveRoomTypeBean;
|
||||
|
||||
private TextView textClarity, textLiveRoomType, textLiveClass, textLiveWishlist, textRobot, textSay, textCall;
|
||||
private TextView textClarity, textLiveClass, textLiveWishlist, textRobot, textSay, textCall;
|
||||
|
||||
private int status_say, status_call;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public LiveOpenCustomPopup setClassBean(LiveClassBean classBean) {
|
||||
this.classBean = classBean;
|
||||
textLiveClass.setText(classBean.getName());
|
||||
@@ -38,17 +45,12 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
|
||||
public LiveOpenCustomPopup setLiveRoomTypeBean(LiveRoomTypeBean liveRoomTypeBean) {
|
||||
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||
if (liveRoomTypeBean.getId()== Constants.LIVE_TYPE_PWD){
|
||||
textLiveRoomType.setText(WordUtil.isNewZh() ? "密碼房" : "password room");
|
||||
}else {
|
||||
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveOpenCustomPopup(@NonNull Context context, int selectClarity, LiveClassBean classBean, LiveRoomTypeBean liveRoomTypeBean) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
this.selectClarity = selectClarity;
|
||||
this.classBean = classBean;
|
||||
this.liveRoomTypeBean = liveRoomTypeBean;
|
||||
@@ -70,7 +72,6 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
|
||||
private void initView() {
|
||||
textClarity = findViewById(R.id.text_clarity);
|
||||
textLiveRoomType = findViewById(R.id.text_live_room_type);
|
||||
textLiveClass = findViewById(R.id.text_live_class);
|
||||
textLiveWishlist = findViewById(R.id.text_live_wishlist);
|
||||
textRobot = findViewById(R.id.text_robot);
|
||||
@@ -79,13 +80,6 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
if (classBean != null) {
|
||||
textLiveClass.setText(classBean.getName());
|
||||
}
|
||||
if (liveRoomTypeBean != null) {
|
||||
if (liveRoomTypeBean.getId()== Constants.LIVE_TYPE_PWD){
|
||||
textLiveRoomType.setText(WordUtil.isNewZh() ? "密碼房" : "password room");
|
||||
}else {
|
||||
textLiveRoomType.setText(liveRoomTypeBean.getName());
|
||||
}
|
||||
}
|
||||
setSelectClarity(selectClarity);
|
||||
//關閉彈窗
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), () -> dismiss());
|
||||
@@ -108,12 +102,6 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
callBack.selectClarity(selectClarity);
|
||||
}
|
||||
});
|
||||
//設置房間類型
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_room_type), () -> {
|
||||
if (callBack != null) {
|
||||
callBack.openLiveRoomType(liveRoomTypeBean);
|
||||
}
|
||||
});
|
||||
//打開心願單
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_live_wishlist), () -> {
|
||||
if (callBack != null) {
|
||||
@@ -182,7 +170,7 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
}
|
||||
|
||||
public void initDate() {
|
||||
textSay.setText(status_say == 1 ? R.string.do_set : R.string.not_set);
|
||||
textSay.setText(IMLoginManager.get(mContext).getAnchorSayStatus() == 1 ? R.string.do_set : R.string.not_set);
|
||||
textCall.setText(status_call == 1 ? R.string.robot_yes : R.string.robot_no);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()),
|
||||
@@ -190,7 +178,7 @@ public class LiveOpenCustomPopup extends CenterPopupView {
|
||||
@Override
|
||||
public void onSuccess(LiveStetUpStatusModel data) {
|
||||
textLiveWishlist.setText(data.getWishListState() ? R.string.do_set : R.string.not_set);
|
||||
textRobot.setText(data.getAiStateState() ? R.string.robot_yes : R.string.robot_no);
|
||||
textRobot.setText(data.getAiStateState() ? R.string.robot_on : R.string.robot_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -7,6 +8,8 @@ import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -21,6 +24,12 @@ import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.MicUserManager;
|
||||
import com.yunbao.common.manager.MicedUserManager;
|
||||
import com.yunbao.common.manager.RandomPkManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@@ -32,6 +41,11 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
private String time = "";
|
||||
private ImageView robotState;
|
||||
|
||||
private ImageView languageZhImgView;
|
||||
private AppCompatTextView languageZhTv;
|
||||
private ImageView languageEnImgView;
|
||||
private AppCompatTextView languageEnTv;
|
||||
private int lastLanguage = 1;
|
||||
private int robotStateInt = 1;
|
||||
|
||||
public int getRobotStateInt() {
|
||||
@@ -60,17 +74,22 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||
robotNameText = findViewById(R.id.robot_name_text);
|
||||
robotState = findViewById(R.id.robot_state);
|
||||
languageZhImgView = findViewById(R.id.languageZhImgView);
|
||||
languageZhTv = findViewById(R.id.languageZhTv);
|
||||
languageEnImgView = findViewById(R.id.languageEnImgView);
|
||||
languageEnTv = findViewById(R.id.languageEnTv);
|
||||
automaticGreetingNumber = findViewById(R.id.automatic_greeting_number);
|
||||
automaticMessageNumber = findViewById(R.id.automatic_message_number);
|
||||
findViewById(R.id.automatic_message_sending).setOnClickListener(this);
|
||||
findViewById(R.id.automatic_greeting_setting).setOnClickListener(this);
|
||||
robotNameText.setOnClickListener(this);
|
||||
robotState.setOnClickListener(this);
|
||||
|
||||
robotNameSetting.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
L.e("EditorInfo.IME_ACTION_DONE");
|
||||
// 修改助手名字
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {
|
||||
@@ -91,8 +110,65 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
languageZhImgView.setOnClickListener(v -> {
|
||||
if (lastLanguage == 0) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(0);
|
||||
});
|
||||
languageZhTv.setOnClickListener(v -> {
|
||||
if (lastLanguage == 0) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(0);
|
||||
});
|
||||
|
||||
languageEnImgView.setOnClickListener(v -> {
|
||||
if (lastLanguage == 1) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(1);
|
||||
});
|
||||
languageEnTv.setOnClickListener(v -> {
|
||||
if (lastLanguage == 1) {
|
||||
return;
|
||||
}
|
||||
ShowChangeLanguagePopup(1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void ShowChangeLanguagePopup(int i) {
|
||||
DialogUitl.showSimpleDialogString(getContext(), getContext().getString(R.string.chang_langue_tips), getContext().getString(R.string.aristocrat_determine) ,new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_langue", i+"", new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (i==0) {
|
||||
languageZhImgView.setSelected(true);
|
||||
languageEnImgView.setSelected(false);
|
||||
lastLanguage = 0;
|
||||
} else {
|
||||
languageZhImgView.setSelected(false);
|
||||
languageEnImgView.setSelected(true);
|
||||
lastLanguage = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int viewID = v.getId();
|
||||
@@ -243,6 +319,15 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
robotNameText.setText(data.getName());
|
||||
automaticGreetingNumber.setText(String.valueOf(data.getAutoSeyHiNumber()));
|
||||
automaticMessageNumber.setText(String.valueOf(data.getAutoRequestFollowNumber()));
|
||||
if (data.isLangueCn()) {
|
||||
languageZhImgView.setSelected(true);
|
||||
languageEnImgView.setSelected(false);
|
||||
lastLanguage = 0;
|
||||
} else {
|
||||
languageZhImgView.setSelected(false);
|
||||
languageEnImgView.setSelected(true);
|
||||
lastLanguage = 1;
|
||||
}
|
||||
time = String.valueOf(data.getTime());
|
||||
robotStateInt = data.getStatus();
|
||||
if (data.getStatus() == 1) {
|
||||
@@ -252,7 +337,7 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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,12 +99,7 @@ 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);
|
||||
}
|
||||
|
||||
mLayoutParams00 = new LayoutParams(mWidth1, mWidth1);
|
||||
}
|
||||
if (imageView.getLayoutParams() != mLayoutParams00) {
|
||||
imageView.setLayoutParams(mLayoutParams00);
|
||||
@@ -122,12 +107,7 @@ public class NineGridLayout extends FrameLayout {
|
||||
if (imageView.getVisibility() != VISIBLE) {
|
||||
imageView.setVisibility(VISIBLE);
|
||||
}
|
||||
if (onIsFUll){
|
||||
setHeight(fullWidth1);
|
||||
}else {
|
||||
setHeight(mWidth1);
|
||||
}
|
||||
|
||||
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,7 +1,9 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.AsyncTask;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -256,14 +258,35 @@ public class NobleNoticeView extends FrameLayout {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@Override
|
||||
public void onStep(int frame, double v) {
|
||||
System.out.println("frame = " + frame);
|
||||
System.out.println("scrollLayout.getMeasuredWidth() = " + scrollLayout.getMeasuredWidth());
|
||||
if (frame == 21) {
|
||||
setButtonPosition(roleType);
|
||||
observable.observeOn(AndroidSchedulers.mainThread())
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
// 在这里执行后台任务
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void aVoid) {
|
||||
super.onPostExecute(aVoid);
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(scrollLayout.getMeasuredHeight(), -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
animationSet1.setFillAfter(true);
|
||||
animationSet1.setDuration((animationTime - 1000) / 2);
|
||||
animationSet1.setAnimationListener(animationListener);
|
||||
scrollLayout.startAnimation(animationSet1);
|
||||
}
|
||||
}.execute();
|
||||
/*observable.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(bitmap -> {
|
||||
L.e("44444");
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
@@ -273,8 +296,7 @@ public class NobleNoticeView extends FrameLayout {
|
||||
scrollLayout.startAnimation(animationSet1);
|
||||
}, throwable -> {
|
||||
|
||||
}).isDisposed();
|
||||
|
||||
}).isDisposed();*/
|
||||
}
|
||||
if (frame == 135) {
|
||||
contextLayout.setVisibility(GONE);
|
||||
@@ -377,12 +399,10 @@ public class NobleNoticeView extends FrameLayout {
|
||||
Animation.AnimationListener animationListener = new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
|
||||
scrollLayout.clearAnimation();
|
||||
if (svagaBc.isAnimating()) {
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
|
||||
|
||||
@@ -1,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);
|
||||
}
|
||||
|
||||
}
|
||||
8
common/src/main/res/drawable/backgroud_live_end.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#8D8D8D" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
5
common/src/main/res/drawable/backgroud_live_end_1.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#40E4E4E4" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FF666666" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
6
common/src/main/res/drawable/background_white_5.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white" />
|
||||
<corners
|
||||
android:radius="5dp"/>
|
||||
</shape>
|
||||
BIN
common/src/main/res/drawable/bg_continuous_clicks.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
8
common/src/main/res/drawable/bg_gift_bottom_bg.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ff171724" />
|
||||
<corners
|
||||
android:topLeftRadius="17dp"
|
||||
android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
11
common/src/main/res/drawable/bg_gift_openvip.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 7%不透明度的白色-->
|
||||
<solid android:color="#11FFFFFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="4dp"
|
||||
android:bottomRightRadius="4dp"
|
||||
android:topLeftRadius="4dp"
|
||||
android:topRightRadius="4dp" />
|
||||
</shape>
|
||||
23
common/src/main/res/drawable/bg_gift_progressbar.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="1dp" />
|
||||
<solid android:color="#26000000" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="1dp" />
|
||||
<gradient
|
||||
android:endColor="#FFC949"
|
||||
android:startColor="#FFC949" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
23
common/src/main/res/drawable/bg_gift_progressbar2.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="1dp" />
|
||||
<solid android:color="#15FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="1dp" />
|
||||
<gradient
|
||||
android:endColor="#DED9A5"
|
||||
android:startColor="#DED9A5" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
11
common/src/main/res/drawable/bg_gift_send.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 7%不透明度的白色-->
|
||||
<solid android:color="#11FFFFFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="17dp"
|
||||
android:bottomRightRadius="17dp"
|
||||
android:topLeftRadius="17dp"
|
||||
android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
15
common/src/main/res/drawable/bg_gift_send_btn.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFF026" />
|
||||
<corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#48FFF026" />
|
||||
<corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#73FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#FFFFFF"
|
||||
android:startColor="#FFFFFF" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
12
common/src/main/res/drawable/bg_live_gift_lv.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#ff6e84e7" />
|
||||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
|
||||
</shape>
|
||||
@@ -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>
|
||||
|
||||