45 Commits

Author SHA1 Message Date
Max
65bcf7a7ca fix:修复【一键登录不可用时按钮改为手机号登录功能】部分场景未失效bug 2024-02-04 17:11:48 +08:00
Max
b307db446d fix:修复UI反馈问题(礼物面板) 2024-02-04 11:52:02 +08:00
Max
bed3184df9 fix:修复赠送背包TAB的解锁礼物后,未更新顶部提示面板数量问题 2024-02-02 18:04:12 +08:00
Max
2c4fb0e056 fix:修复公屏-装扮礼物icon展示大小问题 2024-02-02 10:56:23 +08:00
Max
784aeebdf4 feat:修改资料页UI调整:增加箭头icon 2024-02-01 15:50:34 +08:00
Max
043e79681d fix:修复背包礼物显示锁问题 2024-02-01 15:22:11 +08:00
Max
b6972ee445 fix:修复装扮公屏展示问题 2024-02-01 14:58:16 +08:00
Max
4fd1bd73ea fix:装扮礼物点击banner增加空值判断 2024-02-01 14:33:53 +08:00
Max
afab35a691 fix:修复我的头饰状态判断错误问题 2024-02-01 14:33:30 +08:00
Max
d508912a9c feat:设置SplashScreen默认背景色(部分手机默认黑色) 2024-02-01 09:39:19 +08:00
Max
ec2e46b0a4 fix:调整礼物墙等级背景展示错误问题 2024-01-31 17:23:54 +08:00
Max
e2cf045ab7 fix:修复已解锁后文案展示问题 2024-01-31 16:16:49 +08:00
Max
c2cdd5d6f1 feat:去掉年度盛典icon 2024-01-31 11:38:59 +08:00
Max
5bacadf9df Merge branch 'feature/gift' into develop 2024-01-30 17:06:22 +08:00
Max
eb81154c1c feat:替换新人标签icon 2024-01-30 17:03:22 +08:00
Max
ae19a0c653 feat:修改注册默认头像地址 2024-01-30 17:01:58 +08:00
Max
44787e5041 feat:完成礼物墙优化(用户主页展示所有礼物) 2024-01-30 16:12:46 +08:00
Max
a8f12371a7 feat:调整装扮礼物banner字段 2024-01-30 11:03:53 +08:00
Max
950ce098dc feat:解锁礼物&装扮礼物,增加气泡展示逻辑 2024-01-29 19:32:55 +08:00
Max
720cf52fd0 feat:调整礼物面板-tab-new图标 2024-01-29 18:59:19 +08:00
Max
5d4aa38b93 feat:完成我的装扮下各个Tab的过期时间展示规则调整; 2024-01-29 18:41:10 +08:00
Max
a2faf14901 fix:优化解锁提示面板体验(模糊背景偶尔加载慢,改为动态添加View,有所改善) 2024-01-29 17:33:24 +08:00
Max
665fecb427 feat:完成解锁礼物与装扮礼物公屏展示逻辑 2024-01-29 16:51:19 +08:00
Max
6fb428b536 feat:补充解锁礼物点击联动逻辑 2024-01-29 15:32:44 +08:00
Max
a01a362506 feat:完成装扮礼物banner展示逻辑 2024-01-29 14:47:59 +08:00
Max
44ad80c708 feat:完成送礼后的解锁礼物本地状态更新逻辑 2024-01-29 11:51:46 +08:00
Max
f212af49f1 feat:完成趣味礼物展示 2024-01-26 18:50:22 +08:00
Max
3bcac093c7 feat:完成装扮商城、我的装扮 部分UI调整 2024-01-26 15:16:09 +08:00
Max
dd87492ffb feat:完善礼物面板底部UI调整
feat:初步完成解锁信息条目UI部分
2024-01-26 11:44:48 +08:00
Max
de79e73c9a feat:完成礼物面板-条目部分的UI调整 2024-01-25 19:46:34 +08:00
Max
fac1497de3 feat:修改开通房间时的实名认证文案 2024-01-25 15:36:56 +08:00
Max
a8335e915c feat:优化用户修改昵称、简介体验(在当前页完成网络请求) 2024-01-25 15:08:45 +08:00
Max
53820a23c7 feat:优化一键登录获取失败后展示手机号登录 2024-01-25 14:49:25 +08:00
Max
8016cc860a fix:修复后台无法show弹窗问题 2024-01-25 14:21:48 +08:00
Max
95e3e0768c fix:修复小米推送集成配置问题 2024-01-24 18:15:27 +08:00
Max
6f73f3f4fb Merge branch 'fix/agroa' into develop 2024-01-24 18:00:07 +08:00
Max
b6524ad94f feat:删除调试日志 2024-01-24 17:59:57 +08:00
Max
f5fc2f9d79 fix:修复离开模式下管理可以点击主麦操作问题(改为点击toast提示) 2024-01-24 17:56:52 +08:00
Max
be28ed2509 fix:修复Pk结束后底部麦克风图标状态无法更新问题 2024-01-24 16:46:24 +08:00
Max
5be60fe7b2 fix:修复Pk面包拖拽问题(适配父容器内边距) 2024-01-24 16:07:59 +08:00
Max
522c4a9f6f fix:修复声网上麦后自动开麦问题 2024-01-23 15:22:46 +08:00
Max
e478c9c202 feat:针对华为市场审核 补充权限申请提示 2024-01-15 11:58:22 +08:00
Max
3ac10340d6 feat:调整多渠道方式(换gradle默认方式) 2024-01-09 15:33:37 +08:00
Max
a10471d1c2 feat:完成华为应用市场权限申请适配(增加提示) 2024-01-09 14:46:05 +08:00
Max
d47536cc13 fix:修复房间榜单数据展示问题(榜二、榜三,数值未渲染) 2024-01-05 10:09:28 +08:00
139 changed files with 2426 additions and 702 deletions

