Compare commits
56 Commits
release_2.
...
release_2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0bbabaa1c | ||
![]() |
c97b521d4c | ||
![]() |
469ee07eeb | ||
![]() |
60d274c79a | ||
![]() |
a48440209a | ||
![]() |
65bcf7a7ca | ||
![]() |
b307db446d | ||
![]() |
bed3184df9 | ||
![]() |
2c4fb0e056 | ||
![]() |
784aeebdf4 | ||
![]() |
043e79681d | ||
![]() |
b6972ee445 | ||
![]() |
4fd1bd73ea | ||
![]() |
afab35a691 | ||
![]() |
d508912a9c | ||
![]() |
ec2e46b0a4 | ||
![]() |
e2cf045ab7 | ||
![]() |
c2cdd5d6f1 | ||
![]() |
5bacadf9df | ||
![]() |
eb81154c1c | ||
![]() |
ae19a0c653 | ||
![]() |
44787e5041 | ||
![]() |
a8f12371a7 | ||
![]() |
950ce098dc | ||
![]() |
720cf52fd0 | ||
![]() |
5d4aa38b93 | ||
![]() |
a2faf14901 | ||
![]() |
665fecb427 | ||
![]() |
6fb428b536 | ||
![]() |
a01a362506 | ||
![]() |
44ad80c708 | ||
![]() |
f212af49f1 | ||
![]() |
3bcac093c7 | ||
![]() |
dd87492ffb | ||
![]() |
de79e73c9a | ||
![]() |
fac1497de3 | ||
![]() |
a8335e915c | ||
![]() |
53820a23c7 | ||
![]() |
8016cc860a | ||
![]() |
95e3e0768c | ||
![]() |
6f73f3f4fb | ||
![]() |
b6524ad94f | ||
![]() |
f5fc2f9d79 | ||
![]() |
be28ed2509 | ||
![]() |
5be60fe7b2 | ||
![]() |
522c4a9f6f | ||
![]() |
e478c9c202 | ||
![]() |
3ac10340d6 | ||
![]() |
a10471d1c2 | ||
![]() |
d47536cc13 | ||
![]() |
641c15a91e | ||
![]() |
f29dc93faa | ||
![]() |
42afa779db | ||
![]() |
d300ef179d | ||
![]() |
ecd6b8da81 | ||
![]() |
dec6e5e0c1 |
124
app/build.gradle
@@ -3,12 +3,9 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.huawei.agconnect'
|
||||
apply plugin: 'com.tencent.vasdolly'
|
||||
apply from: '../mob.gradle'
|
||||
apply plugin: 'android-junk-code'
|
||||
|
||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||
|
||||
android {
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
@@ -21,20 +18,20 @@ android {
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
}
|
||||
// ndk {
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
// }
|
||||
flavorDimensions 'default'
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
// splits {
|
||||
// abi {
|
||||
// enable true
|
||||
// reset()
|
||||
// include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
// universalApk true
|
||||
// }
|
||||
// }
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
@@ -50,7 +47,7 @@ android {
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "yinmeng_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
outputFileName = "yinmeng_${variant.flavorName}_${buildType.name}_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +179,59 @@ android {
|
||||
|
||||
buildToolsVersion = '30.0.3'
|
||||
|
||||
productFlavors {
|
||||
official {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
fir {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
mlq {
|
||||
ndk {
|
||||
abiFilters 'x86'
|
||||
}
|
||||
}
|
||||
yingyongbao {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a'
|
||||
}
|
||||
}
|
||||
vivo {
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
oppo {
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
xiaomi {
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
huawei {
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
kuaishou_01 {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
}
|
||||
productFlavors.all { flavor ->
|
||||
flavor.manifestPlaceholders = [
|
||||
// 渠道
|
||||
CHANNEL_VALUE : name,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +308,7 @@ dependencies {
|
||||
//oppo推送需要
|
||||
implementation 'commons-codec:commons-codec:1.6'
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
// api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
@@ -276,36 +326,20 @@ repositories {
|
||||
|
||||
}
|
||||
|
||||
channel {
|
||||
//多渠道包的输出目录,默认为new File(project.buildDir,"channel")
|
||||
outputDir = new File(project.buildDir, "channelapk")
|
||||
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
|
||||
def only64 = onlyArm64 ? "-only64" : ""
|
||||
apkNameFormat = 'yinmeng-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
buildTimeDateFormat = 'MMddHHmm'
|
||||
//低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
|
||||
lowMemory = false
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
print("variant.name=" + variant.name)
|
||||
switch (variant.name) {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease)
|
||||
case "release":
|
||||
androidJunkCode.configMap.put(variant.name, {
|
||||
packageBase = "com.nnbc123.plugin.ui" //生成java类根包名
|
||||
packageCount = 30 //生成包数量
|
||||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||||
excludeActivityJavaFile = false
|
||||
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
|
||||
otherCountPerPackage = 50 //每个包下生成其它类的数量
|
||||
methodCountPerClass = 20 //每个类下生成方法数量
|
||||
resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀
|
||||
drawableCount = 300 //生成drawable资源数量
|
||||
stringCount = 300 //生成string数量
|
||||
})
|
||||
break
|
||||
if (variant.name.contains("release") || variant.name.contains("Release")) {
|
||||
androidJunkCode.configMap.put(variant.name, {
|
||||
packageBase = "com.nnbc123.plugin.ui" //生成java类根包名
|
||||
packageCount = 30 //生成包数量
|
||||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||||
excludeActivityJavaFile = false
|
||||
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
|
||||
otherCountPerPackage = 50 //每个包下生成其它类的数量
|
||||
methodCountPerClass = 20 //每个类下生成方法数量
|
||||
resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀
|
||||
drawableCount = 300 //生成drawable资源数量
|
||||
stringCount = 300 //生成string数量
|
||||
})
|
||||
}
|
||||
}
|
@@ -86,6 +86,10 @@
|
||||
android:theme="@style/MyMaterialTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:name,android:allowBackup">
|
||||
<!-- 多渠道 -->
|
||||
<meta-data
|
||||
android:name="CHANNEL"
|
||||
android:value="${CHANNEL_VALUE}" />
|
||||
<!-- 刘海屏适配 begin -->
|
||||
<!-- 小米 -->
|
||||
<meta-data
|
||||
@@ -212,14 +216,14 @@
|
||||
<service
|
||||
android:name="com.xiaomi.mipush.sdk.PushMessageHandler"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
android:exported="true" />
|
||||
<service
|
||||
android:name="com.xiaomi.mipush.sdk.MessageHandleService"
|
||||
android:enabled="true" /> <!-- 注:此service必须在2.2.5版本以后(包括2.2.5版本)加入 -->
|
||||
<receiver
|
||||
android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver"
|
||||
android:exported="true"
|
||||
tools:node="remove">>
|
||||
tools:node="remove">
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
|
||||
|
@@ -501,7 +501,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
getMvpPresenter().exitRoom();
|
||||
QuickPassLoginAct.start(MainActivity.this);
|
||||
PmDialogShowMrg.get().onLogout();
|
||||
CustomerServerHelper.logout();
|
||||
// CustomerServerHelper.logout();
|
||||
}
|
||||
|
||||
public void onNeedLogin() {
|
||||
@@ -657,7 +657,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
|
||||
onTabClick(mCurrentTabType);
|
||||
|
||||
CustomerServerHelper.onLoginInfoUpdate(UserUtils.getUserInfo());
|
||||
// CustomerServerHelper.onLoginInfoUpdate(UserUtils.getUserInfo());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -28,6 +28,7 @@ import androidx.multidex.MultiDex;
|
||||
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.bytedance.hume.readapk.HumeSDK;
|
||||
import com.chuhai.utils.MetaDataUtils;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.facebook.stetho.Stetho;
|
||||
import com.heytap.msp.push.HeytapPushManager;
|
||||
@@ -61,7 +62,6 @@ import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
import com.tencent.bugly.Bugly;
|
||||
import com.tencent.bugly.beta.Beta;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.nnbc123.app.BuildConfig;
|
||||
@@ -213,12 +213,12 @@ public class XChatApplication extends BaseApp {
|
||||
// 初始化 sp
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
String channel = "";
|
||||
channel = ChannelReaderUtil.getChannel(instance);
|
||||
String channel;
|
||||
channel = MetaDataUtils.INSTANCE.getStringData(Constants.CHANNEL_KEY, application);
|
||||
if (TextUtils.isEmpty(channel)) {
|
||||
channel = "official";
|
||||
}
|
||||
|
||||
Log.d("XChatApplication", "channel:" + channel);
|
||||
BasicConfig.INSTANCE.setOriginalChannel(channel);
|
||||
|
||||
//头条分包渠道
|
||||
@@ -228,6 +228,7 @@ public class XChatApplication extends BaseApp {
|
||||
channel = byteDanceChannel;
|
||||
}
|
||||
}
|
||||
Log.d("XChatApplication", "channel2:" + channel);
|
||||
BasicConfig.INSTANCE.setChannel(channel);
|
||||
|
||||
initEnv();
|
||||
@@ -306,7 +307,7 @@ public class XChatApplication extends BaseApp {
|
||||
// 集成测试
|
||||
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
|
||||
} else {
|
||||
CustomerServerHelper.init(instance, null);
|
||||
// CustomerServerHelper.init(instance, null);
|
||||
}
|
||||
|
||||
LogUtils.d("init time = " + (System.currentTimeMillis() - startTime) + "ms");
|
||||
|
@@ -2,15 +2,12 @@ package com.nnbc123.app.avroom.activity;
|
||||
|
||||
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ALL_SERVICE_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_PK;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_NOTIFY;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -65,10 +62,6 @@ import com.nnbc123.app.ui.user.UserInfoActivity;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.app.ui.widget.NobleOpenNoticeView;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftLevelOneDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftLevelThreeDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftLevelTwoDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.MonsterDialog;
|
||||
import com.nnbc123.app.ui.widget.marqueeview.Utils;
|
||||
import com.nnbc123.app.utils.UserUtils;
|
||||
@@ -92,7 +85,6 @@ import com.nnbc123.core.monsterhunting.bean.MonsterHuntingResult;
|
||||
import com.nnbc123.core.monsterhunting.bean.MonsterInfo;
|
||||
import com.nnbc123.core.monsterhunting.bean.MonsterProtocol;
|
||||
import com.nnbc123.core.monsterhunting.manager.MonsterDataManager;
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol;
|
||||
import com.nnbc123.core.noble.NobleInfo;
|
||||
import com.nnbc123.core.noble.NobleResourceType;
|
||||
import com.nnbc123.core.noble.NobleUtil;
|
||||
@@ -119,7 +111,6 @@ import com.nnbc123.core.utils.LogUtils;
|
||||
import com.nnbc123.core.utils.StringUtils;
|
||||
import com.nnbc123.library.base.factory.CreatePresenter;
|
||||
import com.nnbc123.library.rxbus.RxBus;
|
||||
import com.nnbc123.library.utils.JavaUtil;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.nnbc123.library.utils.UIUtils;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
@@ -137,7 +128,6 @@ import java.lang.ref.WeakReference;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -197,8 +187,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
/*********************************显示全服礼物***************************************/
|
||||
|
||||
private GiftBroadcastObserver giftObserver;
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private boolean isResume = true;
|
||||
@Nullable
|
||||
private SingleRoomTipDialog singleRoomTipDialog;
|
||||
@@ -501,9 +489,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
super.onResume();
|
||||
AvRoomDataManager.get().roomNoDestory = true;
|
||||
registerGiftBroadcastMessage(true);
|
||||
if (giftList != null) {
|
||||
giftList.clear();
|
||||
}
|
||||
isResume = true;
|
||||
}
|
||||
|
||||
@@ -904,12 +889,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
monsterDialog.dismiss();
|
||||
monsterDialog = null;
|
||||
}
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
giftDialog.setOnDismissListener(null);
|
||||
giftDialog.dismiss();
|
||||
giftDialog = null;
|
||||
}
|
||||
|
||||
if (limitEnterRoomHelper != null) {
|
||||
limitEnterRoomHelper.release();
|
||||
}
|
||||
@@ -1190,30 +1169,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (baseProtocol == null) return;
|
||||
|
||||
switch (baseProtocol.getFirst()) {
|
||||
case CUSTOM_MSG_HEADER_TYPE_GIFT:
|
||||
if (!isValid()) return;
|
||||
if (giftList == null) {
|
||||
giftList = new LinkedList<>();
|
||||
}
|
||||
int second2 = baseProtocol.getSecond();
|
||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||
if (data == null || data.getGiftUrl() == null || data.isCeremonyGift())
|
||||
return;
|
||||
giftList.add(data);
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY) {
|
||||
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
|
||||
@@ -1236,39 +1191,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (giftList.size() == 0) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, giftList.peekFirst());
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
} else {
|
||||
giftList.clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
giftDialog.show();
|
||||
}
|
||||
|
||||
private AllServiceGiftDialog generateAllServiceGiftDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
switch (JavaUtil.str2int(dataBean.getLevelNum())) {
|
||||
default:
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_1:
|
||||
return new AllServiceGiftLevelOneDialog(context, dataBean);
|
||||
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_2:
|
||||
|
||||
return new AllServiceGiftLevelTwoDialog(context, dataBean);
|
||||
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_3:
|
||||
return new AllServiceGiftLevelThreeDialog(context, dataBean);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
@@ -3,13 +3,16 @@ package com.nnbc123.app.avroom.fragment
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.text.TextUtils
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.*
|
||||
@@ -115,6 +118,7 @@ import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomKickOutEvent
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
|
||||
import com.nnbc123.app.avroom.hour_rank.RoomHourRankWidget
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.orhanobut.logger.Logger
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||
@@ -675,7 +679,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
.getRoomQueueMemberInfoByAccount(myUid.toString())
|
||||
if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) {
|
||||
bottomView.setMicBtnEnable(true)
|
||||
bottomView.setMicBtnOpen(true)
|
||||
if (AudioEngineManager.get().isMute) {
|
||||
bottomView.setMicBtnOpen(false)
|
||||
} else {
|
||||
bottomView.setMicBtnOpen(true)
|
||||
}
|
||||
} else if (roomQueueInfo?.mChatRoomMember != null
|
||||
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
|
||||
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
|
||||
@@ -996,7 +1004,15 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
(roomInfo.isLeaveMode || AvRoomDataManager.get().isSingleRoom)
|
||||
&& position == -1
|
||||
) {
|
||||
showUserCardDialog(roomInfo.uid.toString())
|
||||
val currentUid = AuthModel.get().currentUid.toString()
|
||||
if (roomInfo.isLeaveMode && !AvRoomDataManager.get().isSingleRoom && (AvRoomDataManager.get()
|
||||
.isRoomOwner(currentUid) || AvRoomDataManager.get().isRoomAdmin(currentUid)
|
||||
|| SuperAdminUtil.isSuperAdmin())
|
||||
) {
|
||||
SingleToastUtil.showToast("请先关闭离开模式")
|
||||
} else {
|
||||
showUserCardDialog(roomInfo.uid.toString())
|
||||
}
|
||||
} else {
|
||||
val roomQueueInfo = AvRoomDataManager.get()
|
||||
.getRoomQueueMemberInfoByMicPosition(position)
|
||||
@@ -1146,11 +1162,37 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (result) {
|
||||
mvpPresenter?.upMicroPhone(micPosition, currentUid, b)
|
||||
} else {
|
||||
toast("请给予麦克风权限后再试!")
|
||||
showDeniedTips(
|
||||
requireContext(),
|
||||
ResUtil.getString(R.string.permission_denied_tips_mic)
|
||||
)
|
||||
}
|
||||
}, { throwable: Throwable? -> toast("发生一些异常,请稍后重试!") })
|
||||
}
|
||||
|
||||
private fun showDeniedTips(context: Context, message: String) {
|
||||
CommonTipDialog(context).apply {
|
||||
setTipMsg(message)
|
||||
setOkText("去设置")
|
||||
setOnActionListener(
|
||||
object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
//同意跳到应用详情页面
|
||||
val packageUri =
|
||||
Uri.parse("package:${context.packageName}")
|
||||
val intent = Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
packageUri
|
||||
)
|
||||
(context as? Activity)?.startActivityForResult(
|
||||
intent, 0
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有麦克风权限
|
||||
*
|
||||
|
@@ -554,36 +554,20 @@ class HomePartyFragment : BaseFragment(), View.OnClickListener, OnShareDialogIte
|
||||
.compose(bindToLifecycle())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe { roomContributeDataInfo: RoomContributeDataInfo ->
|
||||
val rankings = roomContributeDataInfo.rankings
|
||||
updateRoomRanks(roomContributeDataInfo.rankings)
|
||||
var imageView: ImageView
|
||||
val avatarList = listOf(
|
||||
binding.ivRank0,
|
||||
binding.ivRank1,
|
||||
binding.ivRank2
|
||||
)
|
||||
for (i in avatarList.indices) {
|
||||
imageView = avatarList[i]
|
||||
if (rankings.size > i) {
|
||||
val info = rankings[i]
|
||||
imageView.loadAvatar(info.avatar)
|
||||
} else {
|
||||
imageView.setImageResource(R.drawable.default_avatar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateRoomRanks(data: List<RoomContributeUserInfo>) {
|
||||
val avatarList = arrayListOf(
|
||||
binding.ivRank0,
|
||||
// binding.ivRank1,
|
||||
// binding.ivRank2
|
||||
binding.ivRank1,
|
||||
binding.ivRank2
|
||||
)
|
||||
val stvList = arrayListOf(
|
||||
binding.stvRank0,
|
||||
// binding.stvRank1,
|
||||
// binding.stvRank2
|
||||
binding.stvRank1,
|
||||
binding.stvRank2
|
||||
)
|
||||
for (i in 0 until avatarList.size) {
|
||||
avatarList[i].loadAvatar(data.getOrNull(i)?.avatar)
|
||||
|
@@ -125,59 +125,6 @@ public class GiftEffectView extends RelativeLayout implements SVGACallback {
|
||||
giftInfo = giftEffectInfo.getGift();
|
||||
}
|
||||
if (giftInfo != null) {
|
||||
int totalCoin = giftInfo.getGoldPrice() * giftEffectInfo.getGiftNum() * giftEffectInfo.getTargetUsers().size();
|
||||
if (totalCoin >= 520 &&
|
||||
giftEffectInfo.getGiftReceiveType() != GiftEffectInfo.GIFT_RECEIVE_TYPE_LUCKY
|
||||
&& !AvRoomDataManager.get().isSelfGamePlaying()) {//礼物栏
|
||||
ImageLoadUtils.loadImage(benefactorAvatar.getContext(), giftEffectInfo.getAvatar(), benefactorAvatar);
|
||||
ImageLoadUtils.loadImage(giftImg.getContext(), giftInfo.getGiftUrl(), giftImg);
|
||||
benefactorNick.setText(giftEffectInfo.getNick());
|
||||
giftNumber.setText("X" + giftEffectInfo.getGiftNum());
|
||||
giftName.setText(giftInfo.getGiftName());
|
||||
container.setVisibility(VISIBLE);
|
||||
if (giftEffectInfo.getGiftReceiveType() == GiftEffectInfo.GIFT_RECEIVE_TYPE_SINGLE) {
|
||||
GiftReceiver giftReceiver = giftEffectInfo.getTargetUsers().get(0);
|
||||
ImageLoadUtils.loadAvatar(receiverAvatar.getContext(), giftReceiver.getAvatar(), receiverAvatar);
|
||||
receiverNick.setText(giftReceiver.getNick());
|
||||
} else if (giftEffectInfo.getGiftReceiveType() == GiftEffectInfo.GIFT_RECEIVE_TYPE_ALL) {
|
||||
receiverAvatar.setImageResource(R.mipmap.app_logo);
|
||||
receiverNick.setText("全麦");
|
||||
} else if (giftEffectInfo.getGiftReceiveType() == GiftEffectInfo.GIFT_RECEIVE_TYPE_MULTI) {
|
||||
receiverAvatar.setImageResource(R.mipmap.app_logo);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (GiftReceiver targetUser : giftEffectInfo.getTargetUsers()) {
|
||||
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByAccount(targetUser.getUid() + "");
|
||||
if (roomQueueInfo == null) continue;
|
||||
sb.append(roomQueueInfo.mRoomMicInfo.getPosition() + 1).append("麦").append(",");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.replace(sb.lastIndexOf(","), sb.length(), "");
|
||||
}
|
||||
receiverNick.setText(sb.toString());
|
||||
}
|
||||
|
||||
Animation operatingAnim = AnimationUtils.loadAnimation(getContext(), R.anim.light_bg_rotate_anim);
|
||||
LinearInterpolator lin = new LinearInterpolator();
|
||||
operatingAnim.setInterpolator(lin);
|
||||
giftLightBg.setAnimation(operatingAnim);
|
||||
|
||||
final Point center = new Point();
|
||||
center.x = ResolutionUtils.getScreenWidth(getContext()) / 2;
|
||||
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(container, "translationX", -UIUtil.dip2px(getContext(), 400), center.x - container.getWidth() / 2).setDuration(500);
|
||||
objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimator.start();
|
||||
|
||||
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(container, "alpha", 0.0F, 1.0F).setDuration(500);
|
||||
objectAnimator1.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimator1.start();
|
||||
if (totalCoin < 4999) {
|
||||
imgBg.setImageResource(R.drawable.icon_gift_effect_bg_1);
|
||||
} else if (totalCoin < 9999) {
|
||||
imgBg.setImageResource(R.drawable.icon_gift_effect_bg_2);
|
||||
} else {
|
||||
imgBg.setImageResource(R.drawable.icon_gift_effect_bg_3);
|
||||
}
|
||||
}
|
||||
effectHandler.sendEmptyMessageDelayed(0, 6000);
|
||||
if (giftInfo.getOtherViewType() == 1 && !TextUtils.isEmpty(giftInfo.getViewUrl())) {
|
||||
drawVAPEffect(giftInfo.getViewUrl());
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.nnbc123.app.avroom.widget;
|
||||
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KITCHEN;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_PRIVILEGE;
|
||||
@@ -93,6 +94,7 @@ import com.nnbc123.core.im.custom.bean.CarveUpGoldAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.CleanScreenAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.CustomAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.DatingAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.DressUpGiftAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.FaceAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.FansTeamMsgAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.GiftAttachment;
|
||||
@@ -121,6 +123,7 @@ import com.nnbc123.core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.RoomTipAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.TarotAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.TarotMsgBean;
|
||||
import com.nnbc123.core.im.custom.bean.UnLockGiftAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.VipMessageAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.WelcomeAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.WishListAttachment;
|
||||
@@ -215,6 +218,7 @@ public class MessageView extends FrameLayout {
|
||||
private int whiteColor;
|
||||
private int greyColor;
|
||||
private int appColor;
|
||||
private int giftColor;
|
||||
private int badgeWidth;
|
||||
private int badgeHeight;
|
||||
private int sysIconHeight;
|
||||
@@ -277,6 +281,7 @@ public class MessageView extends FrameLayout {
|
||||
whiteColor = ContextCompat.getColor(context, R.color.white);
|
||||
greyColor = ContextCompat.getColor(context, R.color.white_transparent_50);
|
||||
appColor = ContextCompat.getColor(context, R.color.app_color);
|
||||
giftColor = ContextCompat.getColor(context, R.color.color_5CEFFF);
|
||||
paddingWidth = Utils.dip2px(context, 10);
|
||||
paddingHeight = Utils.dip2px(context, 8);
|
||||
badgeWidth = Utils.dip2px(context, 15);
|
||||
@@ -1011,6 +1016,13 @@ public class MessageView extends FrameLayout {
|
||||
if (second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND || second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND_VIDEO) {
|
||||
setPrivilegeNoticeMessage(chatRoomMessage, tvContent);
|
||||
}
|
||||
} else if (first == CUSTOM_MSG_GIFT) {
|
||||
setVIPMessageBackground(chatRoomMessage, tvContent);
|
||||
if (second == CustomAttachment.CUSTOM_MSG_GIFT_UNLOCK) {
|
||||
setUnLockGiftMsg(tvContent, (UnLockGiftAttachment) attachment, chatRoomMessage);
|
||||
} else if (second == CustomAttachment.CUSTOM_MSG_GIFT_DRESS) {
|
||||
setDressGiftMsg(tvContent, (DressUpGiftAttachment) attachment, chatRoomMessage);
|
||||
}
|
||||
} else {
|
||||
tvContent.setTextColor(Color.WHITE);
|
||||
tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip));
|
||||
@@ -2928,6 +2940,53 @@ public class MessageView extends FrameLayout {
|
||||
|
||||
}
|
||||
|
||||
private void setUnLockGiftMsg(TextView tvContent, UnLockGiftAttachment attachment, ChatRoomMessage chatRoomMessage) {
|
||||
if (attachment == null) return;
|
||||
String nick = RegexUtil.getPrintableString(attachment.getNick());
|
||||
String giftName = attachment.getGiftNameNotNull();
|
||||
String giftImage = attachment.getGiftUrlNotNull();
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append(getNewUserDrawable(chatRoomMessage), badgeWidth, badgeHeight)
|
||||
.append(nick, new ForegroundColorSpan(appColor), new OriginalDrawStatusClickSpan() {
|
||||
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (clickConsumer != null) {
|
||||
Single.just(chatRoomMessage.getFromAccount()).subscribe(clickConsumer);
|
||||
}
|
||||
}
|
||||
})
|
||||
.append(" 已解锁礼物 ", new ForegroundColorSpan(whiteColor))
|
||||
.append(giftImage, giftLength, giftLength)
|
||||
.append(giftName, new ForegroundColorSpan(giftColor));
|
||||
tvContent.setText(text.build());
|
||||
tvContent.setOnClickListener(null);
|
||||
tvContent.setMovementMethod(new LinkMovementMethod());
|
||||
}
|
||||
|
||||
private void setDressGiftMsg(TextView tvContent, DressUpGiftAttachment attachment, ChatRoomMessage chatRoomMessage) {
|
||||
if (attachment == null) return;
|
||||
String nick = RegexUtil.getPrintableString(attachment.getNick());
|
||||
String dressName = attachment.getDressNameNotNull();
|
||||
String dressImage = attachment.getDressUrlNotNull();
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append(getNewUserDrawable(chatRoomMessage), badgeWidth, badgeHeight)
|
||||
.append(nick, new ForegroundColorSpan(appColor), new OriginalDrawStatusClickSpan() {
|
||||
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (clickConsumer != null) {
|
||||
Single.just(chatRoomMessage.getFromAccount()).subscribe(clickConsumer);
|
||||
}
|
||||
}
|
||||
})
|
||||
.append(" 获得 " + dressName + " ", new ForegroundColorSpan(whiteColor))
|
||||
.append(dressImage, giftLength);
|
||||
tvContent.setText(text.build());
|
||||
tvContent.setOnClickListener(null);
|
||||
tvContent.setMovementMethod(new LinkMovementMethod());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Drawable getNewUserDrawable(ChatRoomMessage chatRoomMessage) {
|
||||
boolean newUser = NobleUtil.getIsNewUser(UserInfo.IS_NEW_USER, chatRoomMessage);
|
||||
|
@@ -4,6 +4,7 @@ import static com.nnbc123.core.Constants.DEBUG_MAX_UID;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_HEAD_NOBLE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ALL_SERVICE_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND;
|
||||
@@ -13,6 +14,7 @@ import static com.nnbc123.library.utils.UIUtils.getActivityByContext;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Dialog;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -34,6 +36,7 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.core.util.Consumer;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
@@ -68,7 +71,7 @@ import com.nnbc123.app.ui.login.LoginPhoneActivity;
|
||||
import com.nnbc123.app.ui.pay.ChargeActivity;
|
||||
import com.nnbc123.app.ui.setting.ResetPasswordActivity;
|
||||
import com.nnbc123.app.ui.widget.DefaultToolBar;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftLevelCeremonyDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceGiftLevelDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.AllServiceVipLevelUPDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.GameInviteDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.OpenNobleGlobalNoticeDialog;
|
||||
@@ -113,6 +116,7 @@ import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
@@ -133,7 +137,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
*/
|
||||
|
||||
protected static final String STATUS_TAG = "STATUS_TAG";
|
||||
private final RxPermissions rxPermissions = new RxPermissions(this);
|
||||
protected final RxPermissions rxPermissions = new RxPermissions(this);
|
||||
protected TitleBar mTitleBar;
|
||||
protected DefaultToolBar mToolBar;
|
||||
protected CompositeDisposable mCompositeDisposable;
|
||||
@@ -144,6 +148,8 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
private OpenNobleGlobalNoticeDialog mNoticeDialog;
|
||||
private boolean isShowingChargeDialog;
|
||||
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -339,7 +345,14 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
mNoticeDialog.dismiss();
|
||||
mNoticeDialog = null;
|
||||
}
|
||||
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
giftDialog.setOnDismissListener(null);
|
||||
giftDialog.dismiss();
|
||||
giftDialog = null;
|
||||
}
|
||||
if (giftList != null) {
|
||||
giftList.clear();
|
||||
}
|
||||
super.onDestroy();
|
||||
LogUtil.i(this.getClass().getName(), "onDestroy");
|
||||
/* ImageLoadUtils.clearMemory(this);*/
|
||||
@@ -507,7 +520,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
.compose(bindUntilEvent(ActivityEvent.PAUSE))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::onRoomEventReceived);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -821,6 +833,17 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}, Throwable::printStackTrace);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void checkPermission(Consumer<Boolean> consumer, String... mPerms) {
|
||||
rxPermissions.request(mPerms)
|
||||
.subscribe(aBoolean -> {
|
||||
if (consumer != null) {
|
||||
consumer.accept(aBoolean);
|
||||
}
|
||||
}, Throwable::printStackTrace);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public Observable<Boolean> checkPermission(String... mPerms) {
|
||||
return rxPermissions.request(mPerms);
|
||||
@@ -918,15 +941,53 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
UserUtils.getUserInfo() == null)
|
||||
return;
|
||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||
if (data == null || data.getGiftUrl() == null || !data.isCeremonyGift())
|
||||
if (data == null || data.getGiftUrl() == null)
|
||||
return;
|
||||
new AllServiceGiftLevelCeremonyDialog(context, data).show();
|
||||
if (giftList == null) {
|
||||
giftList = new LinkedList<>();
|
||||
}
|
||||
int second2 = baseProtocol.getSecond();
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
giftList.add(data);
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (giftList.size() == 0) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, giftList.peekFirst());
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
} else {
|
||||
giftList.clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
giftDialog.show();
|
||||
}
|
||||
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
return new AllServiceGiftLevelDialog(context, dataBean);
|
||||
}
|
||||
|
||||
public void onGrabApprenticesEvent(GrabApprenticesEvent event) {
|
||||
if (!isTopActivity()) return;
|
||||
if (dialog != null && dialog.isAdded()) {
|
||||
|
@@ -5,13 +5,17 @@ import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.nnbc123.app.ui.utils.getActivityContext
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.nnbc123.app.ui.utils.getActivityContext
|
||||
import com.trello.rxlifecycle3.components.support.RxDialogFragment
|
||||
import java.lang.Exception
|
||||
import java.lang.reflect.ParameterizedType
|
||||
|
||||
abstract class BaseDialog<T : ViewBinding> : RxDialogFragment() {
|
||||
@@ -57,9 +61,13 @@ abstract class BaseDialog<T : ViewBinding> : RxDialogFragment() {
|
||||
}
|
||||
|
||||
fun show(context: Context?) {
|
||||
if (context == null) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
context?.let {
|
||||
show((getActivityContext(it) as FragmentActivity).supportFragmentManager, null)
|
||||
val fragmentActivity = getActivityContext(context) as? FragmentActivity
|
||||
fragmentActivity?.lifecycleScope?.launchWhenResumed {
|
||||
show(fragmentActivity.supportFragmentManager, null)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
@@ -0,0 +1,38 @@
|
||||
package com.nnbc123.app.common.permission
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/1/8 10:25
|
||||
* Desc:
|
||||
**/
|
||||
object PermissionHelper {
|
||||
|
||||
fun isGranted(context: Context, permission: String): Boolean {
|
||||
return ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
permission
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查权限是否都授权
|
||||
*/
|
||||
fun isAllGranted(context: Context, vararg permissions: String): Boolean {
|
||||
return permissions.firstOrNull {
|
||||
!isGranted(context, it)
|
||||
} == null
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查权限是否都授权
|
||||
*/
|
||||
fun isAllGranted(rxPermissions: RxPermissions, vararg perms: String): Boolean {
|
||||
return perms.firstOrNull {
|
||||
!rxPermissions.isGranted(it)
|
||||
} == null
|
||||
}
|
||||
}
|
@@ -3,7 +3,9 @@ package com.nnbc123.app.common.widget;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@@ -67,22 +69,26 @@ public class DragLayout extends RelativeLayout {
|
||||
parentHeight = parent.getHeight();
|
||||
}
|
||||
|
||||
if (left < 0) {
|
||||
left = 0;
|
||||
int parentPaddingLeft = getParentPaddingLeft();
|
||||
if (left < parentPaddingLeft) {
|
||||
left = parentPaddingLeft;
|
||||
right = left + getWidth();
|
||||
}
|
||||
if (right > parentWidth) {
|
||||
right = parentWidth;
|
||||
int paddingPaddingRight = getParentPaddingRight();
|
||||
if (right > (parentWidth - paddingPaddingRight)) {
|
||||
right = (parentWidth - paddingPaddingRight);
|
||||
left = right - getWidth();
|
||||
}
|
||||
if (top < 0) {
|
||||
top = 0;
|
||||
|
||||
int parentPaddingTop = getParentPaddingTop();
|
||||
if (top < parentPaddingTop) {
|
||||
top = parentPaddingTop;
|
||||
bottom = top + getHeight();
|
||||
}
|
||||
|
||||
if (bottom > parentHeight) {
|
||||
|
||||
bottom = parentHeight;
|
||||
int paddingPaddingBottom = getParentPaddingBottom();
|
||||
if (bottom > (parentHeight - paddingPaddingBottom)) {
|
||||
bottom = (parentHeight - paddingPaddingBottom);
|
||||
top = bottom - getHeight();
|
||||
}
|
||||
|
||||
@@ -117,8 +123,8 @@ public class DragLayout extends RelativeLayout {
|
||||
}
|
||||
|
||||
if (layoutParams != null) {
|
||||
layoutParams.leftMargin = left;
|
||||
layoutParams.topMargin = top;
|
||||
layoutParams.leftMargin = left - getParentPaddingLeft();
|
||||
layoutParams.topMargin = top - getParentPaddingTop();
|
||||
layoutParams.width = getWidth();
|
||||
layoutParams.height = getHeight();
|
||||
setLayoutParams(layoutParams);
|
||||
@@ -150,22 +156,26 @@ public class DragLayout extends RelativeLayout {
|
||||
parentHeight = parent.getHeight();
|
||||
}
|
||||
|
||||
if (left < 0) {
|
||||
left = 0;
|
||||
int parentPaddingLeft = getParentPaddingLeft();
|
||||
if (left < parentPaddingLeft) {
|
||||
left = parentPaddingLeft;
|
||||
right = left + getWidth();
|
||||
}
|
||||
if (right > parentWidth) {
|
||||
right = parentWidth;
|
||||
int paddingPaddingRight = getParentPaddingRight();
|
||||
if (right > (parentWidth - paddingPaddingRight)) {
|
||||
right = (parentWidth - paddingPaddingRight);
|
||||
left = right - getWidth();
|
||||
}
|
||||
if (top < 0) {
|
||||
top = 0;
|
||||
|
||||
int parentPaddingTop = getParentPaddingTop();
|
||||
if (top < parentPaddingTop) {
|
||||
top = parentPaddingTop;
|
||||
bottom = top + getHeight();
|
||||
}
|
||||
|
||||
if (bottom > parentHeight) {
|
||||
|
||||
bottom = parentHeight;
|
||||
int paddingPaddingBottom = getParentPaddingBottom();
|
||||
if (bottom > (parentHeight - paddingPaddingBottom)) {
|
||||
bottom = (parentHeight - paddingPaddingBottom);
|
||||
top = bottom - getHeight();
|
||||
}
|
||||
|
||||
@@ -192,4 +202,36 @@ public class DragLayout extends RelativeLayout {
|
||||
return super.performClick();
|
||||
}
|
||||
|
||||
|
||||
protected int getParentPaddingLeft() {
|
||||
ViewParent viewParent = getParent();
|
||||
if (viewParent instanceof View) {
|
||||
return ((View) viewParent).getPaddingLeft();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int getParentPaddingRight() {
|
||||
ViewParent viewParent = getParent();
|
||||
if (viewParent instanceof View) {
|
||||
return ((View) viewParent).getPaddingRight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int getParentPaddingTop() {
|
||||
ViewParent viewParent = getParent();
|
||||
if (viewParent instanceof View) {
|
||||
return ((View) viewParent).getPaddingTop();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int getParentPaddingBottom() {
|
||||
ViewParent viewParent = getParent();
|
||||
if (viewParent instanceof View) {
|
||||
return ((View) viewParent).getPaddingBottom();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package com.nnbc123.app.decoration.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.nnbc123.app.R;
|
||||
@@ -39,62 +38,22 @@ public class MyCarAdapter extends BaseAdapter<CarInfo> {
|
||||
|
||||
helper.addOnClickListener(R.id.tv_used);
|
||||
|
||||
// 倒计时
|
||||
int remainingDay = item.getRemainingDay();
|
||||
int status = item.getStatus();
|
||||
boolean canUse;
|
||||
|
||||
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) {
|
||||
canUse = true;
|
||||
} else {
|
||||
canUse = false;
|
||||
}
|
||||
|
||||
// 时间
|
||||
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) {
|
||||
String days;
|
||||
if (item.getRemainingDay() > 99){
|
||||
days = "99+";
|
||||
}else {
|
||||
days = item.getRemainingDay()+"";
|
||||
if (item.getStatus() == CarInfo.STATUS_USER_CAN_USE) {
|
||||
binding.tvUsed.setVisibility(View.VISIBLE);
|
||||
binding.tvUsed.setEnabled(true);
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
|
||||
if (item.isUsing()) {
|
||||
binding.tvUsed.setText("取消使用");
|
||||
binding.tvUsed.setBackgroundResource(R.drawable.bg_common_cancel);
|
||||
} else {
|
||||
binding.tvUsed.setText("使用");
|
||||
binding.tvUsed.setBackgroundResource(R.drawable.bg_common_confirm);
|
||||
}
|
||||
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper),
|
||||
binding.tvCounters.getResources().getString(R.string.decoration_remainder) + days + "天"));
|
||||
} else {
|
||||
if (status == CarInfo.STATUS_OFF_SHELF || status == CarInfo.STATUS_OUT_OF_DATE) {
|
||||
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper),
|
||||
binding.tvCounters.getResources().getString(R.string.past_due)));
|
||||
}
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvCounters.setText(binding.tvCounters.getResources().getString(R.string.past_due));
|
||||
}
|
||||
|
||||
|
||||
setUseButton(binding.tvUsed, canUse, item.isUsing());
|
||||
updateTag(item, binding.ivTag);
|
||||
|
||||
}
|
||||
|
||||
private void setUseButton(TextView tvUsed, boolean canUse, boolean isUsing) {
|
||||
|
||||
if (!canUse) {
|
||||
tvUsed.setVisibility(View.GONE);
|
||||
tvUsed.setText("使用");
|
||||
tvUsed.setBackgroundResource(R.drawable.bg_common_disable);
|
||||
tvUsed.setEnabled(false);
|
||||
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_secondary_878b9c));
|
||||
} else if (isUsing) {
|
||||
tvUsed.setVisibility(View.VISIBLE);
|
||||
tvUsed.setText("取消使用");
|
||||
tvUsed.setBackgroundResource(R.drawable.bg_common_cancel);
|
||||
tvUsed.setEnabled(true);
|
||||
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_normal_282828));
|
||||
} else {
|
||||
tvUsed.setVisibility(View.VISIBLE);
|
||||
tvUsed.setText("使用");
|
||||
tvUsed.setBackgroundResource(R.drawable.bg_common_confirm);
|
||||
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_title_282828));
|
||||
tvUsed.setEnabled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateTag(CarInfo carInfo, ImageView ivTag) {
|
||||
|
@@ -55,25 +55,12 @@ public class MyChatBubbleAdapter extends BaseAdapter<ChatBubbleInfo> {
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvUsed.setEnabled(false);
|
||||
binding.tvUsed.setText("使用");
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
binding.tvUsed.setVisibility(View.VISIBLE);
|
||||
binding.tvUsed.setEnabled(true);
|
||||
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
|
||||
}
|
||||
|
||||
// 日期展示
|
||||
if (item.isHasExpired()) { // 过期
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99) {
|
||||
days = "99+";
|
||||
} else {
|
||||
days = item.getExpireDays() + "";
|
||||
}
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,30 +46,14 @@ public class MyHeadWearAdapter extends BaseAdapter<HeadWearInfo> {
|
||||
binding.ivTag.setImageResource(R.drawable.ic_mark_exclusive);
|
||||
}
|
||||
|
||||
// 过期状态不可使用
|
||||
if (item.getStatus() == 2) {
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvUsed.setEnabled(false);
|
||||
binding.tvUsed.setText("使用");
|
||||
} else {
|
||||
if (item.getStatus() == 1) {
|
||||
binding.tvUsed.setVisibility(View.VISIBLE);
|
||||
binding.tvUsed.setEnabled(true);
|
||||
|
||||
}
|
||||
|
||||
// 日期展示
|
||||
if (item.getStatus() == 2) { // 过期
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99){
|
||||
days = "99+";
|
||||
}else {
|
||||
days = item.getExpireDays()+"";
|
||||
}
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -32,31 +32,16 @@ public class MyNamePlateAdapter extends BaseQuickAdapter<NamePlateInfo.Nameplate
|
||||
.load(item.getNameplateImage())
|
||||
.into(ivCover);
|
||||
|
||||
|
||||
//使用按钮
|
||||
TextView tvUsed = helper.getView(R.id.tv_used);
|
||||
tvUsed.setBackgroundResource(item.isUsing() ? R.drawable.bg_common_cancel : R.drawable.bg_common_confirm);
|
||||
tvUsed.setTextColor(item.isUsing() ? mContext.getResources().getColor(R.color.color_4C5AF1) :
|
||||
mContext.getResources().getColor(R.color.white));
|
||||
tvUsed.setText(item.isUsing() ? R.string.label_used : R.string.label_can_use);
|
||||
if (item.isIsExpired()) { // 过期
|
||||
// 日期展示
|
||||
if (!item.isExpired()) {
|
||||
helper.setText(R.id.tv_counters, mContext.getString(R.string.decoration_remainder) + item.getExpireText());
|
||||
tvUsed.setVisibility(View.VISIBLE);
|
||||
tvUsed.setText(item.isUsing() ? R.string.label_used : R.string.label_can_use);
|
||||
tvUsed.setEnabled(true);
|
||||
tvUsed.setBackgroundResource(item.isUsing() ? R.drawable.bg_common_cancel : R.drawable.bg_common_confirm);
|
||||
} else {
|
||||
helper.setText(R.id.tv_counters, mContext.getString(R.string.past_due));
|
||||
tvUsed.setVisibility(View.GONE);
|
||||
tvUsed.setEnabled(false);
|
||||
tvUsed.setBackgroundResource(R.drawable.bg_common_disable);
|
||||
tvUsed.setText("使用");
|
||||
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_secondary_878b9c));
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99) {
|
||||
days = "99+";
|
||||
} else {
|
||||
days = item.getExpireDays() + "";
|
||||
}
|
||||
helper.setText(R.id.tv_counters, mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
tvUsed.setVisibility(View.VISIBLE);
|
||||
tvUsed.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,25 +54,12 @@ public class MyUserCardWearAdapter extends BaseAdapter<UserCardWearInfo> {
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvUsed.setEnabled(false);
|
||||
binding.tvUsed.setText("使用");
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
binding.tvUsed.setVisibility(View.VISIBLE);
|
||||
binding.tvUsed.setEnabled(true);
|
||||
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
|
||||
}
|
||||
|
||||
// 日期展示
|
||||
if (item.isHasExpired()) { // 过期
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99) {
|
||||
days = "99+";
|
||||
} else {
|
||||
days = item.getExpireDays() + "";
|
||||
}
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,13 +1,18 @@
|
||||
package com.nnbc123.app.decoration.view.widgets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import com.nnbc123.core.home.bean.TabInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -38,9 +43,9 @@ public class MyDecorationMagicIndicator extends CommonNavigatorAdapter {
|
||||
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||
BadgeScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new BadgeScaleTransitionPagerTitleView(context);
|
||||
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(mContext, R.color.text_secondary_878b9c));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(mContext, R.color.text_title_282828));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(mContext, R.color.color_2B2D33));
|
||||
scaleTransitionPagerTitleView.setMinScale(0.9f);
|
||||
scaleTransitionPagerTitleView.setTextSize(15);
|
||||
scaleTransitionPagerTitleView.setTextSize(14);
|
||||
scaleTransitionPagerTitleView.setText(mTitleList.get(i).getName());
|
||||
if (mTitleList.get(i).getName().equals("座驾")) {
|
||||
scaleTransitionPagerTitleView.findViewById(R.id.car_badge).setId(R.id.car_badge_garage);
|
||||
@@ -62,7 +67,16 @@ public class MyDecorationMagicIndicator extends CommonNavigatorAdapter {
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
return null;
|
||||
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||
indicator.setLineHeight(UIUtil.dip2px(context, 4));
|
||||
indicator.setRoundRadius(UIUtil.dip2px(context, 2));
|
||||
indicator.setLineWidth(UIUtil.dip2px(context, 8));
|
||||
indicator.setColors(Color.parseColor("#FFDA24"));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
//lp.bottomMargin = 0;
|
||||
indicator.setLayoutParams(lp);
|
||||
return indicator;
|
||||
}
|
||||
|
||||
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
|
||||
|
@@ -30,10 +30,10 @@ import com.nnbc123.app.home.activity.VisitorListActivity
|
||||
import com.nnbc123.app.home.adapter.MeCenterAdapter
|
||||
import com.nnbc123.app.home.helper.BannerHelper
|
||||
import com.nnbc123.app.home.helper.OpenRoomHelper
|
||||
import com.nnbc123.app.qiyukefu.CustomerServerHelper
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.start
|
||||
import com.nnbc123.app.support.LevelIconHelper
|
||||
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity
|
||||
import com.nnbc123.app.ui.patriarch.PatriarchModeActivity
|
||||
import com.nnbc123.app.ui.pay.ChargeActivity
|
||||
import com.nnbc123.app.ui.relation.AttentionListActivity
|
||||
@@ -439,7 +439,8 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
UriProvider.getTutuRealNamePage()
|
||||
)
|
||||
R.id.tv_me_service -> {
|
||||
CustomerServerHelper.contactCustomerServer(mContext)
|
||||
NimP2PMessageActivity.start(requireContext(), "200014")
|
||||
// CustomerServerHelper.contactCustomerServer(mContext)
|
||||
}
|
||||
R.id.tv_user_id -> {
|
||||
mUserInfo?.let {
|
||||
|
@@ -106,7 +106,7 @@ class HomeFragment : BaseBindingFragment<HomeFragmentBinding>() {
|
||||
})
|
||||
InitialModel.get().cacheInitInfo?.defaultTab?.let {
|
||||
val tab = it - 1
|
||||
if (it >= 0 && it < tagList.size) {
|
||||
if (tab >= 0 && tab < tagList.size) {
|
||||
mBinding.viewPager.currentItem = tab
|
||||
}
|
||||
}
|
||||
|
@@ -89,10 +89,20 @@ public class OpenRoomHelper {
|
||||
|
||||
@NonNull
|
||||
private static SpannableStringBuilder getCertificationTips(BaseActivity activity) {
|
||||
String tips = activity.getString(R.string.tips_need_to_certification);
|
||||
return getCertificationTips(activity, activity.getString(R.string.tips_need_to_certification_create_room));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static SpannableStringBuilder getCertificationTips(BaseActivity activity, String actionName) {
|
||||
String authentication = activity.getString(R.string.real_name_authentication);
|
||||
String tips = activity.getString(R.string.tips_need_to_certification_format, actionName, authentication);
|
||||
int actionStart = tips.indexOf(actionName);
|
||||
int authenticationStart = tips.indexOf(authentication);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(activity, R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
actionStart, actionStart + actionName.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(activity, R.color.appColor)),
|
||||
authenticationStart, authenticationStart + authentication.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
@@ -21,6 +21,11 @@ import com.qiyukf.unicorn.api.YSFOptions;
|
||||
import com.qiyukf.unicorn.api.YSFUserInfo;
|
||||
import com.qiyukf.unicorn.api.customization.input.ActionPanelOptions;
|
||||
import com.qiyukf.unicorn.api.customization.input.InputPanelOptions;
|
||||
import com.qiyukf.unicorn.api.event.EventCallback;
|
||||
import com.qiyukf.unicorn.api.event.EventProcessFactory;
|
||||
import com.qiyukf.unicorn.api.event.SDKEvents;
|
||||
import com.qiyukf.unicorn.api.event.UnicornEventBase;
|
||||
import com.qiyukf.unicorn.api.event.entry.RequestPermissionEventEntry;
|
||||
import com.soundcloud.android.crop.UriUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -109,7 +114,17 @@ public class CustomerServerHelper {
|
||||
options.uiCustomization.leftAvatar = uri.toString();
|
||||
|
||||
options.uiCustomization.titleCenter = true;
|
||||
|
||||
options.sdkEvents = new SDKEvents();
|
||||
options.sdkEvents.eventProcessFactory = new EventProcessFactory() {
|
||||
@Override
|
||||
public UnicornEventBase eventOf(int i) {
|
||||
if (i == 5) {
|
||||
return new RequestPermissionEvent();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
// appKey 可以在七鱼管理系统->设置->App 接入 页面找到
|
||||
Unicorn.init(context, XChatConstants.QI_YU_KF_KEY, options, new GlideImageLoader(context));
|
||||
Unicorn.initSdk();
|
||||
@@ -133,5 +148,4 @@ public class CustomerServerHelper {
|
||||
Unicorn.logout();
|
||||
isInit = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,133 @@
|
||||
package com.nnbc123.app.qiyukefu
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.provider.Settings
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.chuhai.utils.ktx.asActivity
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.common.permission.PermissionHelper
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.nnbc123.app.ui.widget.dialog.RequestPermissionPromptDialog
|
||||
import com.nnbc123.library.utils.ResUtil
|
||||
import com.qiyukf.unicorn.api.event.EventCallback
|
||||
import com.qiyukf.unicorn.api.event.UnicornEventBase
|
||||
import com.qiyukf.unicorn.api.event.entry.RequestPermissionEventEntry
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/1/4 11:10
|
||||
* Desc:
|
||||
**/
|
||||
class RequestPermissionEvent : UnicornEventBase<RequestPermissionEventEntry> {
|
||||
override fun onEvent(
|
||||
p0: RequestPermissionEventEntry?,
|
||||
p1: Context?,
|
||||
p2: EventCallback<RequestPermissionEventEntry>?
|
||||
) {
|
||||
val tips = getPermissionTips(p0?.scenesType)
|
||||
val activity = (p1?.asActivity() as? FragmentActivity)
|
||||
val perms = p0?.permissionList?.toTypedArray()
|
||||
if (RequestPermissionPromptDialog.isNeedPrompt()
|
||||
&& tips != null
|
||||
&& activity != null
|
||||
&& perms != null
|
||||
) {
|
||||
val rxPermissions = RxPermissions(activity)
|
||||
if (PermissionHelper.isAllGranted(rxPermissions, * perms)) {
|
||||
p2?.onNotPorcessEvent()
|
||||
} else {
|
||||
RequestPermissionPromptDialog(p1, tips).show()
|
||||
val d = rxPermissions.request(*perms).subscribe({ aBoolean: Boolean? ->
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
if (aBoolean == true) {
|
||||
p2?.onProcessEventSuccess(p0)
|
||||
} else {
|
||||
showDeniedTips(p1, tips)
|
||||
p2?.onInterceptEvent()
|
||||
}
|
||||
}) { obj: Throwable ->
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
obj.printStackTrace()
|
||||
p2?.onNotPorcessEvent()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
p2?.onNotPorcessEvent()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDenyEvent(p0: Context?, p1: RequestPermissionEventEntry?): Boolean {
|
||||
if (p0 == null) {
|
||||
return super.onDenyEvent(p0, p1)
|
||||
}
|
||||
val tips = getPermissionTips(p1?.scenesType)
|
||||
return if (tips != null) {
|
||||
showDeniedTips(p0, tips)
|
||||
true
|
||||
} else {
|
||||
super.onDenyEvent(p0, p1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取场景对应的权限提示信息(不需要提示的权限返回null)
|
||||
*/
|
||||
private fun getPermissionTips(scenesType: Int?): String? {
|
||||
when (scenesType) {
|
||||
RequestPermissionEventEntry.SCENES_TAKE_AUDIO -> {
|
||||
return ResUtil.getString(R.string.permission_denied_tips_mic)
|
||||
}
|
||||
|
||||
RequestPermissionEventEntry.SCENES_TAKE_VIDEO -> {
|
||||
return StringBuffer().append("1.")
|
||||
.append(ResUtil.getString(R.string.permission_denied_tips_camera))
|
||||
.append("\n2.").append(ResUtil.getString(R.string.permission_denied_tips_mic))
|
||||
.toString()
|
||||
}
|
||||
|
||||
RequestPermissionEventEntry.SCENES_TAKE_PHOTO -> {
|
||||
return ResUtil.getString(R.string.permission_denied_tips_camera)
|
||||
}
|
||||
|
||||
RequestPermissionEventEntry.SCENES_SELECT_MEDIA,
|
||||
RequestPermissionEventEntry.SCENES_SAVE_IMAGE,
|
||||
RequestPermissionEventEntry.SCENES_SAVE_VIDEO,
|
||||
RequestPermissionEventEntry.SCENES_SELECT_VIDEO,
|
||||
RequestPermissionEventEntry.SCENES_SELECT_FILE,
|
||||
RequestPermissionEventEntry.SCENES_SELECT_IMAGE,
|
||||
RequestPermissionEventEntry.SCENES_VIDEO_CHAT -> {
|
||||
return ResUtil.getString(R.string.permission_denied_tips_image)
|
||||
}
|
||||
|
||||
else -> {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDeniedTips(context: Context, message: String) {
|
||||
CommonTipDialog(context).apply {
|
||||
setTipMsg(message)
|
||||
setOkText("去设置")
|
||||
setOnActionListener(
|
||||
object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
//同意跳到应用详情页面
|
||||
val packageUri =
|
||||
Uri.parse("package:${context.packageName}")
|
||||
val intent = Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
packageUri
|
||||
)
|
||||
(context as? Activity)?.startActivityForResult(
|
||||
intent, 0
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}.show()
|
||||
}
|
||||
}
|
@@ -8,12 +8,15 @@ import android.view.View
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.base.BaseBindingActivity
|
||||
import com.nnbc123.app.common.permission.PermissionHelper
|
||||
import com.nnbc123.app.databinding.ActivitySkillEditBinding
|
||||
import com.nnbc123.core.skill.entity.SkillPropertyEntity
|
||||
import com.nnbc123.app.skill.repository.SkillDataManager
|
||||
import com.nnbc123.app.skill.repository.SkillModel
|
||||
import com.nnbc123.app.skill.widget.CARD_TYPE_AUDIO
|
||||
import com.nnbc123.app.ui.widget.dialog.RequestPermissionPromptDialog
|
||||
import com.nnbc123.core.skill.entity.SkillPropertyEntity
|
||||
import com.nnbc123.library.annatation.ActLayoutRes
|
||||
import com.nnbc123.library.utils.ResUtil
|
||||
|
||||
@ActLayoutRes(R.layout.activity_skill_edit)
|
||||
class AddSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
@@ -79,11 +82,24 @@ class AddSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun checkPermissionAndDeal(it: SkillPropertyEntity) {
|
||||
checkPermission(
|
||||
val tips = StringBuffer().append("1.")
|
||||
.append(ResUtil.getString(R.string.permission_denied_tips_mic))
|
||||
.append("\n2.").append(ResUtil.getString(R.string.permission_denied_tips_image))
|
||||
.toString()
|
||||
val params = arrayOf(
|
||||
Manifest.permission.RECORD_AUDIO,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||
)
|
||||
if (RequestPermissionPromptDialog.isNeedPrompt() && !PermissionHelper.isAllGranted(
|
||||
rxPermissions,
|
||||
*params
|
||||
)
|
||||
) {
|
||||
RequestPermissionPromptDialog(this, tips).show()
|
||||
}
|
||||
checkPermission(*params)
|
||||
.subscribe { aBoolean: Boolean ->
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
if (aBoolean) {
|
||||
setSkillViewData(it)
|
||||
} else {
|
||||
|
@@ -10,6 +10,7 @@ import android.graphics.drawable.Drawable;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.vip.VipHelper;
|
||||
import com.nnbc123.core.gift.bean.GiftInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftType;
|
||||
import com.nnbc123.core.gift.bean.SimpleVipInfo;
|
||||
import com.nnbc123.library.bindinglist.BaseItem;
|
||||
|
||||
@@ -28,6 +29,8 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
|
||||
public final ObservableField<String> countText = new ObservableField<>();
|
||||
|
||||
public final ObservableBoolean isLocked = new ObservableBoolean();
|
||||
|
||||
public Drawable nobleDrawable;
|
||||
|
||||
public Drawable radishDrawable;
|
||||
@@ -54,8 +57,6 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
*/
|
||||
public boolean isExclusive;
|
||||
|
||||
public boolean isLocked;
|
||||
|
||||
public String vipIcon;
|
||||
|
||||
public boolean isPrivateChat;
|
||||
@@ -64,13 +65,13 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
super(context, data);
|
||||
this.isSelect.set(select);
|
||||
if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_GOLD) {
|
||||
radishDrawable = null;
|
||||
radishDrawableSelected = null;
|
||||
radishDrawable = context.getResources().getDrawable(R.drawable.gift_dialog_ic_diamond);
|
||||
radishDrawableSelected = context.getResources().getDrawable(R.drawable.gift_dialog_ic_diamond);
|
||||
} else {
|
||||
radishDrawable = context.getResources().getDrawable(R.drawable.icon_radish_transparent);
|
||||
radishDrawableSelected = context.getResources().getDrawable(R.drawable.icon_radish_transparent_selected);
|
||||
}
|
||||
goldText.set(data.getGoldPrice() + "钻石");
|
||||
goldText.set(String.valueOf(data.getGoldPrice()));
|
||||
this.isKnap.set(isKnap);
|
||||
updateCount();
|
||||
int nobleId = data.getLevel();
|
||||
@@ -88,8 +89,8 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
isShowEffect = data.isHasEffect();
|
||||
isExclusive = data.isRoomExclude();
|
||||
SimpleVipInfo vipInfo = data.getGiftVipInfo();
|
||||
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
|
||||
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
|
||||
isLocked.set(getIsLocked());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,4 +107,23 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
this.countText.set("x" + data.getCount());
|
||||
}
|
||||
|
||||
public void refreshUnlockState() {
|
||||
isLocked.set(getIsLocked());
|
||||
}
|
||||
|
||||
private boolean getIsLocked() {
|
||||
if (isKnap.get()) {
|
||||
return false;
|
||||
}
|
||||
SimpleVipInfo vipInfo = data.getGiftVipInfo();
|
||||
boolean isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
|
||||
if (!isLocked) {
|
||||
if (data.getGiftType() == GiftType.GIFT_TYPE_UNLOCK) {
|
||||
if (!data.isUnlocked()) {
|
||||
isLocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isLocked;
|
||||
}
|
||||
}
|
||||
|
@@ -2,17 +2,18 @@ package com.nnbc123.app.ui.im.fragment;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -20,6 +21,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.util.Consumer;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
||||
import com.netease.nim.uikit.api.UIKitOptions;
|
||||
@@ -53,12 +55,15 @@ import com.netease.nimlib.sdk.robot.model.NimRobotInfo;
|
||||
import com.netease.nimlib.sdk.robot.model.RobotAttachment;
|
||||
import com.netease.nimlib.sdk.robot.model.RobotMsgType;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.common.permission.PermissionHelper;
|
||||
import com.nnbc123.app.common.widget.OriginalDrawStatusClickSpan;
|
||||
import com.nnbc123.app.ui.im.GreetPresenter;
|
||||
import com.nnbc123.app.ui.im.MessageListPanelEx;
|
||||
import com.nnbc123.app.ui.im.chat.MVHChatterBoxStart;
|
||||
import com.nnbc123.app.ui.im.model.IMCustomModel;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog;
|
||||
import com.nnbc123.app.ui.widget.dialog.RequestPermissionPromptDialog;
|
||||
import com.nnbc123.app.utils.PushMessageHandler;
|
||||
import com.nnbc123.core.UriProvider;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
@@ -70,6 +75,7 @@ import com.nnbc123.core.im.custom.bean.ImTipAttachment;
|
||||
import com.nnbc123.core.room.event.MessageSizeEvent;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.library.utils.ResUtil;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.nnbc123.library.utils.config.BasicConfig;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
@@ -87,7 +93,6 @@ import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
|
||||
/**
|
||||
@@ -228,7 +233,7 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
IMMessage anchor = (IMMessage) getArguments().getSerializable(Extras.EXTRA_ANCHOR);
|
||||
|
||||
customization = (SessionCustomization) getArguments().getSerializable(Extras.EXTRA_CUSTOMIZATION);
|
||||
Container container = new Container(getActivity(), sessionId, sessionType, this);
|
||||
Container container = new Container(getActivity(), sessionId, sessionType, this, this::requestPermission);
|
||||
|
||||
if (messageListPanel == null) {
|
||||
messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, false);
|
||||
@@ -275,13 +280,10 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
GreetPresenter greetPresenter = new GreetPresenter(sessionId);
|
||||
if (greetPresenter.isCanSendGreet()) {
|
||||
greetDisposable = greetPresenter.greetMsgGetOne(AuthModel.get().getCurrentUid(), toUid)
|
||||
.subscribe(new Consumer<String>() {
|
||||
@Override
|
||||
public void accept(String s) throws Exception {
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
sendMessage(MessageBuilder.createTextMessage(container.account,
|
||||
container.sessionType, s));
|
||||
}
|
||||
.subscribe(s -> {
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
sendMessage(MessageBuilder.createTextMessage(container.account,
|
||||
container.sessionType, s));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -322,6 +324,24 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
|
||||
}
|
||||
|
||||
private void requestPermission(Consumer<Boolean> consumer, String tips, String... perms) {
|
||||
Context context = getContext();
|
||||
if (context != null && RequestPermissionPromptDialog.Companion.isNeedPrompt()
|
||||
&& !PermissionHelper.INSTANCE.isAllGranted(rxPermissions, perms)) {
|
||||
new RequestPermissionPromptDialog(context, tips).show();
|
||||
}
|
||||
Disposable disposable = rxPermissions.request(perms).subscribe(aBoolean -> {
|
||||
RequestPermissionPromptDialog.Companion.dismissCurrentDialog();
|
||||
if (!aBoolean) {
|
||||
showPermissionDeniedTipsDialog(tips);
|
||||
}
|
||||
if (consumer != null) {
|
||||
consumer.accept(aBoolean);
|
||||
}
|
||||
}, Throwable::printStackTrace);
|
||||
compositeDisposable.add(disposable);
|
||||
}
|
||||
|
||||
/**
|
||||
* ********************** implements ModuleProxy *********************
|
||||
*/
|
||||
@@ -605,18 +625,52 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@SuppressLint("CheckResult")
|
||||
public void onNimAudioChatEvent(NimAudioChatEvent event) {
|
||||
checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO)
|
||||
String[] perms = new String[]{
|
||||
Manifest.permission.RECORD_AUDIO,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE};
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("1.").append(ResUtil.getString(R.string.permission_denied_tips_mic))
|
||||
.append("\n2.").append(ResUtil.getString(R.string.permission_denied_tips_image));
|
||||
String tips = sb.toString();
|
||||
if (RequestPermissionPromptDialog.Companion.isNeedPrompt()
|
||||
&& !PermissionHelper.INSTANCE.isAllGranted(rxPermissions, perms)) {
|
||||
new RequestPermissionPromptDialog(requireContext(), tips).show();
|
||||
}
|
||||
checkPermission(perms)
|
||||
.subscribe(result -> {
|
||||
RequestPermissionPromptDialog.Companion.dismissCurrentDialog();
|
||||
if (result) {
|
||||
event.getSuccess().accept(result);
|
||||
} else {
|
||||
SingleToastUtil.showToast(getString(R.string.ask_again));
|
||||
showPermissionDeniedTipsDialog(tips);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showPermissionDeniedTipsDialog(String message) {
|
||||
CommonTipDialog mPrivacyDialog = new CommonTipDialog(getContext());
|
||||
mPrivacyDialog.setTipMsg(message);
|
||||
mPrivacyDialog.setOkText("去设置");
|
||||
mPrivacyDialog.setOnActionListener(
|
||||
new CommonTipDialog.OnActionListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
//同意跳到应用详情页面
|
||||
Uri packageUri = Uri.parse("package:" + getContext().getPackageName());
|
||||
Intent intent = new Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
packageUri
|
||||
);
|
||||
startActivityForResult(
|
||||
intent, 0
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
mPrivacyDialog.show();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@SuppressLint("CheckResult")
|
||||
public void onNimImageActionEvent(NimImageActionEvent event) {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.nnbc123.app.ui.login;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -20,9 +21,11 @@ import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.base.BaseActivity;
|
||||
import com.nnbc123.app.base.TitleBar;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.user.UserModel;
|
||||
import com.nnbc123.core.user.bean.UserInfo;
|
||||
|
||||
|
||||
/**
|
||||
* Created by zhouxiangfeng on 2017/5/13.
|
||||
*/
|
||||
@@ -41,8 +44,7 @@ public class ModifyInfoActivity extends BaseActivity implements View.OnClickList
|
||||
|
||||
private TextView tvCountDown;
|
||||
|
||||
public static final String CONTENT = "content";
|
||||
public static final String CONTENT_NICK = "contentNick";
|
||||
public static final String USER_INFO = "user_info";
|
||||
private CoordinatorLayout layout_coordinator;
|
||||
|
||||
TextWatcher textWatcher = new TextWatcher() {
|
||||
@@ -117,19 +119,17 @@ public class ModifyInfoActivity extends BaseActivity implements View.OnClickList
|
||||
// 个人简介允许为空,nick不能为空
|
||||
if (modifyType == CONTENT_MODIFY) {
|
||||
String content = etEditText.getText().toString();
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(CONTENT, content);
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
|
||||
UserInfo info = new UserInfo();
|
||||
info.setUid(AuthModel.get().getCurrentUid());
|
||||
info.setUserDesc(content);
|
||||
updateUserInfo(info);
|
||||
} else if (modifyType == NICK_MODIFY) {
|
||||
String contentNick = etEditTextNick.getText().toString();
|
||||
|
||||
if (!contentNick.trim().isEmpty()) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(CONTENT_NICK, contentNick);
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
UserInfo info = new UserInfo();
|
||||
info.setUid(AuthModel.get().getCurrentUid());
|
||||
info.setNick(contentNick);
|
||||
updateUserInfo(info);
|
||||
} else {
|
||||
Snackbar.make(layout_coordinator, "所填内容为空!", Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -189,4 +189,20 @@ public class ModifyInfoActivity extends BaseActivity implements View.OnClickList
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void updateUserInfo(UserInfo userInfo){
|
||||
getDialogManager().showProgressDialog(this, "请稍后");
|
||||
UserModel.get().requestUpdateUserInfo(userInfo)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(userInfo1 -> {
|
||||
getDialogManager().dismissDialog();
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(USER_INFO, userInfo1);
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
}, throwable -> {
|
||||
getDialogManager().dismissDialog();
|
||||
toast(throwable.getMessage());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ public class AddUserInfoFragment extends BaseFragment
|
||||
private int gender = -1;
|
||||
private XRadioGroup rgGender;
|
||||
private RadioButton rbMale;
|
||||
private String avatarUrl = "https://image.nnbc123.cn/default_avatar.png";
|
||||
private String avatarUrl = "https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/default_avatar.png";
|
||||
|
||||
public static String INVITE_USER_CODE = "";
|
||||
|
||||
|
@@ -30,8 +30,8 @@ public class UserGiftActivity extends BaseActivity {
|
||||
MagicIndicator magicIndicator = findViewById(R.id.magic_indicator);
|
||||
List<Fragment> fragmentList = new ArrayList<>(2);
|
||||
//礼物类型 1:普通礼物;2:辛运礼物
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1,true));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2,true));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1));
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2));
|
||||
UserInfoPagerAdapter pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
|
||||
final List<String> tagList = new ArrayList<>(2);
|
||||
tagList.add("普通礼物");
|
||||
|
@@ -9,6 +9,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -57,6 +58,7 @@ import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.widget.ButtonItem;
|
||||
import com.nnbc123.app.ui.widget.ObservableScrollView;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.HintView;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
|
||||
@@ -163,6 +165,11 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
});
|
||||
|
||||
if (userId != AuthModel.get().getCurrentUid()) {
|
||||
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) mBinding.viewPager.getLayoutParams();
|
||||
layoutParams.bottomMargin = UIUtil.dip2px(context, 60);
|
||||
mBinding.viewPager.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -47,13 +47,11 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
private UserGiftAdapter userGiftAdapter;
|
||||
private Observer mObserver;
|
||||
private Observer mUidObserver;
|
||||
private boolean isDetails = false;
|
||||
|
||||
public static UserInfoGiftFragment newInstance(int giftType, boolean isDetails) {
|
||||
public static UserInfoGiftFragment newInstance(int giftType) {
|
||||
UserInfoGiftFragment userInfoGiftFragment = new UserInfoGiftFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("giftType", giftType);
|
||||
args.putBoolean("isDetails", isDetails);
|
||||
userInfoGiftFragment.setArguments(args);
|
||||
return userInfoGiftFragment;
|
||||
}
|
||||
@@ -89,9 +87,8 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
isDetails = requireArguments().getBoolean("isDetails", false);
|
||||
mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4));
|
||||
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems, isDetails);
|
||||
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems);
|
||||
userGiftAdapter.bindToRecyclerView(mBinding.rvGift);
|
||||
userGiftAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
|
||||
@Override
|
||||
@@ -155,10 +152,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
for (int i = 0; i < giftWallInfoList.size(); i++) {
|
||||
userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfoList.get(i));
|
||||
userInfoItems.add(userInfoItem);
|
||||
//非礼物详情页主需要12个就够了
|
||||
if (!isDetails && i == 11){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,7 @@ import com.nnbc123.app.ui.login.ModifyInfoActivity
|
||||
import com.nnbc123.app.ui.user.UserPhotoAdapter.ImageClickListener
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.nnbc123.app.ui.widget.dialog.RequestPermissionPromptDialog
|
||||
import com.nnbc123.app.utils.RegexUtil
|
||||
import com.nnbc123.core.auth.AuthModel
|
||||
import com.nnbc123.core.file.FileModel
|
||||
@@ -40,6 +41,7 @@ import com.nnbc123.library.common.photo.PhotoProviderNew
|
||||
import com.nnbc123.library.common.util.PhotoCompressCallback
|
||||
import com.nnbc123.library.common.util.PhotoCompressUtil
|
||||
import com.nnbc123.library.easypermisssion.EasyPermissions
|
||||
import com.nnbc123.library.utils.ResUtil
|
||||
import com.nnbc123.library.utils.TimeUtils
|
||||
import com.sleepbot.datetimepicker.time.RadialPickerLayout
|
||||
import com.sleepbot.datetimepicker.time.TimePickerDialog
|
||||
@@ -137,10 +139,9 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
|
||||
private fun findViews() {
|
||||
binding.layoutAvatar.setOnClickListener(this)
|
||||
binding.tvBirth.setOnClickListener(this)
|
||||
binding.tvNick.setOnClickListener(this)
|
||||
binding.layoutBirth.setOnClickListener(this)
|
||||
binding.layoutNick.setOnClickListener(this)
|
||||
binding.layoutDesc.setOnClickListener(this)
|
||||
binding.ivDescMore.setOnClickListener(this)
|
||||
binding.layoutPhotos.setOnClickListener(this)
|
||||
binding.rlAudioRecord.setOnClickListener(this)
|
||||
val mLayoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)
|
||||
@@ -213,7 +214,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
checkStoragePermission()
|
||||
isAvatar = true
|
||||
}
|
||||
R.id.tv_birth -> {
|
||||
R.id.layout_birth -> {
|
||||
if (mUserInfo != null) {
|
||||
val year = TimeUtils.getYear(
|
||||
mUserInfo?.birth ?: 0L
|
||||
@@ -234,12 +235,12 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
show(supportFragmentManager, "DATEPICKER_TAG_1")
|
||||
}
|
||||
}
|
||||
R.id.tv_nick -> UIHelper.showModifyInfoAct(
|
||||
R.id.layout_nick -> UIHelper.showModifyInfoAct(
|
||||
this@UserInfoModifyActivity,
|
||||
Method.NICK,
|
||||
ModifyInfoActivity.NICK_MODIFY
|
||||
)
|
||||
R.id.iv_desc_more, R.id.layout_desc -> UIHelper.showModifyInfoAct(
|
||||
R.id.layout_desc -> UIHelper.showModifyInfoAct(
|
||||
this@UserInfoModifyActivity,
|
||||
Method.DESC,
|
||||
ModifyInfoActivity.CONTENT_MODIFY
|
||||
@@ -276,6 +277,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
|
||||
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
|
||||
if (requestCode == PERMISSION_CODE_STORAGE) {
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
val requestTip = "为了能正常加载您本地的文件内容,请前往应用权限设置界面打开存储空间权限。"
|
||||
val mPrivacyDialog = CommonTipDialog(context)
|
||||
mPrivacyDialog.setTipMsg(requestTip)
|
||||
@@ -307,12 +309,19 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
}
|
||||
|
||||
private fun checkStoragePermission() {
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
if (!EasyPermissions.hasPermissions(
|
||||
this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
) {
|
||||
if (RequestPermissionPromptDialog.isNeedPrompt()) {
|
||||
RequestPermissionPromptDialog(
|
||||
this,
|
||||
ResUtil.getString(R.string.permission_denied_tips_image)
|
||||
).show()
|
||||
}
|
||||
EasyPermissions.requestPermissions(
|
||||
this,
|
||||
"请您再次考虑授予存储空间权限,否则将无法正常加载您本地的文件内容。",
|
||||
@@ -341,34 +350,13 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
checkStoragePermission()
|
||||
} else if (resultCode == RESULT_OK) {
|
||||
when (requestCode) {
|
||||
Method.NICK -> {
|
||||
Method.NICK, Method.DESC -> {
|
||||
data?.let {
|
||||
dialogManager.showProgressDialog(
|
||||
this@UserInfoModifyActivity,
|
||||
"请稍后"
|
||||
)
|
||||
val stringExtra = it.getStringExtra(ModifyInfoActivity.CONTENT_NICK)
|
||||
binding.tvNick.text = stringExtra
|
||||
val user = UserInfo()
|
||||
user.uid = AuthModel.get().currentUid
|
||||
user.nick = stringExtra
|
||||
UserModel.get().requestUpdateUserInfo(user)
|
||||
.subscribe(userInfoUpdateObserver)
|
||||
}
|
||||
}
|
||||
Method.DESC -> {
|
||||
data?.let {
|
||||
dialogManager.showProgressDialog(
|
||||
this@UserInfoModifyActivity,
|
||||
"请稍后"
|
||||
)
|
||||
val stringExtra = it.getStringExtra(ModifyInfoActivity.CONTENT)
|
||||
setTvDesc(stringExtra)
|
||||
val user = UserInfo()
|
||||
user.uid = AuthModel.get().currentUid
|
||||
user.userDesc = stringExtra
|
||||
UserModel.get().requestUpdateUserInfo(user)
|
||||
.subscribe(userInfoUpdateObserver)
|
||||
val newUserInfo =
|
||||
it.getSerializableExtra(ModifyInfoActivity.USER_INFO) as? UserInfo
|
||||
if (newUserInfo != null) {
|
||||
loadUserInfo(newUserInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
Method.AUDIO -> {
|
||||
@@ -517,10 +505,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
}
|
||||
|
||||
override fun onSuccess(info: UserInfo) {
|
||||
if (info.uid == userId) {
|
||||
mUserInfo = info
|
||||
initData(mUserInfo)
|
||||
}
|
||||
loadUserInfo(info)
|
||||
dialogManager.dismissDialog()
|
||||
if (showAvatarAuditing) {
|
||||
showAvatarAuditing = false
|
||||
@@ -534,6 +519,13 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadUserInfo(userInfo: UserInfo) {
|
||||
if (userInfo.uid == userId) {
|
||||
mUserInfo = userInfo
|
||||
initData(mUserInfo)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showAvatarAuditingDialog() {
|
||||
toast(R.string.avatar_auditing)
|
||||
//延迟3秒重新获取用户信息更新状态
|
||||
|
@@ -28,6 +28,7 @@ import com.nnbc123.app.takephoto.compress.CompressConfig
|
||||
import com.nnbc123.app.ui.user.UserModifyPhotosAdapter.PhotoItemClickListener
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.nnbc123.app.ui.widget.dialog.RequestPermissionPromptDialog
|
||||
import com.nnbc123.app.utils.RegexUtil
|
||||
import com.nnbc123.core.file.FileModel
|
||||
import com.nnbc123.core.user.UserModel
|
||||
@@ -39,6 +40,7 @@ import com.nnbc123.library.common.photo.PhotoProviderNew
|
||||
import com.nnbc123.library.common.util.PhotoCompressCallback
|
||||
import com.nnbc123.library.common.util.PhotoCompressUtil
|
||||
import com.nnbc123.library.easypermisssion.EasyPermissions
|
||||
import com.nnbc123.library.utils.ResUtil
|
||||
import com.nnbc123.library.utils.file.JXFileUtils
|
||||
import com.orhanobut.logger.Logger
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
@@ -225,6 +227,7 @@ class UserModifyPhotosActivity : TakePhotoActivity(), PhotoItemClickListener,
|
||||
|
||||
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
|
||||
if (requestCode == PERMISSION_CODE_STORAGE) {
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
val requestTip = "为了能正常加载您本地的文件内容,请前往应用权限设置界面打开存储空间权限。"
|
||||
val mPrivacyDialog = CommonTipDialog(context)
|
||||
mPrivacyDialog.setTipMsg(requestTip)
|
||||
@@ -256,12 +259,19 @@ class UserModifyPhotosActivity : TakePhotoActivity(), PhotoItemClickListener,
|
||||
}
|
||||
|
||||
private fun checkStoragePermission() {
|
||||
RequestPermissionPromptDialog.dismissCurrentDialog()
|
||||
if (!EasyPermissions.hasPermissions(
|
||||
this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
) {
|
||||
if (RequestPermissionPromptDialog.isNeedPrompt()) {
|
||||
RequestPermissionPromptDialog(
|
||||
this,
|
||||
ResUtil.getString(R.string.permission_denied_tips_image)
|
||||
).show()
|
||||
}
|
||||
EasyPermissions.requestPermissions(
|
||||
this,
|
||||
"请您再次考虑授予存储空间权限,否则将无法正常加载您本地的文件内容。",
|
||||
|
@@ -3,24 +3,24 @@ package com.nnbc123.app.ui.user.adapter;
|
||||
import android.content.Context;
|
||||
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.core.bean.UserInfoItem;
|
||||
import com.nnbc123.core.user.bean.GiftWallInfo;
|
||||
import com.nnbc123.library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserGiftAdapter extends UserTabBaseAdapter {
|
||||
|
||||
private final boolean isDetails;
|
||||
|
||||
public UserGiftAdapter(Context context, List<UserInfoItem> data, boolean isDetails) {
|
||||
public UserGiftAdapter(Context context, List<UserInfoItem> data) {
|
||||
super(context, data);
|
||||
addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info);
|
||||
addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty);
|
||||
this.isDetails = isDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,17 +46,57 @@ public class UserGiftAdapter extends UserTabBaseAdapter {
|
||||
GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData();
|
||||
|
||||
if (giftWallInfo != null) {
|
||||
|
||||
helper.setText(R.id.gift_name, giftWallInfo.getGiftName())
|
||||
.setGone(R.id.gift_name, isDetails)
|
||||
.setText(R.id.gift_num, "x" + giftWallInfo.getReciveCount())
|
||||
.setBackgroundRes(R.id.gift_num, isDetails ? R.drawable.bg_user_gift_item_details : R.drawable.bg_user_gift_item)
|
||||
.setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "")
|
||||
.setGone(R.id.gift_price, isDetails);
|
||||
.setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "");
|
||||
|
||||
ImageView giftPic = helper.itemView.findViewById(R.id.gift_img);
|
||||
ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic);
|
||||
loadLevelUI(helper, giftWallInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadLevelUI(BaseViewHolder helper, GiftWallInfo item) {
|
||||
ImageView bgView = helper.getView(R.id.iv_bg);
|
||||
TextView nameView = helper.getView(R.id.gift_name);
|
||||
TextView numView = helper.getView(R.id.gift_num);
|
||||
TextView priceView = helper.getView(R.id.gift_price);
|
||||
int bgResId;
|
||||
switch (item.getGiftLevel()) {
|
||||
case 2:
|
||||
bgResId = R.drawable.gift_wall_bg_level_1;
|
||||
break;
|
||||
case 3:
|
||||
bgResId = R.drawable.gift_wall_bg_level_2;
|
||||
break;
|
||||
case 4:
|
||||
bgResId = R.drawable.gift_wall_bg_level_3;
|
||||
break;
|
||||
case 5:
|
||||
bgResId = R.drawable.gift_wall_bg_level_4;
|
||||
break;
|
||||
case 6:
|
||||
bgResId = R.drawable.gift_wall_bg_level_5;
|
||||
break;
|
||||
case 7:
|
||||
bgResId = R.drawable.gift_wall_bg_level_6;
|
||||
break;
|
||||
case 8:
|
||||
bgResId = R.drawable.gift_wall_bg_level_7;
|
||||
break;
|
||||
default:
|
||||
bgResId = R.drawable.gift_wall_bg_level_0;
|
||||
break;
|
||||
}
|
||||
bgView.setImageResource(bgResId);
|
||||
if (bgResId == R.drawable.gift_wall_bg_level_0) {
|
||||
nameView.setTextColor(ResUtil.getColor(R.color.color_696D7A));
|
||||
numView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
|
||||
priceView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
|
||||
} else {
|
||||
nameView.setTextColor(ResUtil.getColor(R.color.color_FFFFFF));
|
||||
numView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
|
||||
priceView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.nnbc123.app.ui.user.view
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.view.Gravity
|
||||
@@ -13,6 +12,7 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.base.BaseViewBindingFragment
|
||||
@@ -21,17 +21,18 @@ import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_CUSTOM
|
||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_SELF
|
||||
import com.nnbc123.app.ui.user.UserGiftActivity
|
||||
import com.nnbc123.app.ui.user.UserInfoActivity
|
||||
import com.nnbc123.app.ui.user.UserInfoGiftFragment
|
||||
import com.nnbc123.app.ui.user.adapter.SkillCardAdapter
|
||||
import com.nnbc123.app.ui.user.adapter.UserInfoPagerAdapter
|
||||
import com.nnbc123.app.ui.user.decorationsend.UserInfoSkillDecoration
|
||||
import com.nnbc123.app.ui.user.viewmodel.UserInfoViewModel
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity
|
||||
import com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.nnbc123.core.UriProvider
|
||||
import com.nnbc123.core.auth.AuthModel
|
||||
import com.nnbc123.core.user.bean.UserInfoSkillEntity
|
||||
import com.nnbc123.library.annatation.ActLayoutRes
|
||||
@@ -54,14 +55,15 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
val magicIndicator: MagicIndicator = binding.magicIndicatorGift
|
||||
val fragmentList: MutableList<Fragment> = ArrayList(2)
|
||||
//礼物类型 1:普通礼物;2:辛运礼物
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1, false))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2, false))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(1))
|
||||
fragmentList.add(UserInfoGiftFragment.newInstance(2))
|
||||
val pagerAdapter = UserInfoPagerAdapter(childFragmentManager, fragmentList)
|
||||
val tagList: MutableList<String> = ArrayList(2)
|
||||
tagList.add("普通礼物")
|
||||
tagList.add("幸运礼物")
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(true)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(7.0F)
|
||||
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
|
||||
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
|
||||
@@ -115,9 +117,6 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.iv_more_gift -> startActivity(Intent(mContext, UserGiftActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
private fun createSkillEmptyView(): View {
|
||||
@@ -150,11 +149,19 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.viewPagerGift.post {
|
||||
val layoutParams = binding.viewPagerGift.layoutParams
|
||||
val newHeight = binding.layoutRoot.height - binding.viewPagerGift.top
|
||||
layoutParams.height = newHeight
|
||||
binding.viewPagerGift.layoutParams = layoutParams
|
||||
}
|
||||
binding.tvGiftLevel.singleClick {
|
||||
CommonWebViewActivity.start(context, UriProvider.getGiftLevelRuleUrl())
|
||||
}
|
||||
initGiftList()
|
||||
vm.userInfoSkillData.observe(this) {
|
||||
initSkillCardList(it)
|
||||
}
|
||||
binding.ivMoreGift.setOnClickListener(this)
|
||||
}
|
||||
|
||||
}
|
@@ -427,6 +427,14 @@ public class ImageLoadUtils {
|
||||
GlideApp.with(context.getApplicationContext()).load(url).dontAnimate().into(imageView);
|
||||
}
|
||||
|
||||
public static void loadImage(ImageView imageView, String url, int cornerRadius) {
|
||||
if (imageView == null) {
|
||||
return;
|
||||
}
|
||||
GlideApp.with(imageView.getContext()).load(url).dontAnimate()
|
||||
.transform(new CenterCrop(), new RoundedCorners(cornerRadius)).into(imageView);
|
||||
}
|
||||
|
||||
public static void loadImage1(Context context, String url, ImageView imageView) {
|
||||
GlideApp.with(context).load(url).optionalFitCenter().into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
|
@@ -69,6 +69,15 @@ public class ImageLoadUtilsV2 {
|
||||
isDontAnim, null);
|
||||
}
|
||||
|
||||
public static void loadImage(ImageView imageView, String url, int defaultRes, int roundDp) {
|
||||
if (imageView == null) {
|
||||
return;
|
||||
}
|
||||
loadImage(imageView.getContext(), imageView, url, -1, false,
|
||||
defaultRes, defaultRes, false, null,
|
||||
new CenterCrop(), new RoundedCorners(UIUtil.dip2px(imageView.getContext(), roundDp)));
|
||||
}
|
||||
|
||||
public static void loadImage(ImageView imageView, String url,
|
||||
int size, boolean isSquare,
|
||||
int errorId, int placeholderId,
|
||||
|
@@ -7,8 +7,9 @@ import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chuhai.utils.MetaDataUtils;
|
||||
import com.nnbc123.core.Constants;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil;
|
||||
import com.nnbc123.app.application.XChatApplication;
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants;
|
||||
import com.nnbc123.library.utils.AppUtils;
|
||||
@@ -88,7 +89,7 @@ public class SimpleJSInterface {
|
||||
@JavascriptInterface
|
||||
public String getChannel() {
|
||||
String channel;
|
||||
channel = ChannelReaderUtil.getChannel(XChatApplication.instance());
|
||||
channel = MetaDataUtils.INSTANCE.getStringData(Constants.CHANNEL_KEY, XChatApplication.instance());
|
||||
if (TextUtils.isEmpty(channel)) {
|
||||
channel = "official";
|
||||
}
|
||||
|
@@ -0,0 +1,98 @@
|
||||
package com.nnbc123.app.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.ViewGroup
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.util.Consumer
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.mmin18.widget.RealtimeBlurView
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.core.gift.bean.GiftInfo
|
||||
import com.nnbc123.core.gift.bean.GiftType
|
||||
import com.nnbc123.core.gift.bean.UnLockBaseGiftInfo
|
||||
import com.nnbc123.core.gift.bean.UnlockItem
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/1/26 17:16
|
||||
* Desc:
|
||||
**/
|
||||
class GIftDialogUnlockPanel : CardView {
|
||||
private var recyclerView: RecyclerView? = null
|
||||
private var adapter: GiftUnLockInfoAdapter = GiftUnLockInfoAdapter(emptyList())
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
init {
|
||||
inflate(context, R.layout.gift_dialog_unlock_panel, this)
|
||||
recyclerView = findViewById(R.id.recyclerView)
|
||||
recyclerView?.adapter = adapter
|
||||
}
|
||||
|
||||
fun update(currentGift: GiftInfo?) {
|
||||
if (currentGift == null || currentGift.giftType != GiftType.GIFT_TYPE_UNLOCK) {
|
||||
this.isVisible = false
|
||||
return
|
||||
}
|
||||
val list = ArrayList<UnlockItem>()
|
||||
val baseGift = currentGift.baseGift
|
||||
val childGift = currentGift.unlockGiftList
|
||||
if (baseGift != null) {
|
||||
list.add(UnLockBaseGiftInfo(baseGift))
|
||||
}
|
||||
if (!childGift.isNullOrEmpty()) {
|
||||
list.addAll(childGift)
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
this.isVisible = false
|
||||
return
|
||||
}
|
||||
this.isVisible = true
|
||||
checkAddBlurView()
|
||||
val index = list.indexOfFirst {
|
||||
it.getGiftData()?.giftId == currentGift.giftId
|
||||
}
|
||||
adapter.selectItemId = currentGift.giftId
|
||||
adapter.setNewData(baseGift, list)
|
||||
if (index >= 0) {
|
||||
recyclerView?.smoothScrollToPosition(index)
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshState() {
|
||||
adapter.notifyItemRangeChanged(0, adapter.itemCount, true)
|
||||
}
|
||||
|
||||
fun setOnItemClickListener(listener: Consumer<Int>) {
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
val item = adapter.getItem(position) as? UnlockItem
|
||||
val giftId = item?.getGiftData()?.giftId
|
||||
if (giftId != null) {
|
||||
listener.accept(giftId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkAddBlurView() {
|
||||
if (getChildAt(0) is RealtimeBlurView) {
|
||||
return
|
||||
}
|
||||
val blurView = RealtimeBlurView(context, null)
|
||||
blurView.setBlurRadius(25f)
|
||||
blurView.setDownsampleFactor(4f)
|
||||
blurView.setOverlayColor(Color.parseColor("#e0161722"))
|
||||
blurView.layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
addView(blurView, 0)
|
||||
}
|
||||
}
|
@@ -31,6 +31,7 @@ import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.util.Consumer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -217,6 +218,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private AppCompatTextView tvNum;
|
||||
private SuperTextView tvPrivilegeGive;
|
||||
private Group groupPrivilege;
|
||||
private GIftDialogUnlockPanel unLockPanel;
|
||||
private ImageView dressUpBannerView;
|
||||
private SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
|
||||
|
||||
private int mPrivilegePosition = 0;
|
||||
|
||||
@@ -224,6 +228,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
private BaseQuickAdapter<GiftPrivilegeInfo, BaseViewHolder> baseQuickAdapter;
|
||||
|
||||
// 需要重新加载背包礼物
|
||||
private boolean needReloadKnapGift;
|
||||
|
||||
public GiftDialog(Context context, int giftId) {
|
||||
this(context, 0, true, false, true, giftId);
|
||||
}
|
||||
@@ -423,6 +430,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
ivDrawGiftRemoveLast = findViewById(R.id.iv_draw_gift_remove_last);
|
||||
ivDrawGiftRemoveAll = findViewById(R.id.iv_draw_gift_remove_all);
|
||||
ivDrawGiftClose = findViewById(R.id.iv_draw_gift_close);
|
||||
unLockPanel = findViewById(R.id.panel_unlock);
|
||||
dressUpBannerView = findViewById(R.id.iv_dress_up_banner);
|
||||
dressUpBannerView.setOnClickListener(this);
|
||||
ivDrawGiftClose.setOnClickListener(this);
|
||||
ivDrawGiftRemoveLast.setOnClickListener(this);
|
||||
ivDrawGiftRemoveAll.setOnClickListener(this);
|
||||
@@ -432,8 +442,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
giftNumLayout = findViewById(R.id.gift_number_layout);
|
||||
giftNumLayout.setOnClickListener(this);
|
||||
List<GiftTab> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "礼物", "礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_LUCKY, "幸运", "幸运"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "普通", "普通"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_INTEREST, "趣味", "趣味", true));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NOBLE, "贵族", "贵族"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "星座礼物", "星座礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_SING_ROOM, "人气", "人气"));
|
||||
@@ -446,8 +456,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
giftIndicator.initTab(
|
||||
tabInfoList,
|
||||
true,
|
||||
context.getResources().getColor(R.color.color_bdbfd0),
|
||||
context.getResources().getColor(R.color.color_ffe710)
|
||||
context.getResources().getColor(R.color.color_CED1DB),
|
||||
context.getResources().getColor(R.color.color_FFDA24)
|
||||
);
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
giftIndicator.addClick()
|
||||
@@ -456,15 +466,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
.subscribe(integer -> {
|
||||
updateGiftView(integer);
|
||||
//福袋礼物有定时更新逻辑,每次点击都需要刷新福袋礼物信息
|
||||
if (integer == GiftIndicator.TYPE_LUCKY) {
|
||||
if (integer == GiftIndicator.TYPE_INTEREST) {
|
||||
reloadData(false);
|
||||
} else if (integer == GiftIndicator.TYPE_KNAP && needReloadKnapGift) {
|
||||
reloadData(false);
|
||||
}
|
||||
});
|
||||
|
||||
if (isInRoom) {
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
|
||||
} else {
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
llTabType.setVisibility(View.GONE);
|
||||
lineTabType.setVisibility(View.GONE);
|
||||
@@ -523,15 +533,17 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
case GiftType.GIFT_TYPE_NORMAL:
|
||||
indicatorType = GiftIndicator.TYPE_NORMAL;
|
||||
break;
|
||||
case GiftType.GIFT_TYPE_LUCKY:
|
||||
indicatorType = GiftIndicator.TYPE_LUCKY;
|
||||
break;
|
||||
case GiftType.GIFT_TYPE_VIP:
|
||||
indicatorType = GiftIndicator.TYPE_NOBLE;
|
||||
break;
|
||||
case GiftType.GIFT_TYPE_WEEK_STAR:
|
||||
indicatorType = GiftIndicator.TYPE_WEEK;
|
||||
break;
|
||||
case GiftType.GIFT_TYPE_UNLOCK:
|
||||
case GiftType.GIFT_TYPE_LUCKY:
|
||||
case GiftType.GIFT_TYPE_DRESS_UP:
|
||||
indicatorType = GiftIndicator.TYPE_INTEREST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
showGiftTab(indicatorType, giftInfo);
|
||||
@@ -590,6 +602,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
if (DemoCache.readNewGiftTypeTipIndicator()) {
|
||||
viewNewFeature.setVisibility(View.VISIBLE);
|
||||
}
|
||||
unLockPanel.setOnItemClickListener(new Consumer<Integer>() {
|
||||
@Override
|
||||
public void accept(Integer integer) {
|
||||
if (integer == null) {
|
||||
return;
|
||||
}
|
||||
trySelectGift(integer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initVipPager() {
|
||||
@@ -621,6 +642,33 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
pagerViewVip.setPlayDelay(3000);
|
||||
}
|
||||
|
||||
private boolean trySelectGift(int giftId) {
|
||||
if (pagerList == null) {
|
||||
return false;
|
||||
}
|
||||
int currentPage = gridView.getCurrentItem();
|
||||
if (currentPage < 0 || currentPage >= pagerList.size()) {
|
||||
return false;
|
||||
}
|
||||
List<GiftInfoVm> list = pagerList.get(currentPage);
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
GiftInfoVm item = list.get(i);
|
||||
GiftInfo itemInfo = item.data();
|
||||
if (itemInfo != null && itemInfo.getGiftId() == giftId) {
|
||||
onGiftClick(item);
|
||||
RecyclerView recyclerView = cacheItemView.get(currentPage);
|
||||
if (recyclerView != null) {
|
||||
recyclerView.smoothScrollToPosition(i);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showLoadingAnimation() {
|
||||
Animation rotateAnimation = new RotateAnimation(0, 360,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
@@ -689,8 +737,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
currentGiftInfoList = nobleGiftInfos;
|
||||
} else if (position == GiftIndicator.TYPE_NORMAL) {
|
||||
currentGiftInfoList = getNormalGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY) {
|
||||
currentGiftInfoList = getLuckyGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_WEEK) {
|
||||
currentGiftInfoList = getWeekStarGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_DRAW_GIFT) {
|
||||
@@ -699,6 +745,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
currentGiftInfoList = getSingleRoomGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_PENALTY) {
|
||||
currentGiftInfoList = getPenaltyGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_INTEREST) {
|
||||
currentGiftInfoList = getInterestGiftInfos();
|
||||
}
|
||||
//是否背包礼物
|
||||
final boolean isKnap = (position == GiftIndicator.TYPE_KNAP);
|
||||
@@ -755,7 +803,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
} else if (isKnap) {
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
|
||||
showEmptyView();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
} else if (position == GiftIndicator.TYPE_INTEREST ||
|
||||
position == GiftIndicator.TYPE_WEEK ||
|
||||
position == GiftIndicator.TYPE_DRAW_GIFT ||
|
||||
position == GiftIndicator.TYPE_SING_ROOM ||
|
||||
@@ -824,6 +872,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = false;
|
||||
updateDrawGift();
|
||||
updateUnLockTips();
|
||||
updateDressUpTips();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -877,6 +927,24 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
privilegeView.setAdapter(baseQuickAdapter);
|
||||
}
|
||||
|
||||
private void updateUnLockTips() {
|
||||
unLockPanel.update(currentGiftInfo);
|
||||
}
|
||||
|
||||
private void updateDressUpTips() {
|
||||
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_DRESS_UP) {
|
||||
dressUpBannerView.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
String banner = currentGiftInfo.getBannerUrl();
|
||||
if (banner == null || banner.length() == 0) {
|
||||
dressUpBannerView.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
dressUpBannerView.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(dressUpBannerView, banner, UIUtil.dip2px(context, 8));
|
||||
}
|
||||
|
||||
private void updateLuckyBagIntro() {
|
||||
if (luckyMsgDisposable != null) luckyMsgDisposable.dispose();
|
||||
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY) {
|
||||
@@ -908,11 +976,14 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
.flatMap(luckyBagNoticeInfos -> Observable.intervalRange(0, Integer.MAX_VALUE, 0, 5, TimeUnit.SECONDS))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
int index = aLong.intValue() % luckyMsgAdapter.getItemCount();
|
||||
if (index == 0) {
|
||||
rvLuckyMsg.scrollToPosition(index);
|
||||
} else {
|
||||
rvLuckyMsg.smoothScrollToPosition(index);
|
||||
int count = luckyMsgAdapter.getItemCount();
|
||||
if (count > 0) {
|
||||
int index = aLong.intValue() % count;
|
||||
if (index == 0) {
|
||||
rvLuckyMsg.scrollToPosition(index);
|
||||
} else {
|
||||
rvLuckyMsg.smoothScrollToPosition(index);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1130,7 +1201,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
|
||||
SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
|
||||
lastSelectedItem = pagerList.get(defaultSelectPage).get(defaultSelectItem);
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
gridView.setAdapter(new PagerAdapter() {
|
||||
@@ -1166,22 +1236,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
giftAdapter.addData(pagerList.get(pagePos));
|
||||
|
||||
giftAdapter.setOnItemClickListener(item -> {
|
||||
if (item.data.isSendMsg()) {
|
||||
etSendMessage.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
}
|
||||
if (lastSelectedItem != null) {
|
||||
lastSelectedItem.isSelect.set(false);
|
||||
}
|
||||
item.isSelect.set(true);
|
||||
lastSelectedItem = item;
|
||||
currentGiftInfo = item.data;
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
updateLuckyBagIntro();
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = true;
|
||||
updateDrawGift();
|
||||
onGiftClick(item);
|
||||
});
|
||||
container.addView(recyclerView);
|
||||
return recyclerView;
|
||||
@@ -1198,6 +1253,27 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
gridView.setCurrentItem(defaultSelectPage);
|
||||
}
|
||||
|
||||
private void onGiftClick(GiftInfoVm item) {
|
||||
if (item.data.isSendMsg()) {
|
||||
etSendMessage.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
}
|
||||
if (lastSelectedItem != null) {
|
||||
lastSelectedItem.isSelect.set(false);
|
||||
}
|
||||
item.isSelect.set(true);
|
||||
lastSelectedItem = item;
|
||||
currentGiftInfo = item.data;
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
updateLuckyBagIntro();
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = true;
|
||||
updateDrawGift();
|
||||
updateUnLockTips();
|
||||
updateDressUpTips();
|
||||
}
|
||||
|
||||
private List<GiftInfo> loadGiftInfoList() {
|
||||
List<GiftInfo> giftInfos;
|
||||
String roomUid = null;
|
||||
@@ -1237,12 +1313,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
GiftType.GIFT_TYPE_WEEK_STAR);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getLuckyGiftInfos() {
|
||||
return GiftModel.get().getGiftInfosByType(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||
GiftType.GIFT_TYPE_LUCKY);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getDrawGiftInfos() {
|
||||
return GiftModel.get().getGiftInfosByType(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||
@@ -1261,6 +1331,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
GiftType.GIFT_TYPE_PENALTY);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getInterestGiftInfos() {
|
||||
return GiftModel.get().getGiftInfosByType(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||
GiftType.GIFT_TYPE_INTEREST);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getNobleGiftInfos() {
|
||||
return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP);
|
||||
}
|
||||
@@ -1293,6 +1369,14 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_dress_up_banner:
|
||||
if (currentGiftInfo != null) {
|
||||
String skipUrl = currentGiftInfo.getBannerSkipUrl();
|
||||
if (skipUrl != null && skipUrl.length() > 0) {
|
||||
CommonWebViewActivity.start(context, skipUrl);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case R.id.ll_gold:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_GIFT_PANEL_TO_RECHARGE, "礼物面板_去充值:" + GIFT_DIALOG_FROM);
|
||||
ChargeDialog.start(getContext());
|
||||
@@ -1326,10 +1410,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
micMemberInfo.setAccount(String.valueOf(uid));
|
||||
targetUids.add(micMemberInfo);
|
||||
Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType());
|
||||
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
|
||||
giftDialogBtnClickListener.onSendGiftBtnClick(
|
||||
finalCurrentGiftInfo,
|
||||
targetUids,
|
||||
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber,
|
||||
number,
|
||||
giftMessage,
|
||||
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
|
||||
false,
|
||||
@@ -1337,7 +1422,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
new SenGiftCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
onSendGiftSuccess(finalCurrentGiftInfo);
|
||||
onSendGiftSuccess(finalCurrentGiftInfo, number, targetUids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1356,10 +1441,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
micMemberInfo.setAccount(String.valueOf(uid));
|
||||
targetUids.add(micMemberInfo);
|
||||
Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType());
|
||||
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
|
||||
giftDialogBtnClickListener.onSendGiftBtnClick(
|
||||
finalCurrentGiftInfo,
|
||||
targetUids,
|
||||
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber,
|
||||
number,
|
||||
giftMessage,
|
||||
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
|
||||
false,
|
||||
@@ -1367,7 +1453,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
new SenGiftCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
onSendGiftSuccess(finalCurrentGiftInfo);
|
||||
onSendGiftSuccess(finalCurrentGiftInfo, number, targetUids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1388,10 +1474,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
sendGiftButton.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
|
||||
giftDialogBtnClickListener.onSendGiftBtnClick(
|
||||
finalCurrentGiftInfo,
|
||||
selectedMembers,
|
||||
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber,
|
||||
number,
|
||||
giftMessage,
|
||||
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
|
||||
avatarListAdapter.getSelectType() == GiftAvatarAdapter.SELECT_TYPE_WHOLE_MIC,
|
||||
@@ -1399,7 +1486,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
new SenGiftCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
onSendGiftSuccess(finalCurrentGiftInfo);
|
||||
onSendGiftSuccess(finalCurrentGiftInfo, number, selectedMembers);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1511,11 +1598,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tvTabInteraction.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_PENALTY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_NOBLE);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_WEEK);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_NORMAL);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_PRIVILEGE);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_INTEREST);
|
||||
if (AvRoomDataManager.get().isSingleRoom()) {
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_SING_ROOM);
|
||||
} else {
|
||||
@@ -1539,18 +1626,18 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_PENALTY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_NOBLE);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_WEEK);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_NORMAL);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_SING_ROOM);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_PRIVILEGE);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_INTEREST);
|
||||
|
||||
giftIndicator.setPosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
updateGiftView(giftIndicator.getCurrrentType());
|
||||
}
|
||||
|
||||
private void onSendGiftSuccess(GiftInfo giftInfo) {
|
||||
private void onSendGiftSuccess(GiftInfo giftInfo, int giftNumber, List<MicMemberInfo> receiveUsers) {
|
||||
if (sendGiftButton == null) return;
|
||||
sendGiftButton.setText("赠送");
|
||||
sendGiftButton.setEnabled(true);
|
||||
@@ -1558,6 +1645,74 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
SingleToastUtil.showToast("发送涂鸦礼物:" + giftInfo.getGiftName() + "成功");
|
||||
clearDrawGift();
|
||||
dismiss();
|
||||
} else if (giftInfo.getGiftType() == GiftType.GIFT_TYPE_UNLOCK) {
|
||||
int totalNumber = 0;
|
||||
if (receiveUsers != null) {
|
||||
totalNumber = receiveUsers.size() * giftNumber;
|
||||
}
|
||||
updateUnlockStateSendSuccess(giftInfo, totalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新本地解锁礼物的数据状态(解锁状态、送出的数量)
|
||||
private void updateUnlockStateSendSuccess(GiftInfo giftInfo, int totalNumber) {
|
||||
if (giftInfo.getGiftType() != GiftType.GIFT_TYPE_UNLOCK) {
|
||||
return;
|
||||
}
|
||||
GiftInfo baseGift = giftInfo.getBaseGift();
|
||||
if (baseGift == null || baseGift.getGiftId() != giftInfo.getGiftId()) {
|
||||
// 不是基础礼物
|
||||
return;
|
||||
}
|
||||
// 先更新数据
|
||||
updateUnlockGiftDataState(giftInfo.getGiftId(), totalNumber);
|
||||
// 后更新UI
|
||||
updateUnlockGiftUiState(giftInfo.getGiftId());
|
||||
// 更新提示面板UI
|
||||
unLockPanel.refreshState();
|
||||
}
|
||||
|
||||
// 更新解锁礼物数据状态
|
||||
private void updateUnlockGiftDataState(int giftId, int number) {
|
||||
//(趣味、背包)都有可能有解锁礼物
|
||||
ArrayList<GiftInfo> list = new ArrayList<GiftInfo>();
|
||||
List<GiftInfo> panelGiftList = GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_UNLOCK);
|
||||
List<GiftInfo> knapList = GiftModel.get().getKnapList();
|
||||
if (panelGiftList != null) {
|
||||
list.addAll(panelGiftList);
|
||||
}
|
||||
if (knapList != null) {
|
||||
list.addAll(knapList);
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (GiftInfo item : list) {
|
||||
if (item.getGiftType() != GiftType.GIFT_TYPE_UNLOCK) {
|
||||
continue;
|
||||
}
|
||||
if (item.getBaseGift() == null || item.getBaseGift().getGiftId() != giftId) {
|
||||
continue;
|
||||
}
|
||||
item.updateUnlockProgress(number);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新解锁礼物Ui状态
|
||||
private void updateUnlockGiftUiState(int giftId) {
|
||||
if (giftIndicator.getCurrrentType() != GiftIndicator.TYPE_INTEREST) {
|
||||
return;
|
||||
}
|
||||
if (ListUtils.isListEmpty(pagerList)) {
|
||||
return;
|
||||
}
|
||||
for (List<GiftInfoVm> page : pagerList) {
|
||||
for (GiftInfoVm item : page) {
|
||||
GiftInfo itemBaseGift = item.data.getBaseGift();
|
||||
if (itemBaseGift != null && itemBaseGift.getGiftId() == giftId) {
|
||||
item.refreshUnlockState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1566,9 +1721,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
int currentType = giftIndicator.getCurrrentType();
|
||||
switch (currentType) {
|
||||
case GiftIndicator.TYPE_NORMAL:
|
||||
case GiftIndicator.TYPE_LUCKY:
|
||||
case GiftIndicator.TYPE_NOBLE:
|
||||
case GiftIndicator.TYPE_WEEK:
|
||||
case GiftIndicator.TYPE_INTEREST:
|
||||
String roomUid = null;
|
||||
if (isInRoom) {
|
||||
if (AvRoomDataManager.get().getRoomUid() > 0) {
|
||||
@@ -1598,6 +1753,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
.requestKnapGiftInfos()
|
||||
.subscribe((listServiceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
needReloadKnapGift = false;
|
||||
if (currentType == giftIndicator.getCurrrentType()) {
|
||||
updateGiftView(giftIndicator.getCurrrentType());
|
||||
}
|
||||
@@ -1695,9 +1851,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onRecieveGiftKnapMsg(UpdateKnapEvent event) {
|
||||
//刷新背包礼物
|
||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos()
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.subscribe());
|
||||
needReloadKnapGift = true;
|
||||
if (giftIndicator.getCurrrentType() != GiftIndicator.TYPE_KNAP) {
|
||||
return;
|
||||
}
|
||||
|
@@ -0,0 +1,118 @@
|
||||
package com.nnbc123.app.ui.widget
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chuhai.utils.ktx.getColorById
|
||||
import com.chuhai.utils.spannable.SpannableTextBuilder
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.ui.utils.load
|
||||
import com.nnbc123.core.gift.bean.GiftInfo
|
||||
import com.nnbc123.core.gift.bean.UnLockGiftInfo
|
||||
import com.nnbc123.core.gift.bean.UnlockItem
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/1/25 19:41
|
||||
* Desc:
|
||||
**/
|
||||
class GiftUnLockInfoAdapter(list: List<UnlockItem>) :
|
||||
BaseMultiItemQuickAdapter<UnlockItem, BaseViewHolder>(list) {
|
||||
|
||||
var selectItemId: Int = -1
|
||||
|
||||
private var baseGiftName: String? = null
|
||||
|
||||
init {
|
||||
addItemType(UnlockItem.ITEM_TYPE_BASE, R.layout.gift_dialog_lock_item_basics)
|
||||
addItemType(UnlockItem.ITEM_TYPE_CHILD, R.layout.gift_dialog_lock_item_child)
|
||||
}
|
||||
|
||||
override fun convertPayloads(
|
||||
helper: BaseViewHolder,
|
||||
item: UnlockItem?,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
super.convertPayloads(helper, item, payloads)
|
||||
if (item?.itemType == UnlockItem.ITEM_TYPE_CHILD) {
|
||||
convertChildState(helper, item)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: UnlockItem?) {
|
||||
val giftInfo = item?.getGiftData()
|
||||
when (item?.itemType) {
|
||||
UnlockItem.ITEM_TYPE_BASE -> {
|
||||
if (giftInfo?.giftId == selectItemId) {
|
||||
helper.setBackgroundRes(
|
||||
R.id.layout_root,
|
||||
R.drawable.gift_dialog_bg_lock_item_selected
|
||||
)
|
||||
} else {
|
||||
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
|
||||
}
|
||||
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
|
||||
helper.setText(R.id.tv_name, giftInfo?.giftName ?: "")
|
||||
helper.setText(R.id.tv_amount, giftInfo?.goldPrice?.toString() ?: "")
|
||||
}
|
||||
|
||||
UnlockItem.ITEM_TYPE_CHILD -> {
|
||||
if (giftInfo?.giftId == selectItemId) {
|
||||
helper.setBackgroundRes(
|
||||
R.id.layout_root,
|
||||
R.drawable.gift_dialog_bg_lock_item_selected
|
||||
)
|
||||
} else {
|
||||
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
|
||||
}
|
||||
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
|
||||
convertChildState(helper, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun convertChildState(helper: BaseViewHolder, item: UnlockItem?) {
|
||||
var unlockItem: UnLockGiftInfo? = null
|
||||
if (item is UnLockGiftInfo) {
|
||||
unlockItem = item
|
||||
}
|
||||
val total = unlockItem?.condition ?: 0
|
||||
val progress = (unlockItem?.process ?: 0).coerceAtMost(total)
|
||||
val progressBar = helper.getView<ProgressBar>(R.id.progress_bar)
|
||||
progressBar.max = total
|
||||
progressBar.progress = progress
|
||||
helper.setText(R.id.tv_count, "$progress/$total")
|
||||
val lockIconView = helper.getView<View>(R.id.iv_lock)
|
||||
val alpha: Float
|
||||
val lockText: String
|
||||
if (unlockItem?.unlocked == true) {
|
||||
alpha = 1f
|
||||
lockIconView.isVisible = false
|
||||
lockText = "已解锁"
|
||||
} else {
|
||||
alpha = 0.5f
|
||||
lockIconView.isVisible = true
|
||||
lockText = "可解锁"
|
||||
}
|
||||
val nameView = helper.getView<TextView>(R.id.tv_name)
|
||||
SpannableTextBuilder(nameView)
|
||||
.appendText("送出")
|
||||
.appendText(
|
||||
" ${total}个 ",
|
||||
textColor = nameView.context.getColorById(R.color.color_FFDA24)
|
||||
)
|
||||
.appendText("${baseGiftName ?: ""}${lockText}").apply()
|
||||
helper.setAlpha(R.id.tv_name, alpha)
|
||||
helper.setAlpha(R.id.iv_cover, alpha)
|
||||
helper.setAlpha(R.id.tv_count, alpha)
|
||||
helper.setAlpha(R.id.progress_bar, alpha)
|
||||
}
|
||||
|
||||
fun setNewData(baseGiftInfo: GiftInfo?, data: MutableList<UnlockItem>?) {
|
||||
this.baseGiftName = baseGiftInfo?.giftName
|
||||
super.setNewData(data)
|
||||
}
|
||||
}
|
@@ -0,0 +1,105 @@
|
||||
package com.nnbc123.app.ui.widget.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity
|
||||
import com.nnbc123.app.databinding.AllServiceGiftGoRoomTipsDialogBinding
|
||||
import com.nnbc123.app.public_chat_hall.activity.PublicChatHallHomeActivity
|
||||
import com.nnbc123.core.initial.InitialModel
|
||||
import com.nnbc123.library.common.util.SPUtils
|
||||
import com.nnbc123.library.utils.JavaUtil
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/10/30 10:29
|
||||
* Desc:跳转房间提示
|
||||
**/
|
||||
class AllServiceGiftGoRoomTipsDialog(
|
||||
context: Context,
|
||||
private val roomName: String,
|
||||
private val roomId: Long
|
||||
) :
|
||||
BaseDialog(context, R.style.dialog) {
|
||||
|
||||
private var binding: AllServiceGiftGoRoomTipsDialogBinding? = null
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 是否需要提示前往房间
|
||||
*/
|
||||
fun isNeedTips(): Boolean {
|
||||
return !SPUtils.getBoolean("all_service_gift_go_room_no_tips", false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略提示/不在提示
|
||||
*/
|
||||
private fun ignoreTips() {
|
||||
SPUtils.putBoolean("all_service_gift_go_room_no_tips", true)
|
||||
}
|
||||
}
|
||||
|
||||
private var isCheck: Boolean = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setCancelable(false)
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
val inflate =
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.all_service_gift_go_room_tips_dialog, null)
|
||||
setContentView(inflate.rootView)
|
||||
binding = DataBindingUtil.bind(inflate)
|
||||
|
||||
binding?.tvRoomName?.text = roomName
|
||||
binding?.ivCheckbox?.setOnClickListener {
|
||||
updateCheckbox(!isCheck)
|
||||
}
|
||||
binding?.tvTips?.setOnClickListener {
|
||||
updateCheckbox(!isCheck)
|
||||
}
|
||||
binding?.tvGo?.singleClick {
|
||||
if (isCheck) {
|
||||
ignoreTips()
|
||||
}
|
||||
if (roomId == JavaUtil.str2long(InitialModel.get().publicChatHallUid)) {
|
||||
PublicChatHallHomeActivity.openPublicChatHallPage(context)
|
||||
} else {
|
||||
AVRoomActivity.start(context, roomId)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
binding?.tvCancel?.singleClick {
|
||||
if (isCheck) {
|
||||
ignoreTips()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
updateCheckbox(false)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
this.window?.attributes?.let {
|
||||
it.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
it.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.gravity = Gravity.CENTER
|
||||
window?.attributes = it
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCheckbox(isCheck: Boolean) {
|
||||
this.isCheck = isCheck
|
||||
if (isCheck) {
|
||||
binding?.ivCheckbox?.setImageResource(R.drawable.base_ic_checkbox_selected)
|
||||
} else {
|
||||
binding?.ivCheckbox?.setImageResource(R.drawable.base_ic_checkbox_unselected)
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,77 +0,0 @@
|
||||
package com.nnbc123.app.ui.widget.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
|
||||
import com.nnbc123.core.manager.AvRoomDataManager;
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.databinding.DialogGiftAllServiceCeremonyBinding;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 11/05/2018.
|
||||
*/
|
||||
|
||||
public class AllServiceGiftLevelCeremonyDialog extends AllServiceGiftDialog {
|
||||
|
||||
private DialogGiftAllServiceCeremonyBinding binding;
|
||||
|
||||
public AllServiceGiftLevelCeremonyDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
super(context, R.style.FullScreenDialog, dataBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.dialog_gift_all_service_ceremony, null);
|
||||
setContentView(inflate.getRootView());
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
binding = DataBindingUtil.bind(inflate);
|
||||
|
||||
Window window = getWindow();
|
||||
Point point = new Point();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
windowParams.dimAmount = 0.0f;
|
||||
windowParams.gravity = Gravity.TOP;
|
||||
windowParams.x = 0;
|
||||
windowParams.y = 0;
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
|
||||
window.setAttributes(windowParams);
|
||||
window.setWindowAnimations(R.style.anim_fade);
|
||||
window.getWindowManager().getDefaultDisplay().getSize(point);
|
||||
}
|
||||
if (dataBean != null) {
|
||||
// 设置定时器
|
||||
Observable.timer((long) dataBean.getNotifyStaySecond(), TimeUnit.SECONDS)
|
||||
.subscribe(aLong -> {
|
||||
dismiss();
|
||||
});
|
||||
binding.setGiftBean(dataBean);
|
||||
binding.tvGoRoom.setVisibility(dataBean.getRoomUid() == 0
|
||||
|| (AvRoomDataManager.get().mCurrentRoomInfo != null && dataBean.getRoomUid() == AvRoomDataManager.get().mCurrentRoomInfo.getUid())
|
||||
? View.GONE : View.VISIBLE);
|
||||
binding.tvGoRoom.setOnClickListener(view -> AVRoomActivity.start(getContext(), dataBean.getRoomUid()));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,191 @@
|
||||
package com.nnbc123.app.ui.widget.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewConfiguration
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.getColorById
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.chuhai.utils.spannable.SpannableTextBuilder
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity
|
||||
import com.nnbc123.app.databinding.DialogGiftAllServiceLevelBinding
|
||||
import com.nnbc123.app.public_chat_hall.activity.PublicChatHallHomeActivity
|
||||
import com.nnbc123.core.initial.InitialModel
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol
|
||||
import com.nnbc123.library.utils.JavaUtil
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/10/27 18:42
|
||||
* Desc:全服礼物弹窗
|
||||
**/
|
||||
class AllServiceGiftLevelDialog : BaseDialog {
|
||||
|
||||
private var data: AllServiceGiftProtocol.DataBean? = null
|
||||
private var binding: DialogGiftAllServiceLevelBinding? = null
|
||||
|
||||
private var disposable: Disposable? = null
|
||||
|
||||
companion object {
|
||||
private var marqueeError = false
|
||||
}
|
||||
|
||||
constructor(context: Context?, data: AllServiceGiftProtocol.DataBean) : super(
|
||||
context, R.style.FullScreenDialog
|
||||
) {
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
val inflate =
|
||||
LayoutInflater.from(context).inflate(R.layout.dialog_gift_all_service_level, null)
|
||||
setContentView(inflate.rootView)
|
||||
setCancelable(true)
|
||||
setCanceledOnTouchOutside(true)
|
||||
binding = DataBindingUtil.bind(inflate)
|
||||
val window = window
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val windowParams = window.attributes
|
||||
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
//MATCH_PARENT会挡住键盘,
|
||||
// wrap_parent在小米8又会截掉一点,在华为测试关闭按钮点击不到
|
||||
//暂时找不到原因,
|
||||
windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
windowParams.dimAmount = 0.0f
|
||||
windowParams.gravity = Gravity.TOP
|
||||
windowParams.x = 0
|
||||
windowParams.y = 0
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)
|
||||
window.attributes = windowParams
|
||||
window.setWindowAnimations(R.style.anim_left)
|
||||
}
|
||||
val data = this.data
|
||||
val binding = this.binding
|
||||
if (data != null && binding != null) {
|
||||
init(data, binding)
|
||||
} else {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun init(
|
||||
data: AllServiceGiftProtocol.DataBean,
|
||||
binding: DialogGiftAllServiceLevelBinding
|
||||
) {
|
||||
binding.ivAvatar.singleClick {
|
||||
goRoom(data)
|
||||
}
|
||||
binding.tvRoomGo.singleClick {
|
||||
goRoom(data)
|
||||
}
|
||||
binding.giftBean = data
|
||||
if ((data.giftNum) <= 1) {
|
||||
binding.tvCount.text = ""
|
||||
} else {
|
||||
binding.tvCount.text = "X${data.giftNum}"
|
||||
}
|
||||
SpannableTextBuilder(binding.tvMessage)
|
||||
.appendText(
|
||||
data.sendUserNick,
|
||||
binding.tvMessage.context.getColorById(R.color.color_FFE468)
|
||||
)
|
||||
.appendText(
|
||||
" 送给 ",
|
||||
binding.tvMessage.context.getColorById(R.color.white)
|
||||
)
|
||||
.appendText(
|
||||
data.recvUserNick + " ",
|
||||
binding.tvMessage.context.getColorById(R.color.color_FFE468)
|
||||
)
|
||||
.appendText(
|
||||
data.giftName,
|
||||
binding.tvMessage.context.getColorById(R.color.white)
|
||||
).apply()
|
||||
when (data.levelNum.toIntOrNull()) {
|
||||
2 -> {
|
||||
binding.ivAvatarBg.setImageResource(R.drawable.all_service_gift_bg_avatar_2)
|
||||
binding.layoutRoot.setBackgroundResource(R.drawable.all_service_gift_bg_2)
|
||||
binding.tvRoomGo.setBackgroundResource(R.drawable.all_service_gift_bg_room_go2)
|
||||
}
|
||||
|
||||
3 -> {
|
||||
binding.ivAvatarBg.setImageResource(R.drawable.all_service_gift_bg_avatar_3)
|
||||
binding.layoutRoot.setBackgroundResource(R.drawable.all_service_gift_bg_3)
|
||||
binding.tvRoomGo.setBackgroundResource(R.drawable.all_service_gift_bg_room_go3)
|
||||
}
|
||||
|
||||
else -> {
|
||||
binding.ivAvatarBg.setImageDrawable(null)
|
||||
binding.layoutRoot.setBackgroundResource(R.drawable.all_service_gift_bg_1)
|
||||
binding.tvRoomGo.setBackgroundResource(R.drawable.all_service_gift_bg_room_go1)
|
||||
}
|
||||
}
|
||||
setupTextMarquee(binding.tvMessage)
|
||||
disposable = Observable.timer(data.notifyStaySecond.toLong(), TimeUnit.SECONDS)
|
||||
.subscribe { dismiss() }
|
||||
binding.groupRoom.isVisible = data.roomUid != 0L
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加跑马灯
|
||||
* 以及反射一些参数影响跑马灯
|
||||
*/
|
||||
private fun setupTextMarquee(view: TextView) {
|
||||
view.isSelected = true
|
||||
if (marqueeError) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
val configuration = ViewConfiguration.get(
|
||||
context
|
||||
)
|
||||
val claz: Class<*> = configuration.javaClass
|
||||
val field = claz.getDeclaredField("mFadingMarqueeEnabled")
|
||||
field.isAccessible = true
|
||||
field[configuration] = true
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
marqueeError = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun goRoom(
|
||||
data: AllServiceGiftProtocol.DataBean
|
||||
) {
|
||||
if (data.roomUid <= 0L) {
|
||||
// 非房间场景送的礼物
|
||||
return
|
||||
}
|
||||
if (AllServiceGiftGoRoomTipsDialog.isNeedTips()) {
|
||||
AllServiceGiftGoRoomTipsDialog(context, data.roomTitle ?: "", data.roomUid).show()
|
||||
} else {
|
||||
if (data.roomUid == JavaUtil.str2long(InitialModel.get().publicChatHallUid)) {
|
||||
PublicChatHallHomeActivity.openPublicChatHallPage(context)
|
||||
} else {
|
||||
AVRoomActivity.start(context, data.roomUid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
if (disposable?.isDisposed != true) {
|
||||
disposable?.dispose()
|
||||
}
|
||||
disposable = null
|
||||
}
|
||||
}
|
@@ -1,85 +0,0 @@
|
||||
package com.nnbc123.app.ui.widget.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.databinding.DialogGiftAllServiceLevelOneBinding;
|
||||
import com.nnbc123.app.public_chat_hall.activity.PublicChatHallHomeActivity;
|
||||
import com.nnbc123.core.initial.InitialModel;
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.library.utils.JavaUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 11/05/2018.
|
||||
*/
|
||||
|
||||
public class AllServiceGiftLevelOneDialog extends AllServiceGiftDialog {
|
||||
|
||||
private DialogGiftAllServiceLevelOneBinding binding;
|
||||
|
||||
public AllServiceGiftLevelOneDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
super(context, R.style.FullScreenDialog, dataBean);
|
||||
giftLevel = ALL_SERVICE_GIFT_LEVEL_1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.dialog_gift_all_service_level_one, null);
|
||||
setContentView(inflate.getRootView());
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
binding = DataBindingUtil.bind(inflate);
|
||||
|
||||
Window window = getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
//MATCH_PARENT会挡住键盘,
|
||||
// wrap_parent在小米8又会截掉一点,在华为测试关闭按钮点击不到
|
||||
//暂时找不到原因,
|
||||
windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
windowParams.dimAmount = 0.0f;
|
||||
windowParams.gravity = Gravity.TOP;
|
||||
windowParams.x = 0;
|
||||
windowParams.y = 0;
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
|
||||
window.setAttributes(windowParams);
|
||||
window.setWindowAnimations(R.style.anim_left);
|
||||
}
|
||||
if (dataBean != null) {
|
||||
binding.getRoot().setOnClickListener(v -> {
|
||||
if (dataBean.getRoomUid() == JavaUtil.str2long(InitialModel.get().getPublicChatHallUid())) {
|
||||
PublicChatHallHomeActivity.openPublicChatHallPage(getContext());
|
||||
} else {
|
||||
AVRoomActivity.start(getContext(), dataBean.getRoomUid());
|
||||
}
|
||||
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.FULL_GIFT_WATCHING, "全服礼物-前往围观计数");
|
||||
});
|
||||
Observable.timer((long) dataBean.getNotifyStaySecond(), TimeUnit.SECONDS)
|
||||
.subscribe(aLong -> {
|
||||
dismiss();
|
||||
});
|
||||
binding.setGiftBean(dataBean);
|
||||
}
|
||||
binding.ivCloseDialogOne.setOnClickListener(v -> dismiss());
|
||||
}
|
||||
}
|
@@ -1,92 +0,0 @@
|
||||
package com.nnbc123.app.ui.widget.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.databinding.DialogGiftAllServiceLevelThreeBinding;
|
||||
import com.nnbc123.app.public_chat_hall.activity.PublicChatHallHomeActivity;
|
||||
import com.nnbc123.core.initial.InitialModel;
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.library.utils.JavaUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 11/05/2018.
|
||||
*/
|
||||
|
||||
public class AllServiceGiftLevelThreeDialog extends AllServiceGiftDialog {
|
||||
|
||||
private DialogGiftAllServiceLevelThreeBinding binding;
|
||||
private float screenWidth;
|
||||
|
||||
public AllServiceGiftLevelThreeDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
super(context, R.style.FullScreenDialog, dataBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.dialog_gift_all_service_level_three, null);
|
||||
setContentView(inflate.getRootView());
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
binding = DataBindingUtil.bind(inflate);
|
||||
|
||||
Window window = getWindow();
|
||||
Point point = new Point();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
windowParams.height =WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
windowParams.dimAmount = 0.0f;
|
||||
windowParams.gravity = Gravity.TOP;
|
||||
windowParams.x = 0;
|
||||
windowParams.y = 0;
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
|
||||
window.setAttributes(windowParams);
|
||||
window.setWindowAnimations(R.style.anim_fade);
|
||||
window.getWindowManager().getDefaultDisplay().getSize(point);
|
||||
screenWidth = point.x;
|
||||
}
|
||||
if (dataBean != null) {
|
||||
binding.giftClose.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
binding.getRoot().setOnClickListener(v -> {
|
||||
if (dataBean.getRoomUid() == JavaUtil.str2long(InitialModel.get().getPublicChatHallUid())) {
|
||||
PublicChatHallHomeActivity.openPublicChatHallPage(getContext());
|
||||
} else {
|
||||
AVRoomActivity.start(getContext(), dataBean.getRoomUid());
|
||||
}
|
||||
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.FULL_GIFT_WATCHING, "全服礼物-前往围观计数");
|
||||
});
|
||||
// 设置定时器
|
||||
Observable.timer((long) dataBean.getNotifyStaySecond(), TimeUnit.SECONDS)
|
||||
.subscribe(aLong -> {
|
||||
dismiss();
|
||||
});
|
||||
binding.setGiftBean(dataBean);
|
||||
binding.tvRoomId.setVisibility(dataBean.getRoomUid() == 0 ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,88 +0,0 @@
|
||||
package com.nnbc123.app.ui.widget.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.databinding.DialogGiftAllServiceLevelTwoBinding;
|
||||
import com.nnbc123.app.public_chat_hall.activity.PublicChatHallHomeActivity;
|
||||
import com.nnbc123.core.initial.InitialModel;
|
||||
import com.nnbc123.core.noble.AllServiceGiftProtocol;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.library.utils.JavaUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 11/05/2018.
|
||||
*/
|
||||
|
||||
public class AllServiceGiftLevelTwoDialog extends AllServiceGiftDialog {
|
||||
|
||||
private DialogGiftAllServiceLevelTwoBinding binding;
|
||||
private float screenWidth;
|
||||
|
||||
public AllServiceGiftLevelTwoDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
super(context, R.style.FullScreenDialog, dataBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.dialog_gift_all_service_level_two, null);
|
||||
setContentView(inflate.getRootView());
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
binding = DataBindingUtil.bind(inflate);
|
||||
|
||||
Window window = getWindow();
|
||||
Point point = new Point();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
windowParams.height =WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
windowParams.dimAmount = 0.0f;
|
||||
windowParams.gravity = Gravity.TOP;
|
||||
windowParams.x = 0;
|
||||
windowParams.y = 0;
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
|
||||
window.setAttributes(windowParams);
|
||||
window.setWindowAnimations(R.style.anim_left);
|
||||
window.getWindowManager().getDefaultDisplay().getSize(point);
|
||||
screenWidth = point.x;
|
||||
}
|
||||
if (dataBean != null) {
|
||||
binding.getRoot().setOnClickListener(v -> {
|
||||
if (dataBean.getRoomUid() == JavaUtil.str2long(InitialModel.get().getPublicChatHallUid())) {
|
||||
PublicChatHallHomeActivity.openPublicChatHallPage(getContext());
|
||||
} else {
|
||||
AVRoomActivity.start(getContext(), dataBean.getRoomUid());
|
||||
}
|
||||
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.FULL_GIFT_WATCHING, "全服礼物-前往围观计数");
|
||||
});
|
||||
// 设置定时器
|
||||
Observable.timer((long) (dataBean.getNotifyStaySecond()), TimeUnit.SECONDS)
|
||||
.subscribe(aLong -> dismiss());
|
||||
binding.setGiftBean(dataBean);
|
||||
}
|
||||
|
||||
binding.ivCloseDialogTwo.setOnClickListener(v -> dismiss());
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.nnbc123.app.ui.widget.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.library.utils.config.BasicConfig
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/1/8 10:06
|
||||
* Desc:申请权限提示
|
||||
**/
|
||||
class RequestPermissionPromptDialog(context: Context, private val message: String) :
|
||||
Dialog(context, R.style.dialog_full_width), LifecycleEventObserver {
|
||||
|
||||
companion object {
|
||||
private var currentDialog: RequestPermissionPromptDialog? = null
|
||||
fun dismissCurrentDialog() {
|
||||
currentDialog?.dismiss()
|
||||
currentDialog = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要展示权限申请说明
|
||||
*/
|
||||
fun isNeedPrompt(): Boolean {
|
||||
return (BasicConfig.INSTANCE.channel == "huawei")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
currentDialog = this
|
||||
val window = window
|
||||
if (window != null) {
|
||||
val lps = window.attributes
|
||||
lps.gravity = Gravity.TOP
|
||||
lps.verticalMargin = 0f
|
||||
lps.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
window.attributes = lps
|
||||
}
|
||||
setCanceledOnTouchOutside(false)
|
||||
setContentView(R.layout.dialog_request_permission_prompt)
|
||||
val rootView = findViewById<View>(R.id.layout_root)
|
||||
// 权限已被拒时再申请权限会立即回调结果,这个弹窗看起来闪一下就没了,优化这个体验:延迟可见
|
||||
rootView?.animate()?.alpha(1f)?.setStartDelay(200)?.start()
|
||||
val messageView = findViewById<TextView>(R.id.tv_message)
|
||||
messageView?.text = message
|
||||
(ownerActivity as? LifecycleOwner)?.lifecycle?.addObserver(this)
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
currentDialog = null
|
||||
(ownerActivity as? LifecycleOwner)?.lifecycle?.removeObserver(this)
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
this@RequestPermissionPromptDialog.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
@@ -80,7 +80,11 @@ public class GiftIndicator extends LinearLayout {
|
||||
*/
|
||||
public static final int TYPE_PRIVILEGE = 8;
|
||||
|
||||
private Map<String, String> map = new HashMap<>();
|
||||
/**
|
||||
* 趣味(福袋礼物、解锁礼物、装扮礼物)
|
||||
*/
|
||||
public static final int TYPE_INTEREST = 9;
|
||||
|
||||
private List<GiftTab> tabList = new ArrayList<>();
|
||||
private int currrentType = TYPE_NORMAL;
|
||||
|
||||
@@ -143,10 +147,17 @@ public class GiftIndicator extends LinearLayout {
|
||||
index.getItemView().setOnClickListener(v -> {
|
||||
setPosition(index.getType());
|
||||
emitter.onNext(index.getType());
|
||||
if (index.isNeedNewTips()) {
|
||||
View view = index.getItemView().findViewById(R.id.tv_new_tag);
|
||||
if (view.getVisibility() == VISIBLE) {
|
||||
view.setVisibility(GONE);
|
||||
DemoCache.saveNewGiftTypeTip(index.getType(), false);
|
||||
}
|
||||
}
|
||||
if (index.getType() == TYPE_PENALTY) {
|
||||
ImageView imageView = index.getItemView().findViewById(R.id.iv_new_tag);
|
||||
if (imageView.getVisibility() == VISIBLE) {
|
||||
imageView.setVisibility(GONE);
|
||||
View view = index.getItemView().findViewById(R.id.tv_new_tag);
|
||||
if (view.getVisibility() == VISIBLE) {
|
||||
view.setVisibility(GONE);
|
||||
DemoCache.saveNewGiftTypeTip(false);
|
||||
}
|
||||
} else if (index.getType() == TYPE_KNAP) {
|
||||
@@ -186,10 +197,16 @@ public class GiftIndicator extends LinearLayout {
|
||||
for (GiftTab tab : tabList) {
|
||||
if (tab.getType() == type) {
|
||||
tab.getItemView().setVisibility(VISIBLE);
|
||||
if (tab.isNeedNewTips()) {
|
||||
if (DemoCache.readNewGiftTypeTip(tab.getType())) {
|
||||
View view = tab.getItemView().findViewById(R.id.tv_new_tag);
|
||||
view.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
if (type == TYPE_PENALTY) {
|
||||
if (DemoCache.readNewGiftTypeTip()) {
|
||||
ImageView imageView = tab.getItemView().findViewById(R.id.iv_new_tag);
|
||||
imageView.setVisibility(VISIBLE);
|
||||
View view = tab.getItemView().findViewById(R.id.tv_new_tag);
|
||||
view.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -112,7 +112,7 @@ public class LinePagerIndicator extends View implements IPagerIndicator {
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
onPageScrolled(position,0,0);
|
||||
// onPageScrolled(position,0,0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Before Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 360 B |
BIN
app/src/main/res/drawable-xxhdpi/all_service_gift_bg_1.webp
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable-xxhdpi/all_service_gift_bg_2.webp
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/drawable-xxhdpi/all_service_gift_bg_3.webp
Normal file
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 31 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_dialog_bg_item.9.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_dialog_ic_diamond.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_dialog_ic_diamond_14.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_0.webp
Normal file
After Width: | Height: | Size: 380 B |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_1.webp
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_2.webp
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_3.webp
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_4.webp
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_5.webp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_6.webp
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_bg_level_7.webp
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_wall_ic_diamond.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
10
app/src/main/res/drawable/all_service_gift_bg_room_go1.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FF283889" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FF66B5FF" />
|
||||
<corners android:radius="8.5dp" />
|
||||
</shape>
|
10
app/src/main/res/drawable/all_service_gift_bg_room_go2.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FF49157D" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFE9FFF" />
|
||||
<corners android:radius="8.5dp" />
|
||||
</shape>
|
10
app/src/main/res/drawable/all_service_gift_bg_room_go3.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#87152D" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFED77" />
|
||||
<corners android:radius="8.5dp" />
|
||||
</shape>
|
12
app/src/main/res/drawable/all_service_gift_ic_room.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M12.528,0.898L18.773,5.98C19.55,6.611 20,7.558 20,8.557L20,16.009C20,18.213 18.209,20 16,20L15,20C14.264,20 13.667,19.403 13.667,18.667L13.667,14.346L13.667,14.346C13.667,13.269 12.811,12.391 11.742,12.352L11.667,12.35L8.333,12.35C7.254,12.35 6.374,13.204 6.335,14.271L6.333,14.346L6.333,18.667C6.333,19.403 5.736,20 5,20L4,20L4,20C1.791,20 0,18.213 0,16.009L0,8.557C0,7.558 0.45,6.611 1.227,5.98L7.472,0.898C8.944,-0.299 11.056,-0.299 12.528,0.898Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
18
app/src/main/res/drawable/base_ic_checkbox_selected.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:pathData="M7,7m-7,0a7,7 0,1 1,14 0a7,7 0,1 1,-14 0"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#141414"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M3.576,6.612C3.792,6.373 4.161,6.353 4.4,6.569L6.381,8.353L9.867,4.483C10.098,4.226 10.493,4.205 10.75,4.436C11.006,4.667 11.027,5.062 10.796,5.319L6.948,9.592L6.937,9.604C6.932,9.61 6.926,9.617 6.92,9.623C6.705,9.862 6.336,9.882 6.097,9.666L3.619,7.436C3.38,7.22 3.361,6.851 3.576,6.612Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/base_ic_checkbox_unselected.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:pathData="M7,7m-6.5,0a6.5,6.5 0,1 1,13 0a6.5,6.5 0,1 1,-13 0"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B3B3C3"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
@@ -4,8 +4,8 @@
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="@color/color_218eff"
|
||||
android:startColor="@color/color_7727e4"
|
||||
android:endColor="#FFDA24"
|
||||
android:startColor="#FFDA24"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners android:radius="100dp" />
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFE710" />
|
||||
<solid android:color="#FFDA24" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
@@ -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="#14FFFFFF" />
|
||||
|
||||
<corners android:radius="4dp" />
|
||||
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#FFDA24" />
|
||||
</shape>
|
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="8dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="8"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:pathData="M6.512,4.3904L2.8123,7.3501C2.5967,7.5226 2.2821,7.4877 2.1096,7.272C2.0386,7.1834 2,7.0732 2,6.9597L2,1.0403C2,0.7642 2.2239,0.5403 2.5,0.5403C2.6135,0.5403 2.7237,0.579 2.8123,0.6499L6.512,3.6096C6.7276,3.7821 6.7625,4.0967 6.59,4.3123C6.567,4.3412 6.5408,4.3674 6.512,4.3904Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/gift_dialog_ic_arrow_white_up.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="10dp"
|
||||
android:height="10dp"
|
||||
android:viewportWidth="10"
|
||||
android:viewportHeight="10">
|
||||
<path
|
||||
android:pathData="M5.384,2.461L9.317,7.18C9.493,7.392 9.465,7.707 9.253,7.884C9.163,7.959 9.049,8 8.932,8L1.068,8C0.791,8 0.568,7.776 0.568,7.5C0.568,7.383 0.609,7.27 0.683,7.18L4.616,2.461C4.793,2.249 5.108,2.22 5.32,2.397C5.343,2.416 5.365,2.438 5.384,2.461Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/gift_dialog_ic_lock.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="9dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="9">
|
||||
<path
|
||||
android:pathData="M6.4687,2.7063L2.5313,2.7063C1.531,2.7063 0.72,3.5172 0.72,4.5176L0.72,7.0987C0.72,8.099 1.531,8.91 2.5313,8.91L6.4687,8.91C7.469,8.91 8.28,8.099 8.28,7.0987L8.28,4.5176C8.28,3.5172 7.469,2.7063 6.4687,2.7063ZM4.9529,5.8622L4.9529,7.0909C4.9529,7.348 4.7503,7.5566 4.5,7.5566C4.2498,7.5566 4.0471,7.348 4.0471,7.0909L4.0471,5.8622C3.7766,5.7012 3.5942,5.4009 3.5942,5.0563C3.5942,4.5419 3.9997,4.125 4.5,4.125C5.0003,4.125 5.4059,4.5419 5.4059,5.0563C5.4059,5.4009 5.2236,5.7012 4.9529,5.8622ZM4.5076,0.09C3.106,0.09 1.9696,1.242 1.9696,2.7555L1.9696,4.1615L7.0458,4.1615L7.0458,2.7555C7.0458,1.242 5.9094,0.09 4.5076,0.09ZM2.9572,3.507L2.9572,2.5441C2.9572,1.6578 3.6561,0.9391 4.5182,0.9391C5.3804,0.9391 6.0792,1.6578 6.0792,2.5441L6.0792,3.5296L2.9572,3.507Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 定义轨道的背景 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#696D7A" />
|
||||
<corners android:radius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 定义轨道上已完成部分的样式 -->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFDA24" />
|
||||
<corners android:radius="3dp" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
6
app/src/main/res/drawable/shape_14ffffff_4dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="4dp" />
|
||||
<solid android:color="#14FFFFFF" />
|
||||
</shape>
|
7
app/src/main/res/drawable/shape_e6e6f0_21.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="21dp"/>
|
||||
<solid android:color="#FFE6E6F0"/>
|
||||
</shape>
|
6
app/src/main/res/drawable/shape_ff425b_6dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="6dp"/>
|
||||
<solid android:color="#FFFF425B"/>
|
||||
</shape>
|
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white_tran_10" />
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="@color/white_transparent_40" />
|
||||
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
</shape>
|
@@ -2,12 +2,12 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFE710"
|
||||
android:color="#FFDA24"
|
||||
/>
|
||||
<solid
|
||||
android:color="@color/transparent"
|
||||
/>
|
||||
<corners
|
||||
android:radius="50dp"
|
||||
android:radius="16dp"
|
||||
/>
|
||||
</shape>
|
7
app/src/main/res/drawable/shape_theme_21.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="21dp"/>
|
||||
<solid android:color="@color/color_theme"/>
|
||||
</shape>
|
18
app/src/main/res/drawable/user_info_ic_help.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:viewportWidth="12"
|
||||
android:viewportHeight="12">
|
||||
<path
|
||||
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#A2A7B8"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M6.11,2.52C5.37,2.52 4.79,2.73 4.36,3.15C3.92,3.57 3.71,4.15 3.71,4.89L4.85,4.89C4.85,4.47 4.93,4.14 5.1,3.91C5.29,3.63 5.6,3.5 6.04,3.5C6.38,3.5 6.65,3.59 6.84,3.78C7.02,3.97 7.12,4.23 7.12,4.56C7.12,4.81 7.03,5.05 6.85,5.27L6.73,5.41C6.08,5.99 5.69,6.41 5.56,6.68C5.42,6.95 5.36,7.28 5.36,7.66L5.36,7.8L6.51,7.8L6.51,7.66C6.51,7.42 6.56,7.21 6.66,7.01C6.75,6.83 6.88,6.66 7.06,6.51C7.54,6.09 7.83,5.82 7.92,5.72C8.16,5.4 8.29,4.99 8.29,4.49C8.29,3.88 8.09,3.4 7.69,3.05C7.29,2.69 6.76,2.52 6.11,2.52ZM5.93,8.29C5.71,8.29 5.53,8.36 5.38,8.5C5.23,8.64 5.16,8.82 5.16,9.04C5.16,9.26 5.23,9.44 5.38,9.58C5.53,9.72 5.71,9.8 5.93,9.8C6.15,9.8 6.33,9.73 6.48,9.59C6.63,9.45 6.71,9.26 6.71,9.04C6.71,8.82 6.63,8.64 6.49,8.5C6.34,8.36 6.15,8.29 5.93,8.29Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#A2A7B8"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
@@ -4,15 +4,20 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_normal_1c1b22"
|
||||
android:background="#F8F8FB"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.nnbc123.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30" />
|
||||
android:background="@color/color_white">
|
||||
|
||||
<com.nnbc123.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30" />
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
@@ -35,8 +40,7 @@
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
android:layout_height="46dp" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
@@ -47,19 +51,19 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:baselineAligned="true"
|
||||
android:background="@color/white"
|
||||
android:baselineAligned="true"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:drawableStart="@drawable/ic_charge_diamond"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="我的钻石"
|
||||
android:layout_marginStart="15dp"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
@@ -67,9 +71,9 @@
|
||||
android:id="@+id/tv_diamond_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_marginStart="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="#ffffbc51"
|
||||
android:textSize="16sp" />
|
||||
|
||||
@@ -82,10 +86,10 @@
|
||||
android:id="@+id/tv_charge"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="24dp"
|
||||
android:text="充值"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:text="充值"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
@@ -10,19 +10,28 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_normal_1c1b22">
|
||||
android:background="#F8F8FB">
|
||||
|
||||
<com.nnbc123.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30" />
|
||||
android:background="@color/color_white">
|
||||
|
||||
<com.nnbc123.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_roll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/title_bar"
|
||||
android:layout_below="@+id/layout_title_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
@@ -37,13 +46,11 @@
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_below="@+id/fl_roll_view"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
android:layout_height="46dp"
|
||||
android:layout_below="@+id/fl_roll_view" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
|
@@ -545,7 +545,6 @@
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@@ -23,7 +23,6 @@
|
||||
android:layout_height="76dp"
|
||||
android:layout_marginStart="15dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -43,16 +42,15 @@
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:layout_width="55dp"
|
||||
android:id="@+id/iv_avatar_auditing"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@id/civ_avatar"
|
||||
android:layout_alignRight="@id/civ_avatar"
|
||||
android:layout_alignBottom="@id/civ_avatar"
|
||||
android:visibility="visible"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_avatar_auditing"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<ImageView
|
||||
@@ -75,10 +73,10 @@
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_nick"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
android:paddingLeft="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -92,6 +90,8 @@
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toStartOf="@+id/iv_arrow_nick"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical|end"
|
||||
android:hint="输入您的昵称"
|
||||
@@ -99,6 +99,16 @@
|
||||
android:textColorHint="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/font_normal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_arrow_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
@@ -109,11 +119,11 @@
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_birth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
android:paddingLeft="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -123,11 +133,11 @@
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_birth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|end"
|
||||
android:hint="选择您的生日"
|
||||
@@ -135,6 +145,13 @@
|
||||
android:textColorHint="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/font_normal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_arrow_birth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
@@ -148,9 +165,9 @@
|
||||
android:id="@+id/layout_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -198,8 +215,8 @@
|
||||
android:id="@+id/rl_audio_record"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="15dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
@@ -256,11 +273,12 @@
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_desc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -269,35 +287,16 @@
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_desc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:hint="@string/label_hint_desc_setting"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textColorHint="@color/text_secondary_878b9c" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
android:gravity="center_vertical|end"
|
||||
android:hint="@string/label_hint_desc_setting"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textColorHint="@color/text_secondary_878b9c" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_desc_more"
|
||||
|
116
app/src/main/res/layout/all_service_gift_go_room_tips_dialog.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="28dp"
|
||||
android:background="@drawable/shape_white_20dp_round"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/all_service_gift_room_go_title"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_go_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/all_service_gift_room_go_tips"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="14dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/color_9168FA"
|
||||
android:textSize="14dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_go_tips"
|
||||
tools:text="Name" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_checkbox"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/base_ic_checkbox_unselected"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_tips"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_room_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/all_service_gift_room_go_ignore"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_checkbox"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_checkbox"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_checkbox" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="28dp"
|
||||
android:layout_marginTop="19dp"
|
||||
android:layout_marginEnd="7.5dp"
|
||||
android:background="@drawable/shape_e6e6f0_21"
|
||||
android:gravity="center"
|
||||
android:text="@string/all_service_gift_room_go_cancel"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_go"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_checkbox" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_go"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="7.5dp"
|
||||
android:layout_marginEnd="28dp"
|
||||
android:background="@drawable/shape_theme_21"
|
||||
android:gravity="center"
|
||||
android:text="@string/all_service_gift_room_go_go"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_cancel"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_cancel"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_cancel" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</layout>
|
@@ -6,16 +6,57 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<!--这个只是为了让fl_lucky_desc水平对齐iv_dress_up_banner-->
|
||||
<Space
|
||||
android:id="@+id/space_dress_up_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintDimensionRatio="363:44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_dress_up_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="@id/space_dress_up_banner"
|
||||
app:layout_constraintBottom_toBottomOf="@id/space_dress_up_banner"
|
||||
app:layout_constraintDimensionRatio="363:44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.nnbc123.app.ui.widget.GIftDialogUnlockPanel
|
||||
android:id="@+id/panel_unlock"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0px"
|
||||
app:cardMaxElevation="0px"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_lucky_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:layout_constraintTop_toTopOf="@id/space_dress_up_banner"
|
||||
app:layout_constraintBottom_toBottomOf="@id/space_dress_up_banner"
|
||||
android:background="@drawable/bg_gift_dialog_lucky_desc"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
@@ -52,7 +93,7 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_star_week"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
@@ -381,9 +422,8 @@
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -394,7 +434,7 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_gifts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="261dp"
|
||||
android:layout_height="222dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -534,7 +574,9 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_recharge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/et_gift_message">
|
||||
@@ -542,9 +584,9 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="13dp"
|
||||
android:background="@drawable/shape_black_solid_round"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="9dp"
|
||||
@@ -554,8 +596,8 @@
|
||||
android:id="@+id/tv_text_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_gift_diamond"
|
||||
android:drawablePadding="3dp"
|
||||
android:drawableStart="@drawable/gift_dialog_ic_diamond_14"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
@@ -564,22 +606,21 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_recharge"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_arrow_recharge_white" />
|
||||
android:src="@drawable/gift_dialog_ic_arrow_white_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/send_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginRight="13dp"
|
||||
android:background="@drawable/shape_room_bg_send"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -605,7 +646,7 @@
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/icon_room_send_arrow_white" />
|
||||
android:src="@drawable/gift_dialog_ic_arrow_white_up" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -616,7 +657,7 @@
|
||||
android:background="@drawable/bg_magic_dialog_button_send"
|
||||
android:text="赠送"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
android:textSize="13dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -625,8 +666,10 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_privilege"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/et_gift_message">
|
||||
|
@@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="giftBean"
|
||||
type="com.nnbc123.core.noble.AllServiceGiftProtocol.DataBean" />
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="30dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/all_service_gift_ceremony_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/benefactor_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="35dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxEms="5"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{giftBean.sendUserNick}"
|
||||
android:textColor="#FBC200"
|
||||
android:textSize="12dp"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="宫泽艾里斯-宫泽艾里斯-宫泽艾里斯" />
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/benefactor_avatar"
|
||||
avatarUrl="@{giftBean.sendUserAvatar}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="2dp"
|
||||
app:cborder_color="#FFEB71"
|
||||
app:cborder_width="1dp"
|
||||
tools:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/give_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="送给"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receiver_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxEms="5"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{giftBean.recvUserNick}"
|
||||
android:textColor="#FBC200"
|
||||
android:textSize="12dp"
|
||||
tools:text="梅利奥达斯-梅利奥达斯-梅利奥达斯" />
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/receiver_avatar"
|
||||
avatarUrl="@{giftBean.recvUserAvatar}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="2dp"
|
||||
app:cborder_color="#FFEB71"
|
||||
app:cborder_width="1dp"
|
||||
tools:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:gravity="center"
|
||||
android:text="@{giftBean.giftName}"
|
||||
android:textColor="#80F9FF"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="神邸荣光" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_img"
|
||||
nomalUrl="@{giftBean.giftUrl}"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="2dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:gravity="center"
|
||||
android:text="@{@string/x + giftBean.giftNum}"
|
||||
android:textColor="#80F9FF"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="x1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_go_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:src="@drawable/all_service_gift_ceremony_go_to" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</layout>
|