[Modify]特权卡功能实现
@@ -148,7 +148,7 @@ android {
|
||||
}
|
||||
|
||||
debug {
|
||||
buildConfigField "String", "BASE_URL", "\"http://apidev.yinmeng.zhongjialx.com/\""
|
||||
buildConfigField "String", "BASE_URL", "\"http://beta.api.nnbc123.cn/\""
|
||||
buildConfigField "String", "WEB_URL", "\"http://h5dev.yinmeng.zhongjialx.com/\""
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "\"https://api.nnbc123.cn/\""
|
||||
@@ -177,6 +177,9 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation fileTree(dir: 'aliyun-libs', include: ['*.jar', '*.aar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.4.+'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
|
@@ -1,35 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.nnbc123.app">
|
||||
|
||||
package="com.nnbc123.app"> <!-- 云信集成小米推送 end -->
|
||||
<uses-sdk tools:overrideLibrary="com.huawei.android.hms.base,com.huawei.android.hms.push" />
|
||||
<!-- 应用内安装软件权限 oppo vivo 手机,需要加这个东西才能 在安装未知应用列表出现 -->
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- bugly所需权限 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<!-- ShareSdk权限申请 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
|
||||
<!-- Required -->
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <!-- bugly所需权限 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- ShareSdk权限申请 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- Required -->
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_PHONE_STATE"
|
||||
tools:node="remove" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.ACCESS_FINE_LOCATION"
|
||||
tools:node="remove" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.ACCESS_COARSE_LOCATION"
|
||||
tools:node="remove" />
|
||||
|
||||
<!-- 云信权限声明 -->
|
||||
tools:node="remove" /> <!-- 云信权限声明 -->
|
||||
<!-- 控制呼吸灯,振动器等,用于新消息提醒 -->
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" /> <!-- 外置存储存取权限 -->
|
||||
@@ -44,9 +35,7 @@
|
||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<!-- 如果需要实时音视频通话模块,下面的权限也是必须的。否则,可以不加 -->
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 如果需要实时音视频通话模块,下面的权限也是必须的。否则,可以不加 -->
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
android:required="true" /> <!-- SDK 权限申明, 第三方 APP 接入时,请将 com.netease.nim.demo 替换为自己的包名 -->
|
||||
@@ -54,21 +43,14 @@
|
||||
<permission
|
||||
android:name="${applicationId}.permission.RECEIVE_MSG"
|
||||
android:protectionLevel="signature" /> <!-- 接收 SDK 消息广播权限, 第三方 APP 接入时,请将 com.netease.nim.demo 替换为自己的包名 -->
|
||||
<uses-permission android:name="com.xteam.xchat.permission.RECEIVE_MSG" />
|
||||
|
||||
<!-- 云信集成小米推送 start -->
|
||||
<uses-permission android:name="com.xteam.xchat.permission.RECEIVE_MSG" /> <!-- 云信集成小米推送 start -->
|
||||
<permission
|
||||
android:name="${applicationId}.permission.MIPUSH_RECEIVE"
|
||||
android:protectionLevel="signature" />
|
||||
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />
|
||||
<!-- 云信集成小米推送 end -->
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.huawei.android.hms.base,com.huawei.android.hms.push" /><!-- 云信集成华为推送 -->
|
||||
|
||||
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" /><!-- 云信集成oppo推送 -->
|
||||
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" />
|
||||
|
||||
<!-- 云信集成魅族推送 start -->
|
||||
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" /> <!-- 云信集成华为推送 -->
|
||||
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" /> <!-- 云信集成oppo推送 -->
|
||||
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" /> <!-- 云信集成魅族推送 start -->
|
||||
<!-- 兼容flyme5.0以下版本,魅族内部集成pushSDK必填,不然无法收到消息,将{你的包名} 改开发者App的包名 -->
|
||||
<uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE" />
|
||||
|
||||
@@ -97,7 +79,6 @@
|
||||
android:theme="@style/MyMaterialTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:name,android:allowBackup">
|
||||
|
||||
<!-- 刘海屏适配 begin -->
|
||||
<!-- 小米 -->
|
||||
<meta-data
|
||||
@@ -109,7 +90,6 @@
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" /> <!-- 刘海屏适配 end -->
|
||||
|
||||
<provider
|
||||
android:name="com.nnbc123.app.utils.BuglyFileProvider"
|
||||
android:authorities="${applicationId}.fileProvider"
|
||||
@@ -120,20 +100,19 @@
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths"
|
||||
tools:replace="name,resource" />
|
||||
</provider>
|
||||
|
||||
|
||||
<!-- 云信配置 begin ##################################################### -->
|
||||
</provider> <!-- 云信配置 begin ##################################################### -->
|
||||
<!--
|
||||
APP key, 可以在这里设置,也可以在 SDKOptions 中提供。
|
||||
如果 SDKOptions 中提供了,取 SDKOptions 中的值。
|
||||
-->
|
||||
<meta-data
|
||||
android:name="com.netease.nim.appKey"
|
||||
android:value="09bde8b3d86b98a6612bc3fc92709799" /> <!-- 声明云信后台服务,如需保持后台推送,使用独立进程效果会更好。
|
||||
android:value="09bde8b3d86b98a6612bc3fc92709799" />
|
||||
<!--
|
||||
声明云信后台服务,如需保持后台推送,使用独立进程效果会更好。
|
||||
ca46478c438dda51d25306f52fe7506b
|
||||
09bde8b3d86b98a6612bc3fc92709799
|
||||
-->
|
||||
-->
|
||||
<service
|
||||
android:name="com.netease.nimlib.service.NimService"
|
||||
android:exported="false"
|
||||
@@ -164,8 +143,7 @@
|
||||
android:exported="false" /> <!-- 云信进程间通信service -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.service.ResponseService"
|
||||
android:exported="false" />
|
||||
<!-- 申明本地电话状态(通话状态)的广播接收器,第三方APP集成时音视频模块时,如果需要在App中处理网络通话与本地电话的交互请加上此接收器 -->
|
||||
android:exported="false" /> <!-- 申明本地电话状态(通话状态)的广播接收器,第三方APP集成时音视频模块时,如果需要在App中处理网络通话与本地电话的交互请加上此接收器 -->
|
||||
<!-- 在Demo的示例代码中是在Application进行了网络通话与本地电话的互斥处理 -->
|
||||
<receiver
|
||||
android:name="com.nnbc123.app.reciever.IncomingCallReceiver"
|
||||
@@ -175,7 +153,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name="com.nnbc123.app.reciever.NotificationClickReceiver" /> <!-- 云信进程间通信provider -->
|
||||
|
||||
<!-- 云信集成oppo推送 start -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.oppo.OppoPushService"
|
||||
@@ -193,7 +170,6 @@
|
||||
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name="com.nnbc123.app.push.OppoPushService"
|
||||
android:exported="false"
|
||||
@@ -201,9 +177,7 @@
|
||||
<intent-filter>
|
||||
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- 云信集成oppo推送 end -->
|
||||
|
||||
</service> <!-- 云信集成oppo推送 end -->
|
||||
<!-- 云信集成华为推送 start -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.hw.HWPushService"
|
||||
@@ -211,15 +185,10 @@
|
||||
<intent-filter>
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- 云信集成华为推送 end -->
|
||||
|
||||
</service> <!-- 云信集成华为推送 end -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.service.ResponseService"
|
||||
android:exported="false" />
|
||||
|
||||
|
||||
<!-- 云信集成小米推送 start -->
|
||||
android:exported="false" /> <!-- 云信集成小米推送 start -->
|
||||
<!-- 配置的service和receiver -->
|
||||
<provider
|
||||
android:name="com.netease.nimlib.ipc.NIMContentProvider"
|
||||
@@ -278,22 +247,23 @@
|
||||
<action android:name="com.xiaomi.mipush.ERROR" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- 云信集成小米推送 end -->
|
||||
|
||||
|
||||
<!-- 云信继承vivo推送 start-->
|
||||
<!-- 云信继承vivo推送 start -->
|
||||
<service
|
||||
android:name="com.vivo.push.sdk.service.CommandClientService"
|
||||
android:exported="true"
|
||||
android:permission="com.push.permission.UPSTAGESERVICE" />
|
||||
|
||||
<activity
|
||||
android:name="com.vivo.push.sdk.LinkProxyClientActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
||||
<receiver
|
||||
android:name="com.netease.nimlib.mixpush.vivo.VivoPushReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 接收 push 消息 -->
|
||||
<action android:name="com.vivo.pushclient.action.RECEIVE" />
|
||||
</intent-filter>
|
||||
@@ -304,10 +274,7 @@
|
||||
android:value="8de0df98690ba00225b88313aaee754f" />
|
||||
<meta-data
|
||||
android:name="com.vivo.push.app_id"
|
||||
android:value="104560655" />
|
||||
<!-- 云信集成vivo推送 end -->
|
||||
|
||||
|
||||
android:value="104560655" /> <!-- 云信集成vivo推送 end -->
|
||||
<!-- 云信集成魅族推送 start -->
|
||||
<!-- 配置的service和receiver -->
|
||||
<receiver
|
||||
@@ -336,9 +303,7 @@
|
||||
<action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" />
|
||||
<action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!-- 云信集成魅族推送 end -->
|
||||
|
||||
</receiver> <!-- 云信集成魅族推送 end -->
|
||||
<!-- 云信配置 end ##################################################### -->
|
||||
<!-- <!– 安卓保活配置 –> -->
|
||||
<!-- <service -->
|
||||
@@ -356,21 +321,18 @@
|
||||
<!-- android:value="com.netease.nimlib.service.NimReceiver" /> -->
|
||||
<!-- 云信#####################################################配置 -->
|
||||
<!-- autolayout####################################################配置 -->
|
||||
<!--Vivo Push需要配置的service、activity-->
|
||||
<!--配置的service, activity, receiver-->
|
||||
|
||||
<!-- Vivo Push需要配置的service、activity -->
|
||||
<!-- 配置的service, activity, receiver -->
|
||||
<meta-data
|
||||
android:name="design_width"
|
||||
android:value="768" />
|
||||
<meta-data
|
||||
android:name="design_height"
|
||||
android:value="1280" />
|
||||
<!-- Autolayout####################################################配置 -->
|
||||
|
||||
android:value="1280" /> <!-- Autolayout####################################################配置 -->
|
||||
<!-- LinkedMe ####################################################配置 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="linkedme.sdk.key"-->
|
||||
<!-- android:value="978cd79c98264f836450afda1228762e" /> <!– LinkedMe####################################################配置 –>-->
|
||||
<!-- <meta-data -->
|
||||
<!-- android:name="linkedme.sdk.key" -->
|
||||
<!-- android:value="978cd79c98264f836450afda1228762e" /> <!– LinkedMe####################################################配置 –> -->
|
||||
<!-- TakePhoto申明 -->
|
||||
<activity
|
||||
android:name="com.soundcloud.android.crop.CropImageActivity"
|
||||
@@ -400,27 +362,20 @@
|
||||
android:scheme="yinmengpushscheme" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.tencent.bugly.beta.ui.BetaActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|locale"
|
||||
android:theme="@android:style/Theme.Translucent" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.core.pay.PaymentActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
|
||||
<!-- tinker配置 end ########################################################## -->
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" /> <!-- tinker配置 end ########################################################## -->
|
||||
<!-- 支付相关配置 -->
|
||||
<!-- 微信支付需要注册 -->
|
||||
<activity-alias
|
||||
android:name="${applicationId}.wxapi.WXPayEntryActivity"
|
||||
android:exported="true"
|
||||
android:targetActivity="com.nnbc123.core.pay.PaymentActivity" />
|
||||
<!-- 支付相关配置 -->
|
||||
|
||||
|
||||
android:targetActivity="com.nnbc123.core.pay.PaymentActivity" /> <!-- 支付相关配置 -->
|
||||
<!-- shareSDK配置 end ####################################################### -->
|
||||
<service
|
||||
android:name="com.nnbc123.app.service.DaemonService"
|
||||
@@ -474,7 +429,6 @@
|
||||
android:scheme="http" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.login.LoginPhoneActivity"
|
||||
android:label="输入手机号界面"
|
||||
@@ -485,7 +439,6 @@
|
||||
android:label="输入验证码界面"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.login.BindPhoneActivity"
|
||||
android:label="绑定手机号界面"
|
||||
@@ -496,20 +449,16 @@
|
||||
android:label="绑定输入验证码界面"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.UserGuideActivity"
|
||||
android:label="引导页"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.search.SearchActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.search.SearchUserActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
@@ -534,7 +483,7 @@
|
||||
android:noHistory="true"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.AVRoomActivity"
|
||||
android:name=".avroom.activity.AVRoomActivity"
|
||||
android:hardwareAccelerated="true"
|
||||
android:label="聊天室"
|
||||
android:launchMode="singleTask"
|
||||
@@ -542,15 +491,15 @@
|
||||
android:theme="@style/AVRoomTheme"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomSettingActivity"
|
||||
android:name=".avroom.activity.RoomSettingActivity"
|
||||
android:label="房间设置"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomManagerListActivity"
|
||||
android:name=".avroom.activity.RoomManagerListActivity"
|
||||
android:label="管理员"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomBlackListActivity"
|
||||
android:name=".avroom.activity.RoomBlackListActivity"
|
||||
android:label="黑名单"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
@@ -589,22 +538,18 @@
|
||||
android:name="com.nnbc123.app.audio.AudioRecordActivity"
|
||||
android:label="录音"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.pay.ChargeActivity"
|
||||
android:label="充值"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.pay.ChargeDialog"
|
||||
android:label="充值"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.home.activity.CollectionRoomActivity"
|
||||
android:label="收藏房间"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.wallet.ExchangeGoldActivity"
|
||||
android:label="兑换钻石"
|
||||
@@ -618,15 +563,12 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.relation.FansListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.withdraw.WithdrawActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<!-- 提现绑定银行卡 -->
|
||||
android:screenOrientation="portrait" /> <!-- 提现绑定银行卡 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.withdraw.bankcard.BindWithdrawBankCardActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.withdraw.WithdrawRuleActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -680,7 +622,7 @@
|
||||
android:label="@string/bill_noble_open"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomInviteActivity"
|
||||
android:name=".avroom.activity.RoomInviteActivity"
|
||||
android:label="抱人上麦用户列表"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
@@ -709,7 +651,6 @@
|
||||
android:name="com.nnbc123.app.decoration.view.MyDecorationActivity"
|
||||
android:label="座驾"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.decoration.view.DecorationStoreActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -829,14 +770,12 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.treasure_box.activity.TreasureBoxActivity"
|
||||
android:theme="@style/dialog_web_view_activity_dim_false" />
|
||||
|
||||
<activity android:name="com.nnbc123.app.ui.setting.VerifyPhoneActivity" />
|
||||
<activity android:name="com.nnbc123.app.ui.setting.ModifyPwdActivity" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.widget.LevelUpDialog"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity android:name="com.nnbc123.app.home.activity.NewUserListActivity" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.widget.RecallDialog"
|
||||
@@ -854,10 +793,10 @@
|
||||
android:label="公聊大厅选择提醒的人"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomRankListActivity"
|
||||
android:name=".avroom.activity.RoomRankListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomOnlineUserActivity"
|
||||
android:name=".avroom.activity.RoomOnlineUserActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.public_chat_hall.activity.PublicChatHallRelatedToMeActivity"
|
||||
@@ -871,15 +810,15 @@
|
||||
android:name="com.nnbc123.app.ui.login.ShowBindPhoneActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RoomTitleEditActivity"
|
||||
android:name=".avroom.activity.RoomTitleEditActivity"
|
||||
android:label="@string/title_room_title_edit"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.CreatePKActivity"
|
||||
android:name=".avroom.activity.CreatePKActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.RecordForPKActivity"
|
||||
android:name=".avroom.activity.RecordForPKActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 模厅 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.module_hall.hall.activity.ModuleHallActivity"
|
||||
@@ -933,7 +872,7 @@
|
||||
android:name="com.nnbc123.app.module_hall.hall.activity.MemberSearchActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.CpRoomInviteActivity"
|
||||
android:name=".avroom.activity.CpRoomInviteActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.module_hall.hall.activity.HallSearchActivity"
|
||||
@@ -955,8 +894,7 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.recommendcard.MyRecommendCardActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<!-- 房间内私聊 -->
|
||||
android:screenOrientation="portrait" /> <!-- 房间内私聊 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.room_chat.activity.NimRoomP2PMessageActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
@@ -1025,17 +963,14 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.miniworld.activity.MiniWorldMemberListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.miniworld.activity.MiniWorldTeamMessageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.miniworld.activity.MWTeamRoomMessageAct"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/room_message_activity" /> <!-- 房间内私聊 -->
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.miniworld.activity.MiniWorldGroupThemeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -1050,161 +985,121 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.miniworld.activity.MiniWorldMainActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 银行卡列表 -->
|
||||
android:screenOrientation="portrait" /> <!-- 银行卡列表 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.bank_card.activity.BankCardListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<!-- 解除绑定银行卡 -->
|
||||
android:screenOrientation="portrait" /> <!-- 解除绑定银行卡 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.bank_card.activity.BankCardListUnbindActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<!-- 绑定银行卡 -->
|
||||
android:screenOrientation="portrait" /> <!-- 绑定银行卡 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.bank_card.activity.BankCardBindActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<!-- 隐私政策 -->
|
||||
android:screenOrientation="portrait" /> <!-- 隐私政策 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.bank_card.activity.AddBankCardAgreementActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.tongdaxing.erban.sadmin.RoomSAdminManagerActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.home.activity.CommunityNoticeAct"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 社区 -->
|
||||
android:screenOrientation="portrait" /> <!-- 社区 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.community.publish.view.PublishActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustNothing" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.community.dynamic.view.DynamicDetailActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.community.photo.PreviewPhotoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.community.photo.BigPhotoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 知乎相册 -->
|
||||
android:screenOrientation="portrait" /> <!-- 知乎相册 -->
|
||||
<activity
|
||||
android:name="com.zhihu.matisse.ui.MatisseActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.zhihu.matisse.internal.ui.AlbumPreviewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.zhihu.matisse.internal.ui.SelectedPreviewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.wallet.sendgold.SendGoldActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<!-- 隐私设置 -->
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- 隐私设置 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.setting.PrivacySettingActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 通知提醒设置 -->
|
||||
android:screenOrientation="portrait" /> <!-- 通知提醒设置 -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.setting.NoticeSettingActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.quick_pass.QuickPassLoginAct"
|
||||
android:label="一键登录"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.webview.DialogWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.webview.RadishDialogWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.webview.DatingRuleWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.webview.TarotPayWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
<!-- Fix bug Only fullscreen opaque activities can request orientation -->
|
||||
android:theme="@style/dialog_web_view_activity" /> <!-- Fix bug Only fullscreen opaque activities can request orientation -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.login.LoginPasswordActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.setting.ResetPasswordActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.module_hall.hall.activity.SuperAdminManageActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.module_hall.hall.activity.SuperAdminAddActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity android:name="com.nnbc123.app.module_hall.hall.activity.SuperAdminRoomSetActivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.anotherroompk.RoomPKCreateActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.anotherroompk.RoomPKSearchActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.singleroompk.SingleRoomPKCreateActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.singleroompk.SingleRoomPKSearchActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.firstcharge.FirstChargeDialog"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.setting.GrantedPermissionsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.ui.setting.PermissionGuideActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.vip.VipMainActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.vip.VipSettingActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!--com.moshen.core.skill-->
|
||||
android:screenOrientation="portrait" /> <!-- com.moshen.core.skill -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.skill.activity.AddSkillActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -1214,7 +1109,6 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.skill.activity.EditSkillActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.home.activity.VisitorListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -1223,73 +1117,60 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.skill.activity.SkillDetailActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!--CP-->
|
||||
android:screenOrientation="portrait" /> <!-- CP -->
|
||||
<activity
|
||||
android:name="com.nnbc123.app.relation.cp.activity.CpTaskActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.relation.cp.activity.CpHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.relation.cp.activity.CpInviteRecordActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.fansteam.FansTeamJoinActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.fansteam.FansTeamJoinedActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.fansteam.FansTeamListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.newuserchargegift.NewUserChargeGiftDialog"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.shipantics.PullRadishActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.shipantics.RadishRankingActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.home.activity.MoreRoomActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.wishlist.WishListCreateActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.activity.PrivilegeCardActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.nnbc123.app.avroom.wishlist.history.WishListHistoryActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.nnbc123.app.vip.VipRankActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<service android:name="com.tongdaxing.erban.upgrade.service.DownloadService" />
|
||||
|
||||
|
||||
<provider
|
||||
android:name="com.tongdaxing.erban.upgrade.config.AppUpdateFileProvider"
|
||||
android:authorities="${applicationId}.fileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/app_update_file" />
|
||||
|
||||
</provider>
|
||||
|
||||
<activity
|
||||
@@ -1298,7 +1179,6 @@
|
||||
<activity
|
||||
android:name="com.nnbc123.app.home.activity.RelationListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.darsh.multipleimageselect.activities.AlbumSelectActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
@@ -1319,14 +1199,12 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.yalantis.ucrop.UCropActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppThemeUCrop" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
25
app/src/main/java/com/nnbc123/app/adapter/CommonVPAdapter.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.nnbc123.app.adapter
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
|
||||
/**
|
||||
* ViewPager2适配器
|
||||
* Created by wushaocheng on 2022/12/07.
|
||||
*/
|
||||
class CommonVPAdapter(
|
||||
fm: FragmentManager,
|
||||
lifecycle: Lifecycle,
|
||||
private val fragmentList: List<Fragment>
|
||||
) : FragmentStateAdapter(fm, lifecycle) {
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return fragmentList.size
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return fragmentList[position]
|
||||
}
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package com.nnbc123.app.avroom
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.nnbc123.app.base.BaseViewModel
|
||||
import com.nnbc123.core.manager.AvRoomDataManager
|
||||
import com.nnbc123.core.privilege.bean.PrivilegeCardInfo
|
||||
import com.nnbc123.core.privilege.model.PrivilegeModel
|
||||
|
||||
class PrivilegeViewModel : BaseViewModel() {
|
||||
|
||||
private val _privilegeCardListLiveData = MutableLiveData<List<PrivilegeCardInfo>>()
|
||||
val privilegeCardListLiveData: LiveData<List<PrivilegeCardInfo>> = _privilegeCardListLiveData
|
||||
|
||||
private val _savePrivilegeCardLiveData = MutableLiveData<String>()
|
||||
val savePrivilegeCardLiveData: LiveData<String> = _savePrivilegeCardLiveData
|
||||
|
||||
private val _deletePrivilegeCardLiveData = MutableLiveData<String>()
|
||||
val deletePrivilegeCardLiveData: LiveData<String> = _deletePrivilegeCardLiveData
|
||||
|
||||
fun getPrivilegeCardList(cardStatus: String) {
|
||||
safeLaunch(
|
||||
block = {
|
||||
_privilegeCardListLiveData.value = PrivilegeModel.getPrivilegeCardList(
|
||||
cardStatus,
|
||||
AvRoomDataManager.get().roomUid.toString()
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun savePrivilegeCard(
|
||||
cardName: String,
|
||||
dailyNum: Int,
|
||||
description: String,
|
||||
effectDay: Int,
|
||||
erbanNoStr: String,
|
||||
cardUrl: String
|
||||
) {
|
||||
safeLaunch(
|
||||
block = {
|
||||
_savePrivilegeCardLiveData.value = PrivilegeModel.savePrivilegeCard(
|
||||
cardName,
|
||||
dailyNum,
|
||||
description,
|
||||
effectDay,
|
||||
erbanNoStr,
|
||||
cardUrl,
|
||||
AvRoomDataManager.get().roomUid.toString()
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun deletePrivilegeCard(id: Int) {
|
||||
safeLaunch(
|
||||
block = {
|
||||
_deletePrivilegeCardLiveData.value = PrivilegeModel.deletePrivilegeCard(id)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,127 @@
|
||||
package com.nnbc123.app.avroom.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.adapter.CommonVPAdapter
|
||||
import com.nnbc123.app.avroom.dialog.CreatePrivilegeCardDialog
|
||||
import com.nnbc123.app.avroom.fragment.PrivilegeCardFragment
|
||||
import com.nnbc123.app.base.BaseViewBindingActivity
|
||||
import com.nnbc123.app.common.widget.OriginalDrawStatusClickSpan
|
||||
import com.nnbc123.app.databinding.ActivityPrivilegeBinding
|
||||
import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.nnbc123.core.UriProvider
|
||||
import com.nnbc123.library.annatation.ActLayoutRes
|
||||
|
||||
/**
|
||||
* @author wushaocheng
|
||||
* @Description 特权卡
|
||||
* @Date 2023/07/21
|
||||
*/
|
||||
@ActLayoutRes(R.layout.activity_privilege)
|
||||
class PrivilegeCardActivity : BaseViewBindingActivity<ActivityPrivilegeBinding>() {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, PrivilegeCardActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
initTitleBar(getString(R.string.privilege_card))
|
||||
initProtocol()
|
||||
initViewPager()
|
||||
|
||||
binding.tvNewCreate.setOnClickListener {
|
||||
CreatePrivilegeCardDialog.newInstance().show(this)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initProtocol() {
|
||||
val privilegeCardTip = getString(R.string.privilege_card_detail)
|
||||
val privilegeCardDescTip = getString(R.string.Read_and_agree_to_the_privilege_card, privilegeCardTip)
|
||||
val ss = SpannableString(privilegeCardDescTip)
|
||||
val privilegeCardTipIndex = privilegeCardDescTip.indexOf(privilegeCardTip)
|
||||
|
||||
ss.setSpan(
|
||||
object : OriginalDrawStatusClickSpan(
|
||||
ContextCompat.getColor(
|
||||
context,
|
||||
R.color.text_normal_282828
|
||||
)
|
||||
) {
|
||||
override fun onClick(widget: View) {
|
||||
if (widget is TextView) widget.highlightColor =
|
||||
ContextCompat.getColor(this@PrivilegeCardActivity, android.R.color.transparent)
|
||||
CommonWebViewActivity.start(context, UriProvider.getPrivilegeInstructions())
|
||||
}
|
||||
},
|
||||
privilegeCardTipIndex,
|
||||
privilegeCardTipIndex + privilegeCardTip.length,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
|
||||
binding.tvProtocol.text = ss
|
||||
binding.tvProtocol.highlightColor = Color.TRANSPARENT
|
||||
binding.tvProtocol.movementMethod = LinkMovementMethod()
|
||||
}
|
||||
|
||||
private fun initViewPager() {
|
||||
val fragmentList: MutableList<Fragment> = ArrayList(5)
|
||||
fragmentList.add(PrivilegeCardFragment.newInstance(""))
|
||||
fragmentList.add(PrivilegeCardFragment.newInstance("2"))
|
||||
fragmentList.add(PrivilegeCardFragment.newInstance("0"))
|
||||
fragmentList.add(PrivilegeCardFragment.newInstance("3"))
|
||||
fragmentList.add(PrivilegeCardFragment.newInstance("1"))
|
||||
|
||||
val tagList: MutableList<String> = ArrayList(5)
|
||||
tagList.add(getString(R.string.all))
|
||||
tagList.add(getString(R.string.not_pass))
|
||||
tagList.add(getString(R.string.under_review))
|
||||
tagList.add(getString(R.string.have_expired))
|
||||
tagList.add(getString(R.string.In_effect))
|
||||
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0f)
|
||||
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
|
||||
magicIndicatorAdapter.setOnItemSelectListener { position: Int, _: TextView? ->
|
||||
binding.viewPager.currentItem = position
|
||||
}
|
||||
magicIndicatorAdapter.textSize = 16
|
||||
magicIndicatorAdapter.minScale = 0.875f
|
||||
magicIndicatorAdapter.selectedColor = ContextCompat.getColor(this, R.color.color_2B2D33)
|
||||
magicIndicatorAdapter.normalColor = ContextCompat.getColor(this, R.color.color_A2A7B8)
|
||||
magicIndicatorAdapter.setResId(R.drawable.ic_home_indicator_center)
|
||||
commonNavigator.setTitleWrapContent(true)
|
||||
commonNavigator.adapter = magicIndicatorAdapter
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
commonNavigator.titleContainer.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||
binding.viewPager.adapter = CommonVPAdapter(supportFragmentManager, lifecycle, fragmentList)
|
||||
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar() = true
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
package com.nnbc123.app.avroom.adapter
|
||||
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.Group
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.nnbc123.core.privilege.bean.PrivilegeCardInfo
|
||||
|
||||
/**
|
||||
* 特权卡
|
||||
*/
|
||||
class PrivilegeCardAdapter :
|
||||
BaseQuickAdapter<PrivilegeCardInfo, BaseViewHolder>(R.layout.item_privilege_card) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: PrivilegeCardInfo) {
|
||||
when (item.cardStatus) {
|
||||
0 -> {
|
||||
helper.setText(R.id.tvStatus, "审核中")
|
||||
helper.getView<AppCompatTextView>(R.id.tvStatus)
|
||||
.setBackgroundResource(R.drawable.ic_under_review)
|
||||
}
|
||||
1 -> {
|
||||
helper.setText(R.id.tvStatus, "生效中")
|
||||
helper.getView<AppCompatTextView>(R.id.tvStatus)
|
||||
.setBackgroundResource(R.drawable.ic_effect)
|
||||
}
|
||||
2 -> {
|
||||
helper.setText(R.id.tvStatus, "未通过")
|
||||
helper.getView<AppCompatTextView>(R.id.tvStatus)
|
||||
.setBackgroundResource(R.drawable.ic_no_pass)
|
||||
}
|
||||
3 -> {
|
||||
helper.setText(R.id.tvStatus, "已过期")
|
||||
helper.getView<AppCompatTextView>(R.id.tvStatus)
|
||||
.setBackgroundResource(R.drawable.ic_past)
|
||||
}
|
||||
}
|
||||
if (item.cardStatus == 3) {
|
||||
helper.getView<AppCompatImageView>(R.id.ivDelete).visibility = View.VISIBLE
|
||||
} else {
|
||||
helper.getView<AppCompatImageView>(R.id.ivDelete).visibility = View.GONE
|
||||
}
|
||||
if (item.cardStatus == 2) {
|
||||
helper.getView<Group>(R.id.group).visibility = View.VISIBLE
|
||||
} else {
|
||||
helper.getView<Group>(R.id.group).visibility = View.GONE
|
||||
}
|
||||
if (item.cardStatus == 1 || item.cardStatus == 3) {
|
||||
helper.getView<AppCompatTextView>(R.id.tvPeriod).visibility = View.VISIBLE
|
||||
helper.setText(R.id.tvPeriod, "有效期:${item.effectTime}至${item.expireTime}")
|
||||
} else {
|
||||
helper.getView<AppCompatTextView>(R.id.tvPeriod).visibility = View.GONE
|
||||
}
|
||||
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.ivCardBg), item.cardUrl)
|
||||
helper.setText(R.id.tvTime, "${item.dailyNum}次")
|
||||
.setText(R.id.tv_name, item.cardName)
|
||||
.setText(R.id.tv_explain, item.description)
|
||||
.setText(R.id.tv_user_id, item.erbanNoStr)
|
||||
|
||||
helper.addOnClickListener(R.id.tvCause, R.id.tvEdit, R.id.ivDelete)
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,163 @@
|
||||
package com.nnbc123.app.avroom.dialog
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.nnbc123.app.ErbanTakePhotoActivity
|
||||
import com.nnbc123.app.ErbanTakePhotoActivity.TakePhotoCallBack
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.PrivilegeViewModel
|
||||
import com.nnbc123.app.avroom.event.PrivilegeCardEvent
|
||||
import com.nnbc123.app.base.BaseDialog
|
||||
import com.nnbc123.app.databinding.DialogCreatePrivilegeCardBinding
|
||||
import com.nnbc123.app.takephoto.model.TResult
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.nnbc123.core.file.FileModel
|
||||
import com.nnbc123.core.privilege.bean.PrivilegeCardInfo
|
||||
import com.nnbc123.core.utils.TextUtils
|
||||
import com.nnbc123.library.utils.SingleToastUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
/**
|
||||
* @author wushaocheng
|
||||
* @Description 创建特权卡
|
||||
* @Date 2023/07/21
|
||||
*/
|
||||
class CreatePrivilegeCardDialog : BaseDialog<DialogCreatePrivilegeCardBinding>(),
|
||||
TakePhotoCallBack {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(): CreatePrivilegeCardDialog {
|
||||
return CreatePrivilegeCardDialog()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(privilegeCardInfo: PrivilegeCardInfo): CreatePrivilegeCardDialog {
|
||||
val args = Bundle()
|
||||
args.putSerializable("PrivilegeCardInfo", privilegeCardInfo)
|
||||
val fragment = CreatePrivilegeCardDialog()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
private var privilegeCardInfo: PrivilegeCardInfo? = null
|
||||
|
||||
private var saveTipDialog: CommonTipDialog? = null
|
||||
|
||||
private var url = ""
|
||||
|
||||
private val privilegeViewModel: PrivilegeViewModel by viewModels()
|
||||
|
||||
override fun onStart() {
|
||||
gravity = Gravity.CENTER
|
||||
super.onStart()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
privilegeCardInfo = arguments?.getSerializable("PrivilegeCardInfo") as? PrivilegeCardInfo
|
||||
|
||||
privilegeCardInfo?.let {
|
||||
binding.edName.setText(it.cardName)
|
||||
binding.edUseNumber.setText(it.dailyNum.toString())
|
||||
binding.edExplain.setText(it.description)
|
||||
binding.edValid.setText(it.effectDay.toString())
|
||||
binding.edId.setText(it.erbanNoStr)
|
||||
ImageLoadUtilsV2.loadImage(binding.ivPic, it.cardUrl)
|
||||
}
|
||||
|
||||
binding.ivPic.setOnClickListener {
|
||||
ErbanTakePhotoActivity.startToSelectPhoto(context, this)
|
||||
}
|
||||
binding.tvCancel.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.tvConfirm.setOnClickListener {
|
||||
if (checkEmpty()) {
|
||||
SingleToastUtil.showToast("请填写完整信息")
|
||||
} else {
|
||||
showTip()
|
||||
}
|
||||
}
|
||||
|
||||
privilegeViewModel.savePrivilegeCardLiveData.observe(viewLifecycleOwner) {
|
||||
SingleToastUtil.showToast("提交成功")
|
||||
EventBus.getDefault().post(PrivilegeCardEvent())
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showTip() {
|
||||
if (saveTipDialog == null) {
|
||||
saveTipDialog = CommonTipDialog(context)
|
||||
saveTipDialog?.setTipMsg("确认卡片信息填写是否正确\n审核通过后卡片将生效")
|
||||
saveTipDialog?.setOnActionListener(object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
privilegeViewModel.savePrivilegeCard(
|
||||
binding.edName.text.toString(),
|
||||
binding.edUseNumber.text.toString().toInt(),
|
||||
binding.edExplain.text.toString(),
|
||||
binding.edValid.text.toString().toInt(),
|
||||
binding.edId.text.toString(),
|
||||
url
|
||||
)
|
||||
saveTipDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
saveTipDialog?.dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
if (saveTipDialog?.isShowing == true) {
|
||||
saveTipDialog?.dismiss()
|
||||
}
|
||||
saveTipDialog?.show()
|
||||
}
|
||||
|
||||
private fun checkEmpty(): Boolean {
|
||||
return (TextUtils.isEmptyText(binding.edName.text.toString()) || TextUtils.isEmptyText(
|
||||
binding.edUseNumber.text.toString()
|
||||
) || TextUtils.isEmptyText(binding.edValid.text.toString()) || TextUtils.isEmptyText(binding.edId.text.toString()) || TextUtils.isEmptyText(
|
||||
url
|
||||
))
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun takeSuccess(result: TResult?) {
|
||||
FileModel.get()
|
||||
.uploadFile(result?.image?.compressPath)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe { url: String?, throwable: Throwable? ->
|
||||
if (throwable != null) {
|
||||
SingleToastUtil.showToast("上传失败")
|
||||
} else {
|
||||
ImageLoadUtils.loadRectImage(
|
||||
context,
|
||||
url,
|
||||
binding.ivPic,
|
||||
R.drawable.default_cover,
|
||||
ScreenUtil.dip2px(10f)
|
||||
)
|
||||
if (url != null) {
|
||||
this.url = url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun takeFail(result: TResult?, msg: String?) {
|
||||
SingleToastUtil.showToast(msg)
|
||||
}
|
||||
|
||||
override fun takeCancel() {
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -16,6 +16,20 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.CreatePKActivity;
|
||||
import com.nnbc123.app.avroom.activity.PrivilegeCardActivity;
|
||||
import com.nnbc123.app.avroom.activity.RoomSettingActivity;
|
||||
import com.nnbc123.app.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.nnbc123.app.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.nnbc123.app.avroom.singleroompk.SingleRoomPkSelectTypeDialog;
|
||||
import com.nnbc123.app.avroom.wishlist.WishListCreateActivity;
|
||||
import com.nnbc123.app.common.widget.dialog.DialogManager;
|
||||
import com.nnbc123.app.room_chat.activity.RoomInviteFansActivity;
|
||||
import com.nnbc123.app.ui.widget.marqueeview.Utils;
|
||||
import com.nnbc123.app.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.nnbc123.app.ui.widget.recyclerview.layoutmanager.FullyGridLayoutManager;
|
||||
import com.nnbc123.app.vip.VipBroadcastDialog;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.im.custom.bean.RoomPkBean;
|
||||
import com.nnbc123.core.manager.AudioEngineManager;
|
||||
@@ -36,19 +50,6 @@ import com.nnbc123.core.super_admin.util.SuperAdminUtil;
|
||||
import com.nnbc123.core.utils.CurrentTimeUtils;
|
||||
import com.nnbc123.core.utils.net.DontWarnObserver;
|
||||
import com.nnbc123.core.utils.net.RxHelper;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.CreatePKActivity;
|
||||
import com.nnbc123.app.avroom.activity.RoomSettingActivity;
|
||||
import com.nnbc123.app.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.nnbc123.app.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.nnbc123.app.avroom.singleroompk.SingleRoomPkSelectTypeDialog;
|
||||
import com.nnbc123.app.avroom.wishlist.WishListCreateActivity;
|
||||
import com.nnbc123.app.common.widget.dialog.DialogManager;
|
||||
import com.nnbc123.app.room_chat.activity.RoomInviteFansActivity;
|
||||
import com.nnbc123.app.ui.widget.marqueeview.Utils;
|
||||
import com.nnbc123.app.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.nnbc123.app.ui.widget.recyclerview.layoutmanager.FullyGridLayoutManager;
|
||||
import com.nnbc123.app.vip.VipBroadcastDialog;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.tongdaxing.erban.sadmin.RoomSAdminManagerActivity;
|
||||
|
||||
@@ -113,6 +114,9 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
optAdapter = new OptAdapter(context, null);
|
||||
addDatingAction(optAdapter);
|
||||
addWishListAction(optAdapter);
|
||||
if (AvRoomDataManager.get().isHasPrivilegeCardPermit()) {
|
||||
addPrivilegeCardAction(optAdapter);
|
||||
}
|
||||
addPKAction(optAdapter);
|
||||
addRoomPKAction(optAdapter);
|
||||
addSingleRoomPKAction(optAdapter);
|
||||
@@ -684,7 +688,24 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
|
||||
/**
|
||||
* 超管管理
|
||||
* 特权卡
|
||||
*/
|
||||
private void addPrivilegeCardAction(OptAdapter optAdapter) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_privilege_card,
|
||||
"特权卡",
|
||||
() -> {
|
||||
PrivilegeCardActivity.start(context);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布广播
|
||||
*/
|
||||
private void addSendBroadcastAction(OptAdapter optAdapter) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -711,7 +732,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
|
||||
/**
|
||||
* 超管管理
|
||||
* 房间小喇叭
|
||||
*/
|
||||
private void addVipSendBroadcastAction(OptAdapter optAdapter) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
|
@@ -0,0 +1,8 @@
|
||||
package com.nnbc123.app.avroom.event;
|
||||
|
||||
/**
|
||||
* 特权卡
|
||||
*/
|
||||
public class PrivilegeCardEvent {
|
||||
|
||||
}
|
@@ -0,0 +1,164 @@
|
||||
package com.nnbc123.app.avroom.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.PrivilegeViewModel
|
||||
import com.nnbc123.app.avroom.adapter.PrivilegeCardAdapter
|
||||
import com.nnbc123.app.avroom.dialog.CreatePrivilegeCardDialog
|
||||
import com.nnbc123.app.avroom.event.PrivilegeCardEvent
|
||||
import com.nnbc123.app.base.BaseViewBindingFragment
|
||||
import com.nnbc123.app.common.EmptyViewHelper
|
||||
import com.nnbc123.app.databinding.FragmentPrivilegeCardBinding
|
||||
import com.nnbc123.app.ui.utils.RVDelegate
|
||||
import com.nnbc123.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.nnbc123.core.privilege.bean.PrivilegeCardInfo
|
||||
import com.nnbc123.core.utils.TextUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* @author wushaocheng
|
||||
* @Description 特权卡
|
||||
* @Date 2023/07/21
|
||||
*/
|
||||
class PrivilegeCardFragment : BaseViewBindingFragment<FragmentPrivilegeCardBinding>() {
|
||||
|
||||
private var type = ""
|
||||
|
||||
private var isNeedLoad = false
|
||||
|
||||
private var deleteTipDialog: CommonTipDialog? = null
|
||||
|
||||
private var failureTipDialog: CommonTipDialog? = null
|
||||
|
||||
companion object {
|
||||
private const val TYPE = "type"
|
||||
fun newInstance(type: String): PrivilegeCardFragment {
|
||||
val args = Bundle()
|
||||
args.putString(TYPE, type)
|
||||
val fragment = PrivilegeCardFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var mAdapter: PrivilegeCardAdapter
|
||||
private lateinit var rvDelegate: RVDelegate<PrivilegeCardInfo>
|
||||
|
||||
private var privilegeViewModel: PrivilegeViewModel? = null
|
||||
|
||||
override fun init() {
|
||||
EventBus.getDefault().register(this)
|
||||
|
||||
val privilegeViewModel: PrivilegeViewModel by viewModels()
|
||||
this.privilegeViewModel = privilegeViewModel
|
||||
type = arguments?.getString(TYPE, "").toString()
|
||||
|
||||
mAdapter = PrivilegeCardAdapter()
|
||||
rvDelegate = RVDelegate.Builder<PrivilegeCardInfo>()
|
||||
.setAdapter(mAdapter)
|
||||
.setLayoutManager(LinearLayoutManager(mContext))
|
||||
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无特权卡"))
|
||||
.setRefreshLayout(binding.refreshLayout)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
binding.refreshLayout.setOnRefreshListener {
|
||||
loadData(true)
|
||||
}
|
||||
privilegeViewModel.privilegeCardListLiveData.observe(this) {
|
||||
rvDelegate.setNewData(it)
|
||||
}
|
||||
|
||||
privilegeViewModel.deletePrivilegeCardLiveData.observe(this) {
|
||||
loadData(true)
|
||||
}
|
||||
|
||||
mAdapter.setOnItemChildClickListener { adapter, view, position ->
|
||||
when (view.id) {
|
||||
R.id.ivDelete -> {
|
||||
mAdapter.getItem(position)?.id?.let { showDeleteDialog(it) }
|
||||
}
|
||||
R.id.tvCause -> {
|
||||
mAdapter.getItem(position)?.checkReason?.let { showFailureDialog(it) }
|
||||
}
|
||||
R.id.tvEdit -> {
|
||||
mAdapter.getItem(position)?.let { CreatePrivilegeCardDialog.newInstance(it).show(context) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDeleteDialog(id: Int) {
|
||||
if (deleteTipDialog == null) {
|
||||
deleteTipDialog = CommonTipDialog(context)
|
||||
deleteTipDialog?.setTipMsg("确认将【女神卡】删除吗")
|
||||
deleteTipDialog?.setOnActionListener(object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
privilegeViewModel?.deletePrivilegeCard(id)
|
||||
deleteTipDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
deleteTipDialog?.dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
if (deleteTipDialog?.isShowing == true) {
|
||||
deleteTipDialog?.dismiss()
|
||||
}
|
||||
deleteTipDialog?.show()
|
||||
}
|
||||
|
||||
private fun showFailureDialog(message: String) {
|
||||
if (failureTipDialog == null) {
|
||||
failureTipDialog = CommonTipDialog(context)
|
||||
failureTipDialog?.setTitleMsg("审核不通过原因")
|
||||
failureTipDialog?.setTipMsg(message)
|
||||
failureTipDialog?.setOkText("知道了")
|
||||
failureTipDialog?.setTextCancelShow(false)
|
||||
failureTipDialog?.setOnActionListener(object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
failureTipDialog?.dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
if (failureTipDialog?.isShowing == true) {
|
||||
failureTipDialog?.dismiss()
|
||||
}
|
||||
failureTipDialog?.show()
|
||||
}
|
||||
|
||||
override fun onLazyLoad() {
|
||||
super.onLazyLoad()
|
||||
loadData(true)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun loadData(isRefresh: Boolean) {
|
||||
binding.refreshLayout.isRefreshing = isRefresh
|
||||
privilegeViewModel?.getPrivilegeCardList(type)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if(isNeedLoad && (TextUtils.isEmptyText(type) || type == "0")){
|
||||
loadData(true)
|
||||
isNeedLoad = false
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun privilegeCardEvent(event: PrivilegeCardEvent?) {
|
||||
isNeedLoad = true
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
}
|
@@ -766,7 +766,6 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
return AvRoomDataManager.get().isOpenGame() && roomInfo != null && roomInfo.getMgMicNum() > 6;
|
||||
}
|
||||
|
||||
|
||||
private Path getBezierCurvePath(Point sendPoint, Point receivePoint, boolean center) {
|
||||
Point endPoint = new Point(receivePoint.x - sendPoint.x, receivePoint.y - sendPoint.y);
|
||||
Point control = new Point(endPoint.x / 2, -(sendPoint.y + receivePoint.y) / 2 - new Random().nextInt(200));
|
||||
|
@@ -54,6 +54,8 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
|
||||
protected boolean mIsViewCreated;
|
||||
protected RxPermissions rxPermissions;
|
||||
|
||||
private boolean isLoaded = false;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -87,6 +89,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
|
||||
public void onDestroyView() {
|
||||
mIsViewCreated = false;
|
||||
isDestroyView = true;
|
||||
isLoaded = false;
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@@ -140,6 +143,22 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
|
||||
getFragmentManager().addOnBackStackChangedListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!isLoaded && !isHidden()) {
|
||||
onLazyLoad();
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写该方法可实现懒加载数据,即当前Fragment第一次可见时才会执行一次,不同与setView()方法和onResume()方法
|
||||
*/
|
||||
protected void onLazyLoad() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
@@ -19,6 +19,8 @@ public class MainMagicIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
|
||||
private int textSize = 24;
|
||||
private float minScale = 1f;
|
||||
protected int mNormalColor = 0xFF878B9C;
|
||||
protected int mSelectedColor = 0xFF282828;
|
||||
private boolean showIndicator = true;
|
||||
private int resId = R.drawable.ic_home_indicator_center;
|
||||
|
||||
@@ -36,8 +38,8 @@ public class MainMagicIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||
scaleTransitionPagerTitleView.setNormalColor(0xFF878B9C);
|
||||
scaleTransitionPagerTitleView.setSelectedColor(0xFF282828);
|
||||
scaleTransitionPagerTitleView.setNormalColor(mNormalColor);
|
||||
scaleTransitionPagerTitleView.setSelectedColor(mSelectedColor);
|
||||
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||
int padding = UIUtil.dip2px(context, 5);
|
||||
@@ -79,6 +81,22 @@ public class MainMagicIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
this.minScale = minScale;
|
||||
}
|
||||
|
||||
public int getSelectedColor() {
|
||||
return mSelectedColor;
|
||||
}
|
||||
|
||||
public void setSelectedColor(int selectedColor) {
|
||||
mSelectedColor = selectedColor;
|
||||
}
|
||||
|
||||
public int getNormalColor() {
|
||||
return mNormalColor;
|
||||
}
|
||||
|
||||
public void setNormalColor(int normalColor) {
|
||||
mNormalColor = normalColor;
|
||||
}
|
||||
|
||||
public boolean isShowIndicator() {
|
||||
return showIndicator;
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ import com.nnbc123.app.family.view.activity.FamilyHomeActivity;
|
||||
import com.nnbc123.app.family.view.activity.FamilyMemberListActivity;
|
||||
import com.nnbc123.app.family.view.activity.FamilyMemberSearchActivity;
|
||||
import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.nnbc123.app.relation.cp.fragment.UserInfoCpFragment;
|
||||
import com.nnbc123.app.ui.im.avtivity.NimFriendModel;
|
||||
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.nnbc123.app.ui.user.adapter.SelfPhotoAdapter;
|
||||
@@ -231,15 +230,13 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void initViewPager() {
|
||||
List<Fragment> fragmentList = new ArrayList<>(3);
|
||||
List<Fragment> fragmentList = new ArrayList<>(2);
|
||||
fragmentList.add(new UserInfoInfoFragment());
|
||||
fragmentList.add(new UserInfoDynamicFragment());
|
||||
fragmentList.add(UserInfoCpFragment.Companion.newInstance(userId));
|
||||
pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
|
||||
final List<String> tagList = new ArrayList<>(3);
|
||||
final List<String> tagList = new ArrayList<>(2);
|
||||
tagList.add("资料");
|
||||
tagList.add("动态");
|
||||
tagList.add("亲密关系");
|
||||
CommonNavigator commonNavigator = new CommonNavigator(context);
|
||||
commonNavigator.setTitleMargin(ScreenUtil.dip2px(6.0F));
|
||||
MainMagicIndicatorAdapter magicIndicatorAdapter = new MainMagicIndicatorAdapter(context, tagList);
|
||||
|
@@ -22,10 +22,14 @@ import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -34,14 +38,39 @@ import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.nnbc123.app.BR;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.nnbc123.app.base.BaseActivity;
|
||||
import com.nnbc123.app.common.widget.CircleImageView;
|
||||
import com.nnbc123.app.ui.gift.dialog.GiftInfoVm;
|
||||
import com.nnbc123.app.ui.pay.ChargeDialog;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtilsV2;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.app.ui.webview.DialogWebViewActivity;
|
||||
import com.nnbc123.app.ui.widget.dialog.GiftManualQuantityDialog;
|
||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftHelper;
|
||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftView;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.GiftIndicator;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.nnbc123.app.utils.RegexUtil;
|
||||
import com.nnbc123.app.utils.SpannableBuilder;
|
||||
import com.nnbc123.app.vip.VipMainActivity;
|
||||
import com.nnbc123.core.DemoCache;
|
||||
import com.nnbc123.core.UriProvider;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.bean.RoomQueueInfo;
|
||||
import com.nnbc123.core.gift.GiftModel;
|
||||
import com.nnbc123.core.gift.bean.GiftInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftPrivilegeInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftTab;
|
||||
import com.nnbc123.core.gift.bean.GiftType;
|
||||
import com.nnbc123.core.gift.bean.LuckyBagNoticeInfo;
|
||||
@@ -63,34 +92,12 @@ import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.user.UserModel;
|
||||
import com.nnbc123.core.user.bean.UserInfo;
|
||||
import com.nnbc123.core.utils.net.RxHelper;
|
||||
import com.nnbc123.app.BR;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.nnbc123.app.base.BaseActivity;
|
||||
import com.nnbc123.app.common.widget.CircleImageView;
|
||||
import com.nnbc123.app.radish.task.activity.TaskCenterActivity;
|
||||
import com.nnbc123.app.ui.gift.dialog.GiftInfoVm;
|
||||
import com.nnbc123.app.ui.pay.ChargeDialog;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.app.ui.webview.DialogWebViewActivity;
|
||||
import com.nnbc123.app.ui.widget.dialog.GiftManualQuantityDialog;
|
||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftHelper;
|
||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftView;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.GiftIndicator;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
|
||||
import com.nnbc123.app.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.nnbc123.app.utils.RegexUtil;
|
||||
import com.nnbc123.app.utils.SpannableBuilder;
|
||||
import com.nnbc123.app.vip.VipMainActivity;
|
||||
import com.nnbc123.library.bindinglist.IItem;
|
||||
import com.nnbc123.library.bindinglist.MultiTypeAdapter;
|
||||
import com.nnbc123.library.utils.FormatUtils;
|
||||
import com.nnbc123.library.utils.ListUtils;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.nnbc123.library.utils.TextWatcherWrapper;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
||||
import com.zyyoona7.lib.EasyPopup;
|
||||
import com.zyyoona7.lib.HorizontalGravity;
|
||||
@@ -134,6 +141,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
* 被选中的uid是否在麦上
|
||||
*/
|
||||
private final boolean userOnMic;
|
||||
private RecyclerView privilegeView;
|
||||
private ViewPager gridView;
|
||||
private RecyclerView avatarList;
|
||||
private View llAvatarList;
|
||||
@@ -143,6 +151,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
@Nullable
|
||||
private GiftInfo currentGiftInfo;
|
||||
private List<GiftInfo> currentGiftInfoList;
|
||||
private List<GiftPrivilegeInfo> currentGiftPrivilegeInfoList;
|
||||
private OnGiftDialogBtnClickListener giftDialogBtnClickListener;
|
||||
private CircleImageView avatarImage;
|
||||
private TextView nickText;
|
||||
@@ -202,6 +211,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private View ivWeekIn;
|
||||
private View llStarWeek;
|
||||
private View rlAvatars;
|
||||
private RelativeLayout layoutRecharge;
|
||||
private ConstraintLayout csPrivilege;
|
||||
private AppCompatTextView tvNum;
|
||||
private SuperTextView tvPrivilegeGive;
|
||||
|
||||
private int mPrivilegePosition = 0;
|
||||
|
||||
public GiftDialog(Context context, int giftId) {
|
||||
this(context, 0, true, false, true, giftId);
|
||||
@@ -418,6 +433,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_SING_ROOM, "人气", "人气"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_DRAW_GIFT, "涂鸦礼物", "涂鸦礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_PENALTY, "惩罚礼物", "惩罚礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_PRIVILEGE, "特权卡", "特权卡"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包"));
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
@@ -450,6 +466,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tvRecharge = findViewById(R.id.tv_recharge);
|
||||
tvTextGold.setSelected(true);
|
||||
|
||||
privilegeView = findViewById(R.id.privilegeView);
|
||||
layoutRecharge = findViewById(R.id.layout_recharge);
|
||||
csPrivilege = findViewById(R.id.cs_privilege);
|
||||
tvNum = findViewById(R.id.tv_num);
|
||||
tvPrivilegeGive = findViewById(R.id.tv_privilege_give);
|
||||
|
||||
ivWeekStarIcon = findViewById(R.id.iv_week_star_icon);
|
||||
ivAvatarCharm = findViewById(R.id.iv_avatar_charm);
|
||||
tvWeekStarDesc = findViewById(R.id.tv_week_star_desc);
|
||||
@@ -546,7 +568,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
});
|
||||
|
||||
//更新背包礼物
|
||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos().subscribe());
|
||||
//更新特权卡礼物
|
||||
compositeDisposable.add(GiftModel.get().requestPrivilegeGiftInfos().subscribe());
|
||||
initVipPager();
|
||||
viewNewFeature = findViewById(R.id.view_new_feature);
|
||||
if (DemoCache.readNewGiftTypeTipIndicator()) {
|
||||
@@ -642,7 +667,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
showDataView();
|
||||
// 获得对应的普通礼物/贵族礼物/背包礼物
|
||||
List<GiftInfo> nobleGiftInfos = getNobleGiftInfos();
|
||||
if (position == GiftIndicator.TYPE_KNAP) {
|
||||
if (position == GiftIndicator.TYPE_PRIVILEGE) {
|
||||
currentGiftInfoList = null;
|
||||
currentGiftPrivilegeInfoList = GiftModel.get().getPrivilegeList();
|
||||
} else if (position == GiftIndicator.TYPE_KNAP) {
|
||||
currentGiftInfoList = GiftModel.get().getKnapList();
|
||||
} else if (position == GiftIndicator.TYPE_NOBLE) {
|
||||
currentGiftInfoList = nobleGiftInfos;
|
||||
@@ -664,7 +692,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
initEasyPop(isKnap);
|
||||
if (ListUtils.isListEmpty(currentGiftInfoList)) {
|
||||
currentGiftInfo = null;
|
||||
if (isKnap) {
|
||||
if (position == GiftIndicator.TYPE_PRIVILEGE) {
|
||||
showPrivilegeEmptyView();
|
||||
if (!ListUtils.isListEmpty(currentGiftPrivilegeInfoList)) {
|
||||
privilegeView.setVisibility(View.VISIBLE);
|
||||
layoutRecharge.setVisibility(View.INVISIBLE);
|
||||
csPrivilege.setVisibility(View.VISIBLE);
|
||||
showPrivilegeView();
|
||||
}
|
||||
} else if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
showEmptyView();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
@@ -680,6 +716,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
showLoadFailedView();
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
privilegeView.setVisibility(View.GONE);
|
||||
layoutRecharge.setVisibility(View.VISIBLE);
|
||||
csPrivilege.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
currentGiftInfo = selectGiftInfo == null ? currentGiftInfoList.get(0) : selectGiftInfo;
|
||||
if (currentGiftInfo.isSendMsg()) {
|
||||
@@ -701,6 +741,70 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
updateDrawGift();
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示特权卡
|
||||
*/
|
||||
private void showPrivilegeView() {
|
||||
currentGiftPrivilegeInfoList.get(0).setSelected(true);
|
||||
tvNum.setText(String.valueOf(currentGiftPrivilegeInfoList.get(0).getDailyNum()));
|
||||
BaseQuickAdapter<GiftPrivilegeInfo, BaseViewHolder> baseQuickAdapter = new BaseQuickAdapter<>(R.layout.item_gift_privilege, currentGiftPrivilegeInfoList) {
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftPrivilegeInfo item) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
RoundedImageView imageView = helper.getView(R.id.iv_pic);
|
||||
ImageLoadUtilsV2.loadImage(imageView, item.getCardUrl());
|
||||
if (item.isSelected()) {
|
||||
imageView.setBorderColor(ContextCompat.getColor(mContext, R.color.color_FFDA24));
|
||||
imageView.setBorderWidth((float) 2);
|
||||
} else {
|
||||
imageView.setBorderColor(ContextCompat.getColor(mContext, R.color.transparent));
|
||||
imageView.setBorderWidth((float) 0);
|
||||
}
|
||||
helper.setText(R.id.tv_name, item.getCardName());
|
||||
helper.setText(R.id.tv_period_time, "有效期至:" + item.getExpireTime());
|
||||
}
|
||||
};
|
||||
baseQuickAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
int dailyNum = baseQuickAdapter.getItem(position).getDailyNum();
|
||||
tvNum.setText(String.valueOf(dailyNum));
|
||||
GiftPrivilegeInfo giftPrivilegeInfo = baseQuickAdapter.getItem(mPrivilegePosition);
|
||||
if (giftPrivilegeInfo != null) {
|
||||
giftPrivilegeInfo.setSelected(false);
|
||||
}
|
||||
baseQuickAdapter.notifyItemChanged(mPrivilegePosition);
|
||||
GiftPrivilegeInfo bean = baseQuickAdapter.getItem(position);
|
||||
if (bean != null) {
|
||||
bean.setSelected(true);
|
||||
}
|
||||
baseQuickAdapter.notifyItemChanged(position);
|
||||
mPrivilegePosition = position;
|
||||
});
|
||||
privilegeView.setAdapter(baseQuickAdapter);
|
||||
tvPrivilegeGive.setOnClickListener(v -> {
|
||||
if (currentGiftPrivilegeInfoList.get(mPrivilegePosition).getDailyNum() == 0) {
|
||||
SingleToastUtil.showToast("今日次数已用完");
|
||||
} else {
|
||||
compositeDisposable.add(GiftModel.get()
|
||||
.givePrivilegeCard(String.valueOf(baseQuickAdapter.getItem(mPrivilegePosition).getId()),
|
||||
AvRoomDataManager.get().getRoomUid() + "", AuthModel.get().getCurrentUid() + "")
|
||||
.subscribe((listServiceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
GiftPrivilegeInfo giftPrivilegeInfo = currentGiftPrivilegeInfoList.get(mPrivilegePosition);
|
||||
giftPrivilegeInfo.setDailyNum(giftPrivilegeInfo.getDailyNum() - 1);
|
||||
baseQuickAdapter.notifyItemChanged(mPrivilegePosition);
|
||||
tvNum.setText(String.valueOf(giftPrivilegeInfo.getDailyNum()));
|
||||
|
||||
} else {
|
||||
SingleToastUtil.showToast(throwable.getMessage());
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateLuckyBagIntro() {
|
||||
if (luckyMsgDisposable != null) luckyMsgDisposable.dispose();
|
||||
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY) {
|
||||
@@ -881,6 +985,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tvGiftValue.setText(text.build());
|
||||
}
|
||||
|
||||
private void showPrivilegeEmptyView() {
|
||||
//tab对应的礼物列表为空的情况
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
layoutLoadFiled.setVisibility(View.GONE);
|
||||
layoutLoading.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.GONE);
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showEmptyView() {
|
||||
//tab对应的礼物列表为空的情况
|
||||
layoutEmpty.setVisibility(View.VISIBLE);
|
||||
@@ -1413,6 +1526,20 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
})
|
||||
);
|
||||
break;
|
||||
case GiftIndicator.TYPE_PRIVILEGE:
|
||||
compositeDisposable.add(GiftModel.get()
|
||||
.requestPrivilegeGiftInfos()
|
||||
.subscribe((listServiceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
if (currentType == giftIndicator.getCurrrentType()) {
|
||||
updateGiftView(giftIndicator.getCurrrentType());
|
||||
}
|
||||
} else {
|
||||
if (needShowLoading) showLoadFailedView();
|
||||
}
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
@@ -22,9 +23,11 @@ import com.nnbc123.core.utils.TextUtils;
|
||||
*/
|
||||
public class CommonTipDialog extends BaseDialog {
|
||||
private String tipMsg = "";
|
||||
private String titleMsg = "";
|
||||
|
||||
private String okText = "确定";
|
||||
private String cancelText = "取消";
|
||||
private boolean isShowCancel = true;
|
||||
private boolean isBold;
|
||||
private @ColorRes
|
||||
int color = -1;
|
||||
@@ -45,6 +48,14 @@ public class CommonTipDialog extends BaseDialog {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.layout_ok_cancel_dialog);
|
||||
|
||||
TextView title = findViewById(R.id.tv_title);
|
||||
if (TextUtils.isEmptyText(titleMsg)) {
|
||||
title.setVisibility(View.GONE);
|
||||
} else {
|
||||
title.setText(titleMsg);
|
||||
title.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
TextView tip = findViewById(R.id.message);
|
||||
tip.setText(tipMsg);
|
||||
if (color != -1) {
|
||||
@@ -69,13 +80,22 @@ public class CommonTipDialog extends BaseDialog {
|
||||
}
|
||||
});
|
||||
TextView cancel = findViewById(R.id.btn_cancel);
|
||||
cancel.setText(cancelText);
|
||||
cancel.setOnClickListener(v -> {
|
||||
this.dismiss();
|
||||
if (l != null) {
|
||||
l.onCancel();
|
||||
}
|
||||
});
|
||||
if(isShowCancel){
|
||||
cancel.setVisibility(View.VISIBLE);
|
||||
cancel.setText(cancelText);
|
||||
cancel.setOnClickListener(v -> {
|
||||
this.dismiss();
|
||||
if (l != null) {
|
||||
l.onCancel();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cancel.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitleMsg(String titleMsg) {
|
||||
this.titleMsg = titleMsg;
|
||||
}
|
||||
|
||||
public void setTipMsg(String tipMsg) {
|
||||
@@ -94,6 +114,10 @@ public class CommonTipDialog extends BaseDialog {
|
||||
this.textSize = textSize;
|
||||
}
|
||||
|
||||
public void setTextCancelShow(boolean isShowCancel) {
|
||||
this.isShowCancel = isShowCancel;
|
||||
}
|
||||
|
||||
private OnActionListener l;
|
||||
|
||||
public void setOkText(String okText) {
|
||||
|
@@ -72,6 +72,11 @@ public class GiftIndicator extends LinearLayout {
|
||||
*/
|
||||
public static final int TYPE_PENALTY = 7;
|
||||
|
||||
/**
|
||||
* 特权卡
|
||||
*/
|
||||
public static final int TYPE_PRIVILEGE = 8;
|
||||
|
||||
private Map<String, String> map = new HashMap<>();
|
||||
private List<GiftTab> tabList = new ArrayList<>();
|
||||
private int currrentType = TYPE_NORMAL;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.nnbc123.app.ui.widget.magicindicator;
|
||||
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
|
||||
/**
|
||||
@@ -9,6 +10,36 @@ import androidx.viewpager.widget.ViewPager;
|
||||
*/
|
||||
|
||||
public class ViewPagerHelper {
|
||||
|
||||
public static void bind(final MagicIndicator magicIndicator, ViewPager2 viewPager) {
|
||||
if (viewPager == null) {
|
||||
return;
|
||||
}
|
||||
viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
if (magicIndicator != null) {
|
||||
magicIndicator.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (magicIndicator != null) {
|
||||
magicIndicator.onPageSelected(position);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
if (magicIndicator != null) {
|
||||
magicIndicator.onPageScrollStateChanged(state);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void bind(final MagicIndicator magicIndicator, ViewPager viewPager) {
|
||||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
|
||||
@@ -28,4 +59,5 @@ public class ViewPagerHelper {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_effect.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_no_pass.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_past.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_privilege_delete.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_under_review.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_create.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_privilege_pic.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_room_privilege_card.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
@@ -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="#CCffffff" />
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="0dp" />
|
||||
|
||||
</shape>
|
8
app/src/main/res/drawable/bg_f8f8fa_10.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_10"/>
|
||||
<solid android:color="@color/color_F8F8FA"/>
|
||||
|
||||
</shape>
|
8
app/src/main/res/drawable/shape_white_16dp_round.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FFFFFF" />
|
||||
|
||||
<corners android:radius="16dp" />
|
||||
</shape>
|
8
app/src/main/res/drawable/shape_white_corner_20dp.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
</shape>
|
76
app/src/main/res/layout/activity_privilege.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_F5F6FA"
|
||||
tools:context=".avroom.activity.PrivilegeCardActivity">
|
||||
|
||||
<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"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:mBackgroundColor="@color/color_white" />
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magicIndicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvNewCreate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_bar" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tvNewCreate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:drawableStart="@drawable/icon_create"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="@string/new_create"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:corner="@dimen/dp_6"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/magicIndicator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/magicIndicator"
|
||||
app:solid="@color/color_FFDA24" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvProtocol"
|
||||
app:layout_constraintTop_toBottomOf="@+id/magicIndicator" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvProtocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:text="@string/Read_and_agree_to_the_privilege_card"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewPager"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -497,6 +497,17 @@
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10" />
|
||||
|
||||
<com.nnbc123.app.ui.widget.RecyclerViewNoViewpagerScroll
|
||||
android:id="@+id/privilegeView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_empty"
|
||||
android:layout_width="match_parent"
|
||||
@@ -531,7 +542,6 @@
|
||||
android:background="@color/color_F5F5F5_transparent_5"
|
||||
android:hint="@string/hints_tips_gift_message"
|
||||
android:maxLength="15"
|
||||
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="0dp"
|
||||
android:singleLine="true"
|
||||
@@ -630,12 +640,70 @@
|
||||
android:background="@drawable/bg_magic_dialog_button_send"
|
||||
android:text="赠送"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="15dp" />
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_privilege"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/et_gift_message">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_remainder_today"
|
||||
android:text="今日剩余赠送次数:"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/color_CED1DB"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_num"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/color_FFDA24"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_remainder_today"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:text="次"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_num"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_privilege_give"
|
||||
android:text="赠送"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginEnd="@dimen/dp_14"
|
||||
app:corner="@dimen/dp_14"
|
||||
app:solid="@color/color_FFDA24"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
312
app/src/main/res/layout/dialog_create_privilege_card.xml
Normal file
@@ -0,0 +1,312 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@drawable/shape_white_corner_20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
android:text="@string/dialog_privilege_1"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:text="@string/dialog_privilege_2"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/edName" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:background="@null"
|
||||
android:gravity="end"
|
||||
android:hint="@string/dialog_privilege_3"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textColorHint="@color/color_CED1DB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitle" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edName" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edUseNumber"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:background="@null"
|
||||
android:gravity="end"
|
||||
android:hint="@string/dialog_privilege_4"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textColorHint="@color/color_CED1DB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:text="@string/dialog_privilege_5"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/edUseNumber" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edUseNumber" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edExplain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:background="@null"
|
||||
android:gravity="end"
|
||||
android:hint="@string/dialog_privilege_6"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textColorHint="@color/color_CED1DB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv3"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view2" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:text="@string/dialog_privilege_7"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/edExplain" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edExplain" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edValid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:background="@null"
|
||||
android:gravity="end"
|
||||
android:hint="@string/dialog_privilege_8"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textColorHint="@color/color_CED1DB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv4"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view3" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:text="@string/dialog_privilege_9"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/edValid" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edValid" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edId"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:background="@null"
|
||||
android:gravity="end"
|
||||
android:hint="@string/dialog_privilege_10"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textColorHint="@color/color_CED1DB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv5"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view4" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:text="@string/dialog_privilege_11"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/edId" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
android:background="@color/color_F8F8FA"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edId" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:text="@string/dialog_privilege_12"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view5" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewPic"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:background="@drawable/bg_f8f8fa_10"
|
||||
app:layout_constraintDimensionRatio="256:144"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv6"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivPicAdd"
|
||||
android:src="@drawable/icon_privilege_pic"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewPic"
|
||||
app:layout_constraintStart_toStartOf="@+id/viewPic"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewPic"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:text="@string/dialog_privilege_13"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="@color/color_CED1DB"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivPicAdd"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivPicAdd"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivPicAdd"/>
|
||||
|
||||
<com.nnbc123.app.common.widget.RectRoundImageView
|
||||
android:id="@+id/ivPic"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
tools:src="@drawable/default_cover"
|
||||
app:borderRadius="10dp"
|
||||
app:type="round"
|
||||
app:layout_constraintStart_toStartOf="@+id/viewPic"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewPic"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewPic"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/viewPic"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:text="@string/dialog_privilege_14"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:solid="@color/color_33FFDA24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvConfirm"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivPic"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tvConfirm"
|
||||
android:text="@string/dialog_privilege_15"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:solid="@color/color_FFDA24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvCancel"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivPic"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
13
app/src/main/res/layout/fragment_privilege_card.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
206
app/src/main/res/layout/item_privilege_card.xml
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
android:background="@drawable/shape_white_16dp_round">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/ivCardBg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="162dp"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_banner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_12" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@drawable/ic_under_review"
|
||||
android:gravity="center"
|
||||
android:text="审核中"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivCardBg"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivCardBg" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvPeriod"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="有效期"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivCardBg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivCardBg"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_ccffffff_topleft_12_bottomright_12"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivCardBg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivCardBg">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:text="每日次数:"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_11" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvTime"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="2次" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivDelete"
|
||||
android:src="@drawable/ic_privilege_delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivCardBg"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivCardBg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_privilege_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/privilege_name"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivCardBg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCardBg" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_privilege_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCardBg"
|
||||
tools:text="女神卡" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_privilege_explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/privilege_explain"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_privilege_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_name" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_privilege_explain"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_name"
|
||||
tools:text="最多二十个字最多二十个字最多二十个字" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_privilege_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/privilege_user_id"
|
||||
android:textColor="@color/color_696D7A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_privilege_explain"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_explain" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tv_privilege_user_id"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_privilege_user_id"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_explain"
|
||||
tools:text="2541494,123456" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tvCause"
|
||||
android:text="查看原因"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:solid="@color/color_FFDA24"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivCardBg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvEdit"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_user_id"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tvEdit"
|
||||
android:text="重新编辑"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="42dp"
|
||||
android:gravity="center"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:solid="@color/color_white"
|
||||
app:stroke_color="@color/color_FFDA24"
|
||||
app:stroke_width="1dp"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvCause"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivCardBg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_privilege_user_id"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="tvCause,tvEdit" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -3,6 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="295dp"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/shape_white_20dp_round"
|
||||
android:orientation="vertical"
|
||||
@@ -12,7 +13,21 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_26" />
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
tools:text="标题"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textColor="@color/color_2B2D33"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:gravity="center"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -26,33 +41,42 @@
|
||||
android:textSize="14sp"
|
||||
tools:text="购买成功,是否立即驾驶sd水电费水电费?sfasdfasdfasdfasdfasdf" />
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginEnd="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="120dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:background="@drawable/bg_common_cancel"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="15sp" />
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/btn_ok"/>
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/btn_ok"
|
||||
android:layout_width="120dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="38dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_ok"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/btn_cancel"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -50,6 +50,7 @@
|
||||
<color name="white_op_30">#B3FFFFFF</color>
|
||||
<color name="white_tran_10">#19FFFFFF</color>
|
||||
<color name="white_tran_20">#33FFFFFF</color>
|
||||
<color name="white_tran_80">#CCFFFFFF</color>
|
||||
|
||||
<color name="white_transparent_12">#1EFFFFFF</color>
|
||||
<color name="white_transparent_14">#23FFFFFF</color>
|
||||
@@ -434,6 +435,7 @@
|
||||
<color name="color_fd6964">#fd6964</color>
|
||||
<color name="color_F8F9FB">#F8F9FB</color>
|
||||
<color name="color_F8F8F8">#F8F8F8</color>
|
||||
<color name="color_F8F8FA">#F8F8FA</color>
|
||||
|
||||
<color name="color_8D47F8">#8D47F8</color>
|
||||
<color name="color_FF3B6E">#FF3B6E</color>
|
||||
@@ -606,4 +608,12 @@
|
||||
<color name="color_5FCCE4">#5FCCE4</color>
|
||||
<color name="color_161958">#161958</color>
|
||||
<color name="color_bdbfd0">#BDBFD0</color>
|
||||
<color name="color_2B2D33">#2B2D33</color>
|
||||
<color name="color_FFDA24">#FFDA24</color>
|
||||
<color name="color_696D7A">#696D7A</color>
|
||||
<color name="color_A2A7B8">#A2A7B8</color>
|
||||
<color name="color_F5F6FA">#F5F6FA</color>
|
||||
<color name="color_CED1DB">#CED1DB</color>
|
||||
<color name="color_33FFDA24">#33FFDA24</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -938,4 +938,33 @@
|
||||
<string name="cp_unbind_tip">解除后,包括陪伴时长、等级都会清除;确定解除关系吗?</string>
|
||||
<string name="cp_revert_tip">撤销后,包括陪伴时长及等级都会回复,确定恢复关系吗?</string>
|
||||
<string name="message_at_tip">有%d人@你</string>
|
||||
<string name="new_create">新建</string>
|
||||
<string name="privilege_name">名称:</string>
|
||||
<string name="privilege_explain">说明:</string>
|
||||
<string name="privilege_user_id">使用者ID:</string>
|
||||
<string name="privilege_card">特权卡</string>
|
||||
<string name="all">全部</string>
|
||||
<string name="not_pass">未通过</string>
|
||||
<string name="under_review">审核中</string>
|
||||
<string name="have_expired">已过期</string>
|
||||
<string name="In_effect">生效中</string>
|
||||
<string name="please_contact_customer_service">如有任何问题请咨询客服</string>
|
||||
<string name="Read_and_agree_to_the_privilege_card">已阅读并同意%s</string>
|
||||
<string name="privilege_card_detail">《用户特权卡使用说明》</string>
|
||||
<string name="dialog_privilege_1">填写特权卡信息</string>
|
||||
<string name="dialog_privilege_2">特权卡名称:</string>
|
||||
<string name="dialog_privilege_3">请输入卡片名称</string>
|
||||
<string name="dialog_privilege_4">请输入每日可使用次数</string>
|
||||
<string name="dialog_privilege_5">每日使用次数:</string>
|
||||
<string name="dialog_privilege_6">选填,限制20个字符</string>
|
||||
<string name="dialog_privilege_7">特权说明:</string>
|
||||
<string name="dialog_privilege_8">请输入卡片有效天数</string>
|
||||
<string name="dialog_privilege_9">有效期:</string>
|
||||
<string name="dialog_privilege_10">多个ID用“,”隔开</string>
|
||||
<string name="dialog_privilege_11">使用者ID:</string>
|
||||
<string name="dialog_privilege_12">特权卡图片:</string>
|
||||
<string name="dialog_privilege_13">图片比例:16:9</string>
|
||||
<string name="dialog_privilege_14">取消</string>
|
||||
<string name="dialog_privilege_15">确认</string>
|
||||
|
||||
</resources>
|
||||
|
9
app/src/module_mini_world/res/drawable/bg_ffda24_8.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_8"/>
|
||||
|
||||
<stroke android:color="@color/color_FFDA24" android:width="1dp" />
|
||||
|
||||
</shape>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/bg_ffda24_8" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/bg_transparent_8" android:state_selected="false" />
|
||||
</selector>
|
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
|
||||
<solid android:color="@color/transparent" />
|
||||
|
||||
</shape>
|
42
app/src/module_mini_world/res/layout/item_gift_privilege.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_8"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_banner"
|
||||
app:riv_corner_radius="@dimen/dp_8"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_period_time"
|
||||
android:textSize="8sp"
|
||||
android:textColor="@color/white_tran_80"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="有效期至:2023-12-12"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_pic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="至尊女神卡"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_pic"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -504,4 +504,11 @@ public class UriProvider {
|
||||
return WEB_URL.concat("/yinmeng/activity/act-sail/more.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户特权卡使用说明
|
||||
*/
|
||||
public static String getPrivilegeInstructions() {
|
||||
return WEB_URL.concat("/yinmeng/modules/privilegeCardRule/index.html");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.nnbc123.core.privilege.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
data class PrivilegeCardInfo(
|
||||
val cardName: String = "",
|
||||
val cardStatus: Int = 0,
|
||||
val cardUrl: String = "",
|
||||
val checkReason: String = "",
|
||||
val checkTime: String = "",
|
||||
val createTime: String = "",
|
||||
val dailyNum: Int = 0,
|
||||
val description: String = "",
|
||||
val effectDay: Int = 0,
|
||||
val effectTime: String = "",
|
||||
val erbanNoStr: String = "",
|
||||
val expireTime: String = "",
|
||||
val id: Int = 0,
|
||||
val isDeleted: Int = 0,
|
||||
val isManual: Int = 0,
|
||||
val operateTime: String = "",
|
||||
val operatorId: Int = 0,
|
||||
val roomUid: Int = 0,
|
||||
val uidStr: String = "",
|
||||
val updateTime: String = ""
|
||||
) : Serializable
|
@@ -0,0 +1,73 @@
|
||||
package com.nnbc123.core.privilege.model
|
||||
|
||||
import com.nnbc123.core.base.BaseModel
|
||||
import com.nnbc123.core.bean.response.ServiceResult
|
||||
import com.nnbc123.core.home.bean.*
|
||||
import com.nnbc123.core.privilege.bean.PrivilegeCardInfo
|
||||
import com.nnbc123.core.utils.net.launchRequest
|
||||
import com.nnbc123.library.net.rxnet.RxNet
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
object PrivilegeModel : BaseModel() {
|
||||
|
||||
private val api = RxNet.create(Api::class.java)
|
||||
|
||||
suspend fun getPrivilegeCardList(cardStatus: String, roomUid : String): List<PrivilegeCardInfo>? =
|
||||
launchRequest {
|
||||
api.getPrivilegeCardList(cardStatus, roomUid)
|
||||
}
|
||||
|
||||
suspend fun savePrivilegeCard(cardName: String, dailyNum: Int, description: String, effectDay: Int, erbanNoStr: String, cardUrl: String, roomUid: String): String? =
|
||||
launchRequest {
|
||||
api.savePrivilegeCard(cardName, dailyNum, description, effectDay, erbanNoStr, cardUrl, roomUid)
|
||||
}
|
||||
|
||||
suspend fun deletePrivilegeCard(id: Int): String? =
|
||||
launchRequest {
|
||||
api.deletePrivilegeCard(id)
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
* 特权卡列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/privilegeCard/list")
|
||||
suspend fun getPrivilegeCardList(
|
||||
@Query("cardStatus") cardStatus: String,
|
||||
@Query("roomUid") roomUid: String
|
||||
): ServiceResult<List<PrivilegeCardInfo>>
|
||||
|
||||
/**
|
||||
* 保存特权卡
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST("/privilegeCard/save")
|
||||
suspend fun savePrivilegeCard(
|
||||
@Query("cardName") cardName: String,
|
||||
@Query("dailyNum") dailyNum: Int,
|
||||
@Query("description") description: String,
|
||||
@Query("effectDay") effectDay: Int,
|
||||
@Query("erbanNoStr") erbanNoStr: String,
|
||||
@Query("cardUrl") cardUrl: String,
|
||||
@Query("roomUid") roomUid: String
|
||||
): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* 删除特权卡
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/privilegeCard/del")
|
||||
suspend fun deletePrivilegeCard(
|
||||
@Query("id") id: Int
|
||||
): ServiceResult<String>
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -10,8 +10,6 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.nnbc123.core.gift.bean.LuckyBagNoticeInfo;
|
||||
import com.nnbc123.core.gift.bean.WeekStarInfo;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
@@ -21,12 +19,15 @@ import com.nnbc123.core.bean.response.ServiceResult;
|
||||
import com.nnbc123.core.gift.bean.GiftInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftListInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftPrivilegeInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftSendType;
|
||||
import com.nnbc123.core.gift.bean.GiftSource;
|
||||
import com.nnbc123.core.gift.bean.GiftType;
|
||||
import com.nnbc123.core.gift.bean.LuckyBagGifts;
|
||||
import com.nnbc123.core.gift.bean.LuckyBagNoticeInfo;
|
||||
import com.nnbc123.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.nnbc123.core.gift.bean.SimpleVipInfo;
|
||||
import com.nnbc123.core.gift.bean.WeekStarInfo;
|
||||
import com.nnbc123.core.gift.event.UpdateKnapEvent;
|
||||
import com.nnbc123.core.gift.exception.GiftOutOfDateException;
|
||||
import com.nnbc123.core.gift.toolbox.GiftToolbox;
|
||||
@@ -81,6 +82,7 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
private UiHandler handler;
|
||||
private GiftListInfo allGiftListInfo;
|
||||
private List<GiftInfo> knapList;
|
||||
private List<GiftPrivilegeInfo> privilegeList;
|
||||
private List<CustomAttachment> giftQueue;
|
||||
|
||||
private GiftModel() {
|
||||
@@ -170,6 +172,36 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物特权卡的礼物数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<ServiceResult<List<GiftPrivilegeInfo>>> requestPrivilegeGiftInfos() {
|
||||
return api.getGiftPrivilegeList(AuthModel.get().getCurrentUid() + "", AvRoomDataManager.get().getRoomUid() + "").compose(new Transformer<>()).doOnSuccess(response -> {
|
||||
if (response.isSuccess()) {
|
||||
privilegeList = response.getData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<String>> givePrivilegeCard(String cardId, String roomUid, String sendUid) {
|
||||
return api.givePrivilegeCard(cardId, roomUid, sendUid).compose(new Transformer<>()).doOnSuccess(response -> {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GiftPrivilegeInfo> getPrivilegeList() {
|
||||
if (privilegeList != null) {
|
||||
return privilegeList;
|
||||
} else {
|
||||
requestPrivilegeGiftInfos().subscribe();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GiftInfo> getGiftInfoList(int giftType) {
|
||||
return getGiftInfosByType(null, giftType);
|
||||
@@ -666,6 +698,24 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
@GET("backpack/listUserBackpackV2")
|
||||
Single<ServiceResult<List<GiftInfo>>> getGiftKnapList(@Query("uid") String uid);
|
||||
|
||||
/**
|
||||
* 获取特权卡里面的东西列表
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@GET("/privilegeCard/tab")
|
||||
Single<ServiceResult<List<GiftPrivilegeInfo>>> getGiftPrivilegeList(@Query("uid") String uid, @Query("roomUid") String roomUid);
|
||||
|
||||
/**
|
||||
* 赠送特权卡
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST("/privilegeCard/send")
|
||||
@FormUrlEncoded
|
||||
Single<ServiceResult<String>> givePrivilegeCard(@Field("cardId") String cardId, @Field("roomUid") String roomUid, @Field("sendUid") String sendUid);
|
||||
|
||||
/**
|
||||
* 送礼物
|
||||
*
|
||||
|
@@ -2,6 +2,7 @@ package com.nnbc123.core.gift;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.nnbc123.core.gift.bean.GiftPrivilegeInfo;
|
||||
import com.nnbc123.core.gift.bean.LuckyBagNoticeInfo;
|
||||
import com.nnbc123.core.gift.bean.WeekStarInfo;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
@@ -39,6 +40,20 @@ public interface IGiftModel {
|
||||
*/
|
||||
Single<ServiceResult<List<GiftInfo>>> requestKnapGiftInfos();
|
||||
|
||||
/**
|
||||
* 加载特权卡礼物
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Single<ServiceResult<List<GiftPrivilegeInfo>>> requestPrivilegeGiftInfos();
|
||||
|
||||
/**
|
||||
* 赠送特权卡
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Single<ServiceResult<String>> givePrivilegeCard(String cardId, String roomUid, String sendUid);
|
||||
|
||||
/**
|
||||
* 从内存里取出背包礼物列表
|
||||
*
|
||||
@@ -46,6 +61,13 @@ public interface IGiftModel {
|
||||
*/
|
||||
List<GiftInfo> getKnapList();
|
||||
|
||||
/**
|
||||
* 从内存里取出特权礼物列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<GiftPrivilegeInfo> getPrivilegeList();
|
||||
|
||||
/**
|
||||
* 从内存里取出背包礼物列表
|
||||
*
|
||||
|
@@ -0,0 +1,30 @@
|
||||
package com.nnbc123.core.gift.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* 特权卡
|
||||
*/
|
||||
data class GiftPrivilegeInfo(
|
||||
val cardName: String = "",
|
||||
val cardStatus: Int = 0,
|
||||
val cardUrl: String = "",
|
||||
val checkReason: String = "",
|
||||
val checkTime: String = "",
|
||||
val createTime: String = "",
|
||||
var dailyNum: Int = 0,
|
||||
val description: String = "",
|
||||
val effectDay: Int = 0,
|
||||
val effectTime: String = "",
|
||||
val erbanNoStr: String = "",
|
||||
val expireTime: String = "",
|
||||
val id: Int = 0,
|
||||
val isDeleted: Int = 0,
|
||||
val isManual: Int = 0,
|
||||
val operateTime: String = "",
|
||||
val operatorId: Int = 0,
|
||||
val roomUid: Int = 0,
|
||||
val uidStr: String = "",
|
||||
val updateTime: String = "",
|
||||
var isSelected: Boolean = false
|
||||
) : Serializable
|
@@ -211,6 +211,14 @@ public final class AvRoomDataManager {
|
||||
* 是否从师徒任务中跳转进来的
|
||||
*/
|
||||
private boolean isFromMentoring;
|
||||
/**
|
||||
* 是否拥有特权卡权限
|
||||
*/
|
||||
private boolean hasPrivilegeCardPermit;
|
||||
/**
|
||||
* 是否有房间特权卡
|
||||
*/
|
||||
private boolean hasRoomPrivilegeCard;
|
||||
/**
|
||||
* 嗨聊房列表
|
||||
*/
|
||||
@@ -291,6 +299,8 @@ public final class AvRoomDataManager {
|
||||
hasWishGiftPermit = roomInfo.isHasWishGiftPermit();
|
||||
hasOpenWishGift = roomInfo.isHasOpenWishGift();
|
||||
pkMatchStartTime = roomInfo.getPkMatchStartTime();
|
||||
hasPrivilegeCardPermit = roomInfo.isHasPrivilegeCardPermit();
|
||||
hasRoomPrivilegeCard = roomInfo.isHasRoomPrivilegeCard();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1200,6 +1210,22 @@ public final class AvRoomDataManager {
|
||||
isFromMentoring = fromMentoring;
|
||||
}
|
||||
|
||||
public boolean isHasPrivilegeCardPermit() {
|
||||
return hasPrivilegeCardPermit;
|
||||
}
|
||||
|
||||
public void setPrivilegeCardPermit(boolean hasPrivilegeCardPermit) {
|
||||
this.hasPrivilegeCardPermit = hasPrivilegeCardPermit;
|
||||
}
|
||||
|
||||
public boolean isHasRoomPrivilegeCard() {
|
||||
return hasRoomPrivilegeCard;
|
||||
}
|
||||
|
||||
public void setRoomPrivilegeCard(boolean hasRoomPrivilegeCard) {
|
||||
this.hasRoomPrivilegeCard = hasRoomPrivilegeCard;
|
||||
}
|
||||
|
||||
public long getMasterUid() {
|
||||
return masterUid;
|
||||
}
|
||||
|
@@ -124,6 +124,14 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
* 是否已经开启心愿礼物
|
||||
*/
|
||||
private boolean hasOpenWishGift;
|
||||
/**
|
||||
* 是否拥有特权卡权限
|
||||
*/
|
||||
private boolean hasPrivilegeCardPermit;
|
||||
/**
|
||||
* 是否有房间特权卡
|
||||
*/
|
||||
private boolean hasRoomPrivilegeCard;
|
||||
|
||||
protected RoomInfo(Parcel in) {
|
||||
uid = in.readLong();
|
||||
@@ -184,6 +192,8 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
mgName = in.readString();
|
||||
mgMicNum = in.readInt();
|
||||
clearScreenTime = in.readLong();
|
||||
hasPrivilegeCardPermit = in.readByte() != 0;
|
||||
hasRoomPrivilegeCard = in.readByte() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -246,6 +256,8 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
dest.writeString(mgName);
|
||||
dest.writeInt(mgMicNum);
|
||||
dest.writeLong(clearScreenTime);
|
||||
dest.writeByte((byte) (hasPrivilegeCardPermit ? 1 : 0));
|
||||
dest.writeByte((byte) (hasRoomPrivilegeCard ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1283,6 +1295,14 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
this.clearScreenTime = clearScreenTime;
|
||||
}
|
||||
|
||||
public boolean isHasPrivilegeCardPermit() {
|
||||
return hasPrivilegeCardPermit;
|
||||
}
|
||||
|
||||
public boolean isHasRoomPrivilegeCard() {
|
||||
return hasRoomPrivilegeCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("all")
|
||||
public boolean equals(final Object o) {
|
||||
@@ -1298,6 +1318,8 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
if (this.isValid() != other.isValid()) return false;
|
||||
if (this.getOperatorStatus() != other.getOperatorStatus()) return false;
|
||||
if (this.isHasAnimationEffect() != other.isHasAnimationEffect()) return false;
|
||||
if (this.isHasPrivilegeCardPermit() != other.isHasPrivilegeCardPermit()) return false;
|
||||
if (this.isHasRoomPrivilegeCard() != other.isHasRoomPrivilegeCard()) return false;
|
||||
if (this.getAudioQuality() != other.getAudioQuality()) return false;
|
||||
if (this.isCloseScreen() != other.isCloseScreen()) return false;
|
||||
if (this.isServerRedEnvelopeSwitch() != other.isServerRedEnvelopeSwitch()) return false;
|
||||
@@ -1415,6 +1437,8 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
result = result * PRIME + (this.isValid() ? 79 : 97);
|
||||
result = result * PRIME + this.getOperatorStatus();
|
||||
result = result * PRIME + (this.isHasAnimationEffect() ? 79 : 97);
|
||||
result = result * PRIME + (this.isHasPrivilegeCardPermit() ? 79 : 97);
|
||||
result = result * PRIME + (this.isHasRoomPrivilegeCard() ? 79 : 97);
|
||||
result = result * PRIME + this.getAudioQuality();
|
||||
result = result * PRIME + (this.isCloseScreen() ? 79 : 97);
|
||||
result = result * PRIME + (this.isServerRedEnvelopeSwitch() ? 79 : 97);
|
||||
@@ -1500,7 +1524,7 @@ public class RoomInfo implements Parcelable, Serializable {
|
||||
@Override
|
||||
@SuppressWarnings("all")
|
||||
public String toString() {
|
||||
return "RoomInfo(uid=" + this.getUid() + ", officeUser=" + this.getOfficeUser() + ", roomId=" + this.getRoomId() + ", roomUid=" + this.getRoomUid() + ", title=" + this.getTitle() + ", avatar=" + this.getAvatar() + ", type=" + this.getType() + ", roomDesc=" + this.getRoomDesc() + ", backPic=" + this.getBackPic() + ", speakTemplate=" + this.getSpeakTemplate() + ", valid=" + this.isValid() + ", operatorStatus=" + this.getOperatorStatus() + ", hasAnimationEffect=" + this.isHasAnimationEffect() + ", audioQuality=" + this.getAudioQuality() + ", isCloseScreen=" + this.isCloseScreen() + ", serverRedEnvelopeSwitch=" + this.isServerRedEnvelopeSwitch() + ", hasDragonGame=" + this.isHasDragonGame() + ", meetingName=" + this.getMeetingName() + ", roomPwd=" + this.getRoomPwd() + ", sortName=" + this.getSortName() + ", roomTag=" + this.getRoomTag() + ", tagId=" + this.getTagId() + ", tagPict=" + this.getTagPict() + ", onlineNum=" + this.getOnlineNum() + ", isRecom=" + this.getIsRecom() + ", isRoomFans=" + this.isRoomFans() + ", background=" + this.getBackground() + ", hasKTVPriv=" + this.isHasKTVPriv() + ", isOpenKTV=" + this.isOpenKTV() + ", isOpenGame=" + this.isOpenGame() + ", boxSwitchVo=" + this.getBoxSwitchVo() + ", singingMusicName=" + this.getSingingMusicName() + ", limitType=" + this.getLimitType() + ", introduction=" + this.getIntroduction() + ", roomModeType=" + this.getRoomModeType() + ", isPermitRoom=" + this.getIsPermitRoom() + ", isPureMode=" + this.isPureMode() + ", closeBox=" + this.isCloseBox() + ", leaveMode=" + this.isLeaveMode() + ", nick=" + this.getNick() + ", gender=" + this.getGender() + ", worldId=" + this.getWorldId() + ", showPkBeginTime=" + this.isShowPkBeginTime() + ", pkBeginTime=" + this.getPkBeginTime() + ", pkMatchStartTime=" + this.getPkMatchStartTime() + ", hasWishGiftPermit=" + this.isHasWishGiftPermit() + ", hasOpenWishGift=" + this.isHasOpenWishGift() + ", showGiftValue=" + this.isShowGiftValue() + ", hideFlag=" + this.getHideFlag() + ", closeScreenFlag=" + this.getCloseScreenFlag() + ", redEnvelopeOpen=" + this.isRedEnvelopeOpen() + ", blindDateState=" + this.getBlindDateState() + ", blindDateVipUid=" + this.getBlindDateVipUid() + ", canOpenBlindDate=" + this.isCanOpenBlindDate() + ", audioSdkType=" + this.getAudioSdkType() + ", trtcSig=" + this.getTrtcSig() + ", isReselect=" + this.isReselect() + ", mgId=" + this.getMgId() + ", mgName=" + this.getMgName() + ", mgMicNum=" + this.getMgMicNum() + ", clearScreenTime=" + this.getClearScreenTime() + ")";
|
||||
return "RoomInfo(uid=" + this.getUid() + ", officeUser=" + this.getOfficeUser() + ", roomId=" + this.getRoomId() + ", roomUid=" + this.getRoomUid() + ", title=" + this.getTitle() + ", avatar=" + this.getAvatar() + ", type=" + this.getType() + ", roomDesc=" + this.getRoomDesc() + ", backPic=" + this.getBackPic() + ", speakTemplate=" + this.getSpeakTemplate() + ", valid=" + this.isValid() + ", operatorStatus=" + this.getOperatorStatus() + ", hasAnimationEffect=" + this.isHasAnimationEffect() + ", audioQuality=" + this.getAudioQuality() + ", isCloseScreen=" + this.isCloseScreen() + ", serverRedEnvelopeSwitch=" + this.isServerRedEnvelopeSwitch() + ", hasDragonGame=" + this.isHasDragonGame() + ", meetingName=" + this.getMeetingName() + ", roomPwd=" + this.getRoomPwd() + ", sortName=" + this.getSortName() + ", roomTag=" + this.getRoomTag() + ", tagId=" + this.getTagId() + ", tagPict=" + this.getTagPict() + ", onlineNum=" + this.getOnlineNum() + ", isRecom=" + this.getIsRecom() + ", isRoomFans=" + this.isRoomFans() + ", background=" + this.getBackground() + ", hasKTVPriv=" + this.isHasKTVPriv() + ", isOpenKTV=" + this.isOpenKTV() + ", isOpenGame=" + this.isOpenGame() + ", boxSwitchVo=" + this.getBoxSwitchVo() + ", singingMusicName=" + this.getSingingMusicName() + ", limitType=" + this.getLimitType() + ", introduction=" + this.getIntroduction() + ", roomModeType=" + this.getRoomModeType() + ", isPermitRoom=" + this.getIsPermitRoom() + ", isPureMode=" + this.isPureMode() + ", closeBox=" + this.isCloseBox() + ", leaveMode=" + this.isLeaveMode() + ", nick=" + this.getNick() + ", gender=" + this.getGender() + ", worldId=" + this.getWorldId() + ", showPkBeginTime=" + this.isShowPkBeginTime() + ", pkBeginTime=" + this.getPkBeginTime() + ", pkMatchStartTime=" + this.getPkMatchStartTime() + ", hasWishGiftPermit=" + this.isHasWishGiftPermit() + ", hasOpenWishGift=" + this.isHasOpenWishGift() + ", showGiftValue=" + this.isShowGiftValue() + ", hideFlag=" + this.getHideFlag() + ", closeScreenFlag=" + this.getCloseScreenFlag() + ", redEnvelopeOpen=" + this.isRedEnvelopeOpen() + ", blindDateState=" + this.getBlindDateState() + ", blindDateVipUid=" + this.getBlindDateVipUid() + ", canOpenBlindDate=" + this.isCanOpenBlindDate() + ", audioSdkType=" + this.getAudioSdkType() + ", trtcSig=" + this.getTrtcSig() + ", isReselect=" + this.isReselect() + ", mgId=" + this.getMgId() + ", mgName=" + this.getMgName() + ", mgMicNum=" + this.getMgMicNum() + ", clearScreenTime=" + this.getClearScreenTime() + ", hasPrivilegeCardPermit=" + this.isHasPrivilegeCardPermit() + ", hasRoomPrivilegeCard=" + this.isHasRoomPrivilegeCard() + ")";
|
||||
}
|
||||
//</editor-fold>
|
||||
}
|
||||
|
@@ -0,0 +1,33 @@
|
||||
package com.nnbc123.library.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public class DensityUtil {
|
||||
public static int dip2px(Context context, float dpValue) {
|
||||
float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
|
||||
public static int px2dip(Context context, float pxValue) {
|
||||
float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (pxValue / scale + 0.5f);
|
||||
}
|
||||
|
||||
public static int px2sp(Context context, float pxValue) {
|
||||
float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
|
||||
return (int) (pxValue / fontScale + 0.5f);
|
||||
}
|
||||
|
||||
public static int sp2px(Context context, float spValue) {
|
||||
float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
|
||||
return (int) (spValue * fontScale + 0.5f);
|
||||
}
|
||||
|
||||
public static int getDisplayHeight(Context context) {
|
||||
return context.getResources().getDisplayMetrics().heightPixels;
|
||||
}
|
||||
|
||||
public static int getDisplayWidth(Context context) {
|
||||
return context.getResources().getDisplayMetrics().widthPixels;
|
||||
}
|
||||
}
|