View File

@@ -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,54 @@ android {
buildToolsVersion = '30.0.3'
productFlavors {
official {
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 +303,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 +321,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
//是否排除生成ActivityJava文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
otherCountPerPackage = 50 //每个包下生成其它类的数量
methodCountPerClass = 20 //每个下生成方法数量
resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀
drawableCount = 300 //生成drawable资源数量
stringCount = 300 //生成string数量
})
}
}

View File

@@ -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" />

View File

@@ -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();

View File

@@ -679,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
@@ -1000,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)

View File

@@ -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)

View File

@@ -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);

View File

@@ -134,7 +134,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;

View File

@@ -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()

View File

@@ -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
}
}

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -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));
}
}
}

View File

@@ -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));
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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));
}
}
}

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -5,12 +5,17 @@ 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
@@ -22,33 +27,83 @@ class RequestPermissionEvent : UnicornEventBase<RequestPermissionEventEntry> {
p1: Context?,
p2: EventCallback<RequestPermissionEventEntry>?
) {
p2?.onNotPorcessEvent()
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)
}
when (p1?.scenesType) {
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 -> {
showDeniedTips(p0, ResUtil.getString(R.string.permission_denied_tips_mic))
return true
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_TAKE_VIDEO,
RequestPermissionEventEntry.SCENES_SAVE_IMAGE,
RequestPermissionEventEntry.SCENES_SAVE_VIDEO,
RequestPermissionEventEntry.SCENES_SELECT_VIDEO,
RequestPermissionEventEntry.SCENES_SELECT_FILE,
RequestPermissionEventEntry.SCENES_SELECT_IMAGE,
RequestPermissionEventEntry.SCENES_TAKE_PHOTO,
RequestPermissionEventEntry.SCENES_VIDEO_CHAT -> {
showDeniedTips(p0, ResUtil.getString(R.string.permission_denied_tips_image))
return true
return ResUtil.getString(R.string.permission_denied_tips_image)
}
else -> {
return super.onDenyEvent(p0, p1)
return null
}
}
}

View File

@@ -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 {

View File

@@ -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;
}
}

View File

@@ -2,6 +2,7 @@ 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;
@@ -54,6 +55,7 @@ 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;
@@ -61,6 +63,7 @@ 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;
@@ -230,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,this::requestPermission);
Container container = new Container(getActivity(), sessionId, sessionType, this, this::requestPermission);
if (messageListPanel == null) {
messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, false);
@@ -321,10 +324,16 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
}
private void requestPermission(Consumer<Boolean> consumer, String deniedTips, String... perms) {
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(deniedTips);
showPermissionDeniedTipsDialog(tips);
}
if (consumer != null) {
consumer.accept(aBoolean);
@@ -616,19 +625,30 @@ 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 {
showPermissionDeniedTipsDialog(ResUtil.getString(R.string.permission_denied_tips_mic));
showPermissionDeniedTipsDialog(tips);
}
});
}
private void showPermissionDeniedTipsDialog(String message){
private void showPermissionDeniedTipsDialog(String message) {
CommonTipDialog mPrivacyDialog = new CommonTipDialog(getContext());
mPrivacyDialog.setTipMsg(message);
mPrivacyDialog.setOkText("去设置");

View File

@@ -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());
});
}
}

View File

@@ -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 = "";

View File

@@ -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("普通礼物");

View File

@@ -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);
}
}

View File

@@ -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;
}
}
}

View File

@@ -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秒重新获取用户信息更新状态

View File

@@ -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,
"请您再次考虑授予存储空间权限,否则将无法正常加载您本地的文件内容。",

View File

@@ -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));
}
}
}

View File

@@ -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)
}
}

View File

@@ -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

View File

@@ -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,

View File

@@ -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";
}

View File

@@ -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)
}
}

View File

@@ -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;
}

View File

@@ -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)
}
}

View File

@@ -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()
}
}
}

View File

@@ -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;

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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" />

View File

@@ -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>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#14FFFFFF" />
<corners android:radius="4dp" />
<stroke
android:width="0.5dp"
android:color="#FFDA24" />
</shape>

View File

@@ -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>

View 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>

View 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>

View File

@@ -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>

View 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>

View 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>

View File

@@ -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>

View File

@@ -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>

View 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>

View File

@@ -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" />

View File

@@ -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"

View File

@@ -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>

View File

@@ -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"

View File

@@ -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">

View File

@@ -325,6 +325,7 @@
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_10"
android:layout_marginStart="10dp"
android:rotation="180"
android:src="@drawable/icon_room_send_arrow" />
</LinearLayout>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="5dp"
android:alpha="0"
android:background="@drawable/shape_white_8dp_round"
android:paddingHorizontal="28dp"
android:paddingVertical="14dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="权限使用说明:"
android:textColor="#2B2D33"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:textColor="#696D7A"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="MESSAGEMESSA" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -15,7 +15,7 @@
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingStart="14dp"
android:paddingTop="15dp"
android:paddingTop="10dp"
android:paddingEnd="14dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -11,11 +11,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_gift"
android:layout_marginTop="6dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="12dp"
android:paddingEnd="12dp" />
android:layout_marginTop="11.5dp"
android:paddingHorizontal="9.5dp" />
</LinearLayout>

View File

@@ -2,6 +2,7 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -17,10 +18,10 @@
android:layout_marginTop="12dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_12"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_12"
android:paddingLeft="@dimen/dp_13"
android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_13"
android:paddingBottom="@dimen/dp_16"
app:layout_constraintTop_toTopOf="parent">
<TextView
@@ -28,19 +29,20 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="技能卡"
android:textColor="@color/text_normal_282828"
android:textSize="@dimen/sp_16" />
android:textColor="#2B2D33"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_skill"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="8dp" />
android:layout_marginTop="@dimen/dp_8" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_gift"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
@@ -50,41 +52,61 @@
app:layout_constraintTop_toBottomOf="@id/ll_skill"
app:layout_constraintVertical_bias="0">
<TextView
android:id="@+id/tv_gift_detail"
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="15dp"
android:includeFontPadding="false"
android:text="礼物墙"
android:textColor="@color/text_normal_282828"
android:textSize="@dimen/sp_16" />
android:orientation="horizontal"
android:paddingStart="13dp"
android:paddingTop="8dp"
android:paddingEnd="13dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/tv_gift_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="礼物墙"
android:textColor="#2B2D33"
android:textSize="@dimen/sp_15"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gift_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/user_info_ic_help"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:paddingVertical="5dp"
android:text="礼物等级说明"
android:textColor="#A2A7B8"
android:textSize="@dimen/sp_11"
app:layout_constraintBottom_toBottomOf="@id/tv_gift_detail"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_gift_detail" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/magic_indicator_gift"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_height="34dp"
android:layout_gravity="center_horizontal" />
<ImageView
android:id="@+id/iv_more_gift"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="end"
android:layout_marginTop="-25dp"
android:layout_marginEnd="15dp"
android:scaleType="center"
android:src="@drawable/ic_userinfo_arrow_right" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_gift"
android:layout_width="match_parent"
android:layout_height="350dp" />
</LinearLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_gift"
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="@color/white"
app:layout_constraintTop_toBottomOf="@id/layout_gift" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:background="@drawable/shape_14ffffff_4dp"
android:paddingStart="3dp"
android:paddingEnd="8dp"
tools:background="@color/black">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="28dp"
android:layout_height="28dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10dp"
app:layout_constraintBottom_toTopOf="@id/tv_amount"
app:layout_constraintStart_toEndOf="@id/iv_cover"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#CED1DB"
android:textSize="9dp"
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
app:layout_constraintStart_toEndOf="@id/iv_unit"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:text="100" />
<ImageView
android:id="@+id/iv_unit"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/gift_dialog_ic_diamond"
app:layout_constraintBottom_toBottomOf="@id/tv_amount"
app:layout_constraintStart_toStartOf="@id/tv_name"
app:layout_constraintTop_toTopOf="@id/tv_amount" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:background="@drawable/shape_14ffffff_4dp"
android:paddingStart="3dp"
android:paddingEnd="8dp"
tools:background="@color/black">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="28dp"
android:layout_height="28dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover" />
<ImageView
android:id="@+id/iv_lock"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginStart="1dp"
android:layout_marginTop="2dp"
android:scaleType="centerCrop"
android:src="@drawable/gift_dialog_ic_lock"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10dp"
app:layout_constraintBottom_toTopOf="@id/tv_count"
app:layout_constraintStart_toEndOf="@id/iv_cover"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#CED1DB"
android:textSize="9dp"
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
app:layout_constraintStart_toEndOf="@id/progress_bar"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:text="1/5" />
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="88dp"
android:layout_height="6dp"
android:max="100"
android:progressDrawable="@drawable/gift_dialog_lock_progress_drawable"
app:layout_constraintBottom_toBottomOf="@id/tv_count"
app:layout_constraintStart_toStartOf="@id/tv_name"
app:layout_constraintTop_toTopOf="@id/tv_count"
tools:progress="20" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<merge 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="match_parent"
tools:parentTag="androidx.cardview.widget.CardView">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginHorizontal="4dp"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</merge>

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="carInfo"
type="com.nnbc123.core.decoration.car.bean.CarInfo" />
@@ -11,18 +12,17 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="120dp"
tools:background="@color/bg_normal_1c1b22"
>
tools:background="@color/bg_normal_1c1b22">
<FrameLayout
android:id="@+id/ll_car_cover"
android:layout_width="112dp"
android:orientation="vertical"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:padding="5dp"
android:background="@drawable/bg_secondary_radius_15"
android:layout_height="80dp" >
android:orientation="vertical"
android:padding="5dp">
<ImageView
android:id="@+id/iv_car_cover"
@@ -33,65 +33,67 @@
android:id="@+id/iv_tag"
android:layout_width="20dp"
android:layout_height="20dp"
tools:src="@drawable/ic_mark_limit"/>
tools:src="@drawable/ic_mark_limit" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_toStartOf="@id/tv_used"
android:layout_toEndOf="@id/ll_car_cover"
android:orientation="vertical">
<TextView
android:id="@+id/tv_car_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_toEndOf="@+id/ll_car_cover"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginStart="10dp"
android:textColor="@color/text_title_282828"
android:singleLine="true"
android:drawableStart="@{carInfo.isGive ? @drawable/ic_send_tag : null}"
android:drawablePadding="5dp"
android:textSize="15sp"
android:gravity="left"
android:singleLine="true"
android:text="@{carInfo.name}"
android:textColor="@color/text_title_282828"
android:textSize="15sp"
tools:text="神豪座驾" />
<TextView
android:id="@+id/tv_used"
android:layout_width="85dp"
android:layout_height="33dp"
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="center"
android:textSize="14sp"
android:visibility="gone"
android:textColor="@color/text_title_282828"
tools:visibility="visible"
android:layout_marginEnd="@dimen/dp_15"
android:layout_alignTop="@id/tv_car_name"
android:layout_alignParentEnd="true"
tools:text="@string/label_can_use"
tools:background="@drawable/bg_common_confirm"/>
android:maxLines="1"
android:textColor="#696D7A"
android:textSize="11sp"
tools:text="- 1567天 -" />
</LinearLayout>
<TextView
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/ll_car_cover"
android:layout_toEndOf="@id/ll_car_cover"
android:layout_marginStart="10dp"
android:layout_marginTop="24dp"
android:id="@+id/tv_used"
android:layout_width="78dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_13"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/text_normal_282828"
android:textSize="12sp"
tools:text="- 1567天 -" />
android:textColor="#2B2D33"
android:textSize="13sp"
android:visibility="gone"
tools:background="@drawable/bg_common_confirm"
tools:text="@string/label_can_use"
tools:visibility="visible" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_alignParentBottom="true"
android:layout_marginEnd="15dp"
android:layout_marginStart="15dp"
android:background="@color/line_353548"/>
android:layout_marginEnd="15dp"
android:background="@color/line_353548" />
</RelativeLayout>
</layout>

View File

@@ -102,7 +102,7 @@
android:drawablePadding="1dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/color_999999"
android:textColor="#696D7A"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -39,59 +39,64 @@
</FrameLayout>
<TextView
android:id="@+id/tv_car_name"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="10dp"
android:layout_toEndOf="@+id/ll_head_img"
android:drawableStart="@{headWearInfo.comeFrom==1?null:@drawable/ic_send_tag}"
android:drawablePadding="@dimen/dp_5"
android:text="@{headWearInfo.headwearName}"
android:textColor="@color/text_title_282828"
android:textSize="15sp"
tools:text="神豪座驾" />
android:layout_centerVertical="true"
android:layout_marginStart="13dp"
android:layout_toStartOf="@id/tv_used"
android:layout_toEndOf="@id/ll_head_img"
android:orientation="vertical">
<TextView
android:id="@+id/tv_car_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@{headWearInfo.comeFrom==1?null:@drawable/ic_send_tag}"
android:drawablePadding="@dimen/dp_5"
android:text="@{headWearInfo.headwearName}"
android:textColor="@color/text_title_282828"
android:textSize="15sp"
tools:text="神豪座驾" />
<TextView
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:drawablePadding="1dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="#696D7A"
android:textSize="11sp"
tools:text="剩余666天剩余666天剩余666天剩余666天剩余666天" />
</LinearLayout>
<TextView
android:id="@+id/tv_used"
android:layout_width="85dp"
android:layout_height="33dp"
android:layout_alignTop="@id/tv_car_name"
android:layout_width="78dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_15"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_13"
android:background="@{headWearInfo.used ? @drawable/bg_common_cancel : @drawable/bg_common_confirm}"
android:gravity="center"
android:text="@{headWearInfo.used ? @string/label_used : @string/label_can_use}"
android:textColor="@color/text_title_282828"
android:textSize="14sp"
android:textColor="#2B2D33"
android:textSize="13sp"
android:visibility="gone"
tools:background="@drawable/bg_common_confirm"
tools:text="@string/label_can_use"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/ll_head_img"
android:layout_marginStart="15dp"
android:layout_toEndOf="@+id/ll_head_img"
android:drawablePadding="1dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/text_normal_282828"
android:textSize="12sp"
tools:text="剩余666天" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_alignEnd="@id/tv_used"
android:layout_alignParentBottom="true"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_toRightOf="@id/ll_head_img"
android:background="@color/line_353548" />
</RelativeLayout>

View File

@@ -92,7 +92,7 @@
android:drawablePadding="1dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/color_999999"
android:textColor="#696D7A"
android:textSize="10sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/tv_name"

View File

@@ -5,8 +5,8 @@
android:layout_height="26dp"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_7"
android:paddingRight="@dimen/dp_7">
android:paddingLeft="@dimen/dp_8"
android:paddingRight="@dimen/dp_8">
<TextView
android:id="@+id/tv_title"
@@ -17,12 +17,18 @@
tools:ignore="SpUsage"
tools:text="全部礼物" />
<ImageView
android:id="@+id/iv_new_tag"
<TextView
android:id="@+id/tv_new_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="11dp"
android:layout_gravity="top"
android:src="@drawable/ic_gift_dialog_new"
android:layout_marginStart="-15dp"
android:background="@drawable/shape_ff425b_6dp"
android:gravity="center"
android:paddingHorizontal="3dp"
android:text="New"
android:textColor="@color/white"
android:textSize="8dp"
android:visibility="gone"
tools:visibility="visible" />

View File

@@ -15,38 +15,51 @@
<RelativeLayout
android:id="@+id/gift_layout"
android:layout_width="86dp"
android:layout_height="98dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:gravity="center">
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
android:gravity="center"
tools:layout_width="88dp">
<View
android:id="@+id/view_room_gift_select"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@{item.isPrivateChat?@drawable/shape_gift_item_select : @drawable/shape_gift_item_select_room}"
android:background="@{item.isPrivateChat?@drawable/shape_gift_item_select : @drawable/gift_dialog_bg_item}"
android:visibility="@{item.isSelect ? View.VISIBLE : View.INVISIBLE}"
tools:visibility="visible" />
<ImageView
android:id="@+id/gift_image"
nomalUrl="@{item.data().giftUrl}"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginTop="7dp"
android:alpha="@{item.isLocked?0.5f:1f}" />
<ImageView
nomalUrl="@{item.data().giftTag}"
android:alpha="@{item.isLocked?0.5f:1f}"
android:visibility="@{TextUtils.isEmpty(item.data().giftTag) ? View.GONE : View.VISIBLE}"
android:id="@+id/iv_tag"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:layout_alignStart="@id/gift_image"
android:layout_alignBottom="@id/gift_image"
android:adjustViewBounds="true" />
<TextView
android:id="@+id/gift_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/gift_image"
android:layout_centerHorizontal="true"
android:alpha="@{item.isLocked?0.5f:1f}"
android:text="@{item.data().giftName}"
android:textColor="@{item.isPrivateChat? @color/text_normal_282828 : @color/white}"
android:textSize="@dimen/dp_10"
android:textSize="@dimen/dp_12"
tools:ignore="SpUsage"
tools:text="123"
tools:textColor="@color/text_secondary_878b9c" />
@@ -57,30 +70,33 @@
android:layout_height="wrap_content"
android:layout_below="@id/gift_name"
android:layout_centerHorizontal="true"
android:alpha="@{item.isLocked?0.5f:1f}"
android:drawableStart="@{item.isSelect?item.radishDrawableSelected:item.radishDrawable}"
android:drawablePadding="2dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@{item.goldText}"
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white_transparent_60}"
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/color_CED1DB}"
android:textSize="@dimen/dp_10"
tools:ignore="SpUsage"
tools:text="123"
tools:textColor="@color/white_transparent_60"/>
tools:textColor="@color/white_transparent_60" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="4dp"
android:alpha="@{item.isLocked?0.5f:1f}"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingEnd="2dp">
<ImageView
android:id="@+id/icon_gift_exclusive"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3"
android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_exclusive"
android:visibility="@{item.isExclusive ? View.VISIBLE : View.GONE}"
tools:visibility="visible" />
@@ -89,7 +105,7 @@
android:id="@+id/icon_gift_new"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3"
android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_new"
android:visibility="@{item.isShowNew ? View.VISIBLE : View.GONE}"
tools:visibility="visible" />
@@ -98,7 +114,7 @@
android:id="@+id/icon_gift_limit_time"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3"
android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_limit_time"
android:visibility="@{item.isShowLimit ? View.VISIBLE : View.GONE}"
tools:visibility="visible" />
@@ -107,7 +123,7 @@
android:id="@+id/icon_gift_effect"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_effect"
android:visibility="@{item.isShowEffect ? View.VISIBLE : View.GONE}"
tools:visibility="visible" />
@@ -117,7 +133,7 @@
nomalUrl="@{item.vipIcon}"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:layout_marginEnd="@dimen/dp_3"
android:layout_marginEnd="@dimen/dp_2"
android:adjustViewBounds="true"
android:visibility="@{TextUtils.isEmpty(item.vipIcon) ? View.GONE : View.VISIBLE}"
tools:src="@drawable/icon_gift_effect" />
@@ -128,6 +144,7 @@
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:layout_marginStart="@dimen/dp_5"
android:background="@drawable/shape_white_alpha_10_radius_100"
android:paddingStart="3dp"
@@ -135,18 +152,17 @@
android:text="@{item.countText}"
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white}"
android:textSize="@dimen/sp_9"
android:visibility="@{item.isKnap ? View.VISIBLE : View.GONE}" />
android:visibility="@{item.isKnap ? View.VISIBLE : View.GONE}"
tools:text="x100"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_vip_locked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="2dp"
android:layout_marginBottom="2dp"
android:src="@drawable/ic_vip_locked"
android:layout_width="9dp"
android:layout_height="9dp"
android:layout_alignStart="@id/gift_image"
android:layout_alignTop="@id/gift_image"
android:src="@drawable/gift_dialog_ic_lock"
android:visibility="@{item.isLocked ? View.VISIBLE : View.GONE}" />
</RelativeLayout>

View File

@@ -1,58 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="7dp"
android:background="@drawable/shape_f3f5fa_corner_8dp"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="5dp">
android:layout_marginHorizontal="2.5dp"
android:layout_marginVertical="4dp"
tools:layout_width="84dp">
<ImageView
android:id="@+id/iv_bg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:src="@drawable/gift_wall_bg_level_0"
app:layout_constraintDimensionRatio="84:122"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line_icon_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.0655" />
<ImageView
android:id="@+id/gift_img"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="10dp" />
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line_icon_top"
app:layout_constraintWidth_percent="0.654"
tools:src="@drawable/default_cover" />
<TextView
android:id="@+id/gift_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="1dp"
android:gravity="center"
android:includeFontPadding="false"
android:paddingStart="8dp"
android:paddingEnd="@dimen/dp_8"
android:textColor="#6D6B89"
android:textSize="12dp"
android:textColor="#7F8494"
android:textSize="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gift_img"
tools:text="x120" />
<TextView
android:id="@+id/gift_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginTop="1dp"
android:ellipsize="end"
android:gravity="center_horizontal"
android:lines="1"
android:textColor="@color/text_normal_282828"
android:paddingHorizontal="3dp"
android:textColor="#696D7A"
android:textSize="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gift_num"
tools:text="天使" />
<TextView
android:id="@+id/gift_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:drawableStart="@drawable/ic_gift_diamond"
android:drawableStart="@drawable/gift_wall_ic_diamond"
android:drawablePadding="1dp"
android:gravity="center_vertical"
android:textColor="@color/text_secondary_878b9c"
android:textSize="11dp"
android:textColor="#7F8494"
android:textSize="9dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gift_name"
tools:text="10" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

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