Commit 4b98b35b authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 9389401f
...@@ -194,6 +194,7 @@ dependencies { ...@@ -194,6 +194,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0' implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.android.ads:mediation-test-suite:2.0.0' implementation 'com.google.android.ads:mediation-test-suite:2.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation('jp.wasabeef:glide-transformations:4.3.0')
// 65536 // 65536
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
// 附件下载更新 // 附件下载更新
...@@ -252,6 +253,10 @@ dependencies { ...@@ -252,6 +253,10 @@ dependencies {
// 穿山甲聚合 接入【穿山甲、快手】 // 穿山甲聚合 接入【穿山甲、快手】
implementation "com.pangle.cn:mediation-sdk:6.1.2.5" implementation "com.pangle.cn:mediation-sdk:6.1.2.5"
// 穿山甲Applog 上报组件(必须)
implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:6.16.3'
// 穿山甲商业化转化组件(必须)
implementation 'com.bytedance.ads:AppConvert:1.3.0.5'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
......
...@@ -522,3 +522,8 @@ public static final int *; ...@@ -522,3 +522,8 @@ public static final int *;
public static ** valueOf(java.lang.String); public static ** valueOf(java.lang.String);
} }
# ======================= umeng END ================ # ======================= umeng END ================
# ======================= 穿山甲商业化转化组件 END ================
-keep class com.bytedance.ads.convert.broadcast.common.EncryptionTools {*;}
# ======================= 穿山甲商业化转化组件 END ================
\ No newline at end of file
...@@ -19,18 +19,6 @@ ...@@ -19,18 +19,6 @@
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- 悬浮窗权限 -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:name=".MintsApplication" android:name=".MintsApplication"
android:allowBackup="false" android:allowBackup="false"
......
...@@ -12,6 +12,7 @@ import com.downloader.PRDownloader; ...@@ -12,6 +12,7 @@ import com.downloader.PRDownloader;
import com.downloader.PRDownloaderConfig; import com.downloader.PRDownloaderConfig;
import com.mints.enjoyboxjia.ad.TTAdManagerHolder; import com.mints.enjoyboxjia.ad.TTAdManagerHolder;
import com.mints.enjoyboxjia.common.Constant; import com.mints.enjoyboxjia.common.Constant;
import com.mints.enjoyboxjia.manager.CsjAppLogManager;
import com.mints.enjoyboxjia.manager.ShareSdkManager; import com.mints.enjoyboxjia.manager.ShareSdkManager;
import com.mints.enjoyboxjia.manager.TalkingDataManager; import com.mints.enjoyboxjia.manager.TalkingDataManager;
import com.mints.enjoyboxjia.manager.UmengManager; import com.mints.enjoyboxjia.manager.UmengManager;
...@@ -98,6 +99,8 @@ public class MintsApplication extends MultiDexApplication { ...@@ -98,6 +99,8 @@ public class MintsApplication extends MultiDexApplication {
TalkingDataManager.INSTANCE.init(this); TalkingDataManager.INSTANCE.init(this);
CsjAppLogManager.INSTANCE.init(this);
// bugly // bugly
CrashReport.initCrashReport(this, "cbba7599c2", BuildConfig.DEBUG); CrashReport.initCrashReport(this, "cbba7599c2", BuildConfig.DEBUG);
......
...@@ -18,4 +18,6 @@ public class AppConfig { ...@@ -18,4 +18,6 @@ public class AppConfig {
public static int fragmentClickFlag = 0; public static int fragmentClickFlag = 0;
// 启动页时间戳 // 启动页时间戳
public static long splashTime = 0; public static long splashTime = 0;
public static boolean enterAlipay = false;
} }
...@@ -13,6 +13,8 @@ object Constant { ...@@ -13,6 +13,8 @@ object Constant {
const val FRAGMENT_CLICK_THREE = 2 const val FRAGMENT_CLICK_THREE = 2
const val FRAGMENT_CLICK_FOUR = 3 const val FRAGMENT_CLICK_FOUR = 3
const val PAGE_SIZE = 10
// 协议地址 // 协议地址
var REGISTER_URL = "http://mints-web.mints-id.com/agreements/roomprophet/yhxy.html"//注册协议 var REGISTER_URL = "http://mints-web.mints-id.com/agreements/roomprophet/yhxy.html"//注册协议
var PRIVACY_URL = "http://mints-web.mints-id.com/agreements/roomprophet/syzc.html"//隐私协议 var PRIVACY_URL = "http://mints-web.mints-id.com/agreements/roomprophet/syzc.html"//隐私协议
......
package com.mints.enjoyboxjia.manager
import android.app.Application
import android.text.TextUtils
import com.bytedance.ads.convert.BDConvert
import com.bytedance.applog.AppLog
import com.bytedance.applog.IDataObserver
import com.bytedance.applog.InitConfig
import com.bytedance.applog.util.UriConstants
import com.bytedance.hume.readapk.HumeSDK
import com.mints.enjoyboxjia.BuildConfig
import com.mints.enjoyboxjia.MintsApplication
import com.mints.enjoyboxjia.utils.LogUtil
import com.mints.enjoyboxjia.utils.MateUtils.getAppMetaData
import org.json.JSONObject
/**
* CsjAppLogManager
*/
object CsjAppLogManager {
// 获取方式,穿山甲平台-Adspark-免费广告监测-应用管理创建
const val APP_LOG_ID = "622129"
fun init(application: Application) {
// 第一个参数APPID: 参考2.1节获取
// 第二个参数CHANNEL: 填写渠道信息,请注意不能为空
val config = InitConfig(APP_LOG_ID, createChannel())
// 设置数据上送地址
config.setUriConfig(UriConstants.DEFAULT)
config.isImeiEnable = false //建议关停获取IMEI(出于合规考虑)
config.isAutoTrackEnabled = false // 全埋点开关,true开启,false关闭
config.isLogEnable = BuildConfig.LOG_DEBUG // true:开启日志,参考4.3节设置logger,false:关闭日志
AppLog.setEncryptAndCompress(true) // 加密开关,true开启,false关闭
config.setEnablePlay(true) // 配置心跳事件(时长统计)
/**
* 用于获取用户唯一性bd_did
* @description
*/
AppLog.addDataObserver(object : IDataObserver {
/**
* 本地的id数据加载结果通知
* @param did device id
* @param iid install id
* @param ssid ssid
*/
override fun onIdLoaded(s: String, s1: String, s2: String) {}
/**
* 通知注册结果,以及id变化情况
* 仅主进程会被调用
* @param changed 是否和本地缓存有所不同
* @param oldDid 原device id
* @param newDid server返回新的device id
* @param oldIid 原install id
* @param newIid server返回新install id
* @param oldSsid 原ssid
* @param newSsid server返回新ssid
*/
override fun onRemoteIdGet(
b: Boolean,
s: String?,
s1: String,
s2: String,
s3: String,
s4: String,
s5: String
) {
val bd_did = AppLog.getDid()
LogUtil.d("mcg --> 用户唯一性bd_did=" + bd_did)
}
/**
* Config拉取数据,和本地数据对比有变化的通知
* 仅主进程会被调用
* @param changed 是否和本地缓存有所不同
* @param config server返回新config内容
*/
override fun onRemoteConfigGet(b: Boolean, jsonObject: JSONObject?) {}
/**
* server拉取AbConfig数据,和本地数据对比有变化的通知
* 仅主进程会被调用
* @param changed 是否和本地缓存有所不同
* @param abConfig server返回新abConfig内容
*/
override fun onRemoteAbConfigGet(b: Boolean, jsonObject: JSONObject) {
LogUtil.d("mcg -->---测试---返回全部进组信息", "" + jsonObject.toString())
}
/**
* Vid变化通知
*/
override fun onAbVidsChange(s: String, s1: String) {}
})
//SDK会采集OAID、ANDROID_ID和其他的设备特征字段,请遵循相关合规要求在隐私弹窗后采集
//传入需要init的AppLog实例,若没有多个AppLog实例,则传入AppLog.getInstance()即可
BDConvert.getInstance().init(application, AppLog.getInstance())
// 如果在 onCreate 阶段初始化拿不到 XXXActivity 则不需要传递第三个参数
AppLog.init(application, config)
// 请在用户授权后调用如下方法,start 开始实际采集用户信息+上报:
AppLog.start()
// 在初始化后必须设置AppLog.setHeaderInfo("csj_attribution",1),否则会直接影响归因结果。
AppLog.setHeaderInfo("csj_attribution", 1)
}
/**
* 创建渠道
*
* @return
*/
private fun createChannel(): String {
var channel = getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
try {
// 穿山甲分包渠道
val ttChannel = HumeSDK.getChannel(MintsApplication.getContext())
if (!TextUtils.isEmpty(ttChannel)) {
// 此处方式不能修改,已和后端约定
channel = channel + "_" + ttChannel
}
} catch (e: Exception) {
e.printStackTrace()
}
return channel
}
object GrownEventType {
//注册
const val REGISTER = "grown_attribution_event_register"
//付费
const val PURCHASE = "grown_attribution_event_purchase"
//关键行为
const val KEY_BEHAVIOR = "grown_attribution_event_key_behavior"
//下单
const val ORDER = "grown_attribution_event_order"
//下载
const val DOWNLOAD = "grown_attribution_event_download"
//应用内拉起
const val DEEPLINK = "grown_attribution_event_deelink"
//授权
const val AUTHORIZATION = "grown_attribution_event_authorization"
//广告变现
const val AD_PURCHASE = "grown_attribution_event_ad_purchase"
//次留
const val RETENTION_2D = "grown_attribution_event_retention_2d"
//添加购物车
const val ADD_TO_CART = "grown_attribution_event_add_to_cart"
//表单提交
const val FORM_SUBMIT = "grown_attribution_event_form_submit"
//拉活
const val APP_RE_ACTIVE_WAKE_UP = "grown_attribution_event_app_re_active_wake_up"
//自定义激活
const val CUSTOM_ACTIVITION = "grown_attribution_event_custom_activition"
//自定义注册
const val CUSTOM_REGISTER = "grown_attribution_event_custom_register"
}
fun event(v: String) {
//方式一,穿山甲
AppLog.onEventV3(v)
// //方式二,自定义
// val paramsObj = JSONObject()
// try {
// paramsObj.put("key_string", "value_string")
// paramsObj.put("key_int", 10)
// } catch (e: Exception) {
// e.printStackTrace()
// }
// AppLog.onEventV3(GrownEventType.PURCHASE, paramsObj)
}
}
\ No newline at end of file
...@@ -11,7 +11,7 @@ import net.grandcentrix.tray.AppPreferences; ...@@ -11,7 +11,7 @@ import net.grandcentrix.tray.AppPreferences;
/** /**
* 描述:管理用户信息 * 描述:管理用户信息
* 作者:孟崔广 * 作者:孟崔广
* 时间:2022/12/22 13:54 * 时间:2024/9/20 13:54
*/ */
public class UserManager { public class UserManager {
...@@ -56,6 +56,8 @@ public class UserManager { ...@@ -56,6 +56,8 @@ public class UserManager {
private static final String VIP_FOREVER = "VIP_FOREVER"; private static final String VIP_FOREVER = "VIP_FOREVER";
private static final String VIP_DATE = "VIP_DATE"; private static final String VIP_DATE = "VIP_DATE";
private static final String CODE_ID = "codeId"; private static final String CODE_ID = "codeId";
// 匹配用户 = true
private static final String NEW_FLAG = "new_flag";
public static UserManager getInstance() { public static UserManager getInstance() {
if (_inst != null) { if (_inst != null) {
...@@ -113,6 +115,7 @@ public class UserManager { ...@@ -113,6 +115,7 @@ public class UserManager {
ps.put(VIP_DATE, user.getExpireTime()); ps.put(VIP_DATE, user.getExpireTime());
ps.put(WX_OPENID, openid); ps.put(WX_OPENID, openid);
ps.put(CODE_ID, user.getIdcode()); ps.put(CODE_ID, user.getIdcode());
ps.put(NEW_FLAG, user.getActiviteFlag() == 1);
} }
} }
...@@ -168,6 +171,13 @@ public class UserManager { ...@@ -168,6 +171,13 @@ public class UserManager {
return ps.getBoolean(VIP_FLAG, false); return ps.getBoolean(VIP_FLAG, false);
} }
public boolean getNewFlag() {
if (ps == null) {
return false;
}
return ps.getBoolean(NEW_FLAG, false);
}
/** /**
* 获取用户登陆状态 * 获取用户登陆状态
*/ */
...@@ -227,6 +237,7 @@ public class UserManager { ...@@ -227,6 +237,7 @@ public class UserManager {
ps.remove(WX_OPENID); ps.remove(WX_OPENID);
ps.remove(CODE_ID); ps.remove(CODE_ID);
ps.remove(VIP_DATE); ps.remove(VIP_DATE);
ps.remove(NEW_FLAG);
} }
_inst = null; _inst = null;
......
package com.mints.enjoyboxjia.mvp.model;
import java.io.Serializable;
import java.util.List;
public class BannerList implements Serializable {
private List<VedioBean> list;
public List<VedioBean> getList() {
return list;
}
public void setList(List<VedioBean> list) {
this.list = list;
}
}
...@@ -15,6 +15,7 @@ public class UserBean implements Serializable { ...@@ -15,6 +15,7 @@ public class UserBean implements Serializable {
private String mobile; private String mobile;
private String idcode; private String idcode;
private String head; private String head;
private int activiteFlag=0;// 1-匹配用户
private String openid; private String openid;
private boolean isForever;//true-永久会员 private boolean isForever;//true-永久会员
private long expireTime;// vip到期时间 0-非vip private long expireTime;// vip到期时间 0-非vip
...@@ -92,4 +93,8 @@ public class UserBean implements Serializable { ...@@ -92,4 +93,8 @@ public class UserBean implements Serializable {
public void setCreateTime(long createTime) { public void setCreateTime(long createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
public int getActiviteFlag() {
return activiteFlag;
}
} }
package com.mints.enjoyboxjia.mvp.model;
import java.io.Serializable;
import java.util.ArrayList;
public class VedioBean implements Serializable {
private String thirdId;//穿山甲id
private int createType;//类型,1,自有剧,2 穿山甲,3 推荐短剧,4 九宫格
private String title;
private String type;
private String tabImage;
private String topTabsReamrk;
private ArrayList<String> orderTags;//标签
private int vedioTotal;//同穿山甲 total
private int unlockIndex;//解锁剧集
private int seeIndex;//看到哪一集了
private int freeIndex;//免费剧
private int collect;//0未收藏,1收藏
private String vedioDesc;
private String coverImage;
private int completeStatus;//完结状态 同穿山接status 0-完结
private String scriptName;
private String scriptAuthor;
private int vedioId;// 视频id,服务器标识
private String hot;// 收藏量
private String showNum;// 播放量
private int adGiveVedioNum;// 广告解锁数量
private String recommendUrl;// 推荐视频地址
private int recommendIndex;// 推荐视频第几集
private long seeUpdateTime;// 时间戳
private boolean checked;// 选中
private boolean isRecommendVedio;// 是否推荐剧
private int tipMaxIndex;// 倒计时弹框
public String getShowNum() {
return showNum;
}
public void setShowNum(String showNum) {
this.showNum = showNum;
}
public int getTipMaxIndex() {
return tipMaxIndex;
}
public void setTipMaxIndex(int tipMaxIndex) {
this.tipMaxIndex = tipMaxIndex;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public long getSeeUpdateTime() {
return seeUpdateTime;
}
public void setSeeUpdateTime(long seeUpdateTime) {
this.seeUpdateTime = seeUpdateTime;
}
public String getRecommendUrl() {
return recommendUrl;
}
public void setRecommendUrl(String recommendUrl) {
this.recommendUrl = recommendUrl;
}
public int getRecommendIndex() {
return recommendIndex;
}
public void setRecommendIndex(int recommendIndex) {
this.recommendIndex = recommendIndex;
}
public int getAdGiveVedioNum() {
return adGiveVedioNum;
}
public void setAdGiveVedioNum(int adGiveVedioNum) {
this.adGiveVedioNum = adGiveVedioNum;
}
public void setHot(String hot) {
this.hot = hot;
}
public String getThirdId() {
return thirdId;
}
public void setThirdId(String thirdId) {
this.thirdId = thirdId;
}
public int getCreateType() {
return createType;
}
public void setCreateType(int createType) {
this.createType = createType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTopTabsReamrk() {
return topTabsReamrk;
}
public void setTopTabsReamrk(String topTabsReamrk) {
this.topTabsReamrk = topTabsReamrk;
}
public ArrayList<String> getOrderTags() {
return orderTags;
}
public void setOrderTags(ArrayList<String> orderTags) {
this.orderTags = orderTags;
}
public int getVedioTotal() {
return vedioTotal;
}
public void setVedioTotal(int vedioTotal) {
this.vedioTotal = vedioTotal;
}
public String getVedioDesc() {
return vedioDesc;
}
public void setVedioDesc(String vedioDesc) {
this.vedioDesc = vedioDesc;
}
public String getCoverImage() {
return coverImage;
}
public void setCoverImage(String coverImage) {
this.coverImage = coverImage;
}
public int getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(int completeStatus) {
this.completeStatus = completeStatus;
}
public String getScriptName() {
return scriptName;
}
public void setScriptName(String scriptName) {
this.scriptName = scriptName;
}
public String getScriptAuthor() {
return scriptAuthor;
}
public void setScriptAuthor(String scriptAuthor) {
this.scriptAuthor = scriptAuthor;
}
public int getVedioId() {
return vedioId;
}
public void setVedioId(int vedioId) {
this.vedioId = vedioId;
}
public int getUnlockIndex() {
return unlockIndex;
}
public void setUnlockIndex(int unlockIndex) {
this.unlockIndex = unlockIndex;
}
public int getSeeIndex() {
return seeIndex;
}
public void setSeeIndex(int seeIndex) {
this.seeIndex = seeIndex;
}
public int getCollect() {
return collect;
}
public void setCollect(int collect) {
this.collect = collect;
}
public String getHot() {
return hot;
}
public void String(String hot) {
this.hot = hot;
}
public String getTypeImg() {
return tabImage;
}
public void setTypeImg(String tabImage) {
this.tabImage = tabImage;
}
public String getTabImage() {
return tabImage;
}
public void setTabImage(String tabImage) {
this.tabImage = tabImage;
}
public int getFreeIndex() {
return freeIndex;
}
public void setFreeIndex(int freeIndex) {
this.freeIndex = freeIndex;
}
public boolean isRecommendVedio() {
return isRecommendVedio;
}
public void setRecommendVedio(boolean recommendVedio) {
isRecommendVedio = recommendVedio;
}
}
package com.mints.enjoyboxjia.mvp.presenters
import com.mints.enjoyboxjia.common.DeviceInfo
import com.mints.enjoyboxjia.manager.AppHttpManager
import com.mints.enjoyboxjia.manager.UserManager
import com.mints.enjoyboxjia.mvp.model.BaseResponse
import com.mints.enjoyboxjia.mvp.model.UserBean
import com.mints.enjoyboxjia.mvp.views.CountView
import com.mints.enjoyboxjia.utils.DeviceUuidFactory
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class CountPresenter : BasePresenter<CountView>() {
/**
* 游客登录
*/
fun userLogin() {
val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
}
else -> view.showToast(message)
}
}
})
}
/**
* 提交设备信息
*
* @param context
*/
fun saveTerminalInfo() {
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
vo["mac"] = mac
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
vo["os"] = if (deviceInfo.isHarmonyOS()) "android-HarmonyOS" else "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> getMyInfo()
}
}
})
}
fun getMyInfo() {
val vo = HashMap<String, Any>()
vo["os"] = "android"
AppHttpManager.getInstance(loanApplication)
.call(loanService.getMyInfo(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView)
return
view.hideLoading()
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code: Int = baseResponse.status
val message: String = baseResponse.message
when (code) {
200 -> {
UserManager.getInstance().saveUserInfo(baseResponse.data)
// view.getUserSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
}
\ No newline at end of file
package com.mints.enjoyboxjia.mvp.presenters package com.mints.enjoyboxjia.mvp.presenters
import com.mints.enjoyboxjia.MintsApplication
import com.mints.enjoyboxjia.manager.AppHttpManager
import com.mints.enjoyboxjia.mvp.views.VipView
import com.mints.library.net.neterror.BaseSubscriber import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable import com.mints.library.net.neterror.Throwable
import com.mints.enjoyboxjia.MintsApplication
import com.mints.enjoyboxjia.common.DeviceInfo import com.mints.enjoyboxjia.common.DeviceInfo
import com.mints.enjoyboxjia.manager.AppHttpManager
import com.mints.enjoyboxjia.manager.UserManager import com.mints.enjoyboxjia.manager.UserManager
import com.mints.enjoyboxjia.mvp.model.BaseResponse import com.mints.enjoyboxjia.mvp.model.*
import com.mints.enjoyboxjia.mvp.model.UserBean
import com.mints.enjoyboxjia.mvp.model.VipBean
import com.mints.enjoyboxjia.mvp.model.WxPayParamBean
import com.mints.enjoyboxjia.mvp.views.VipView
import com.mints.enjoyboxjia.net.V6Service
import com.mints.enjoyboxjia.utils.DeviceUuidFactory import com.mints.enjoyboxjia.utils.DeviceUuidFactory
import java.util.* import java.util.*
class VipPresenter : BasePresenter<VipView>() { class VipPresenter : BasePresenter<VipView>() {
fun getMyInfo() {
val vo = HashMap<String, Any>()
vo["os"] = "android"
AppHttpManager.getInstance(loanApplication)
.call(loanService.getMyInfo(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView)
return
}
override fun onError(e: Throwable?) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code: Int = baseResponse.status
val message: String = baseResponse.message
when (code) {
200 -> {
UserManager.getInstance().saveUserInfo(baseResponse.data)
view.getUserSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
/** /**
* 游客登录 * 游客登录
*/ */
...@@ -42,7 +75,6 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -42,7 +75,6 @@ class VipPresenter : BasePresenter<VipView>() {
val data: UserBean? = baseResponse.getData() val data: UserBean? = baseResponse.getData()
when (code) { when (code) {
200 -> if (data != null) { 200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data) UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo(isInstallAlipay) saveTerminalInfo(isInstallAlipay)
} }
...@@ -211,4 +243,34 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -211,4 +243,34 @@ class VipPresenter : BasePresenter<VipView>() {
} }
}) })
} }
fun orders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.orders(),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.ordersSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
} }
\ No newline at end of file
package com.mints.enjoyboxjia.mvp.views
import com.mints.enjoyboxjia.mvp.model.UserBean
interface CountView : BaseView {
// fun getUserSuc(data:UserBean)
}
package com.mints.enjoyboxjia.mvp.views package com.mints.enjoyboxjia.mvp.views
import com.mints.enjoyboxjia.mvp.model.BannerList
import com.mints.enjoyboxjia.mvp.model.UserBean
import com.mints.enjoyboxjia.mvp.model.VipBean import com.mints.enjoyboxjia.mvp.model.VipBean
import com.mints.enjoyboxjia.mvp.model.WxPayParamBean import com.mints.enjoyboxjia.mvp.model.WxPayParamBean
...@@ -7,4 +9,7 @@ interface VipView : BaseView { ...@@ -7,4 +9,7 @@ interface VipView : BaseView {
fun getVipProductSuc(data: VipBean) fun getVipProductSuc(data: VipBean)
fun getVipPayParamsSuc(payChannel:String,data: WxPayParamBean) fun getVipPayParamsSuc(payChannel:String,data: WxPayParamBean)
fun queryVipOrderSuc(isPay:Boolean) fun queryVipOrderSuc(isPay:Boolean)
fun getUserSuc(data: UserBean)
fun ordersSuc(data: BannerList?)
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import android.text.TextUtils; ...@@ -4,6 +4,7 @@ import android.text.TextUtils;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.mints.enjoyboxjia.BuildConfig; import com.mints.enjoyboxjia.BuildConfig;
import com.mints.enjoyboxjia.mvp.model.BannerList;
import com.mints.enjoyboxjia.mvp.model.BaseResponse; import com.mints.enjoyboxjia.mvp.model.BaseResponse;
import com.mints.enjoyboxjia.mvp.model.HotStyleListBean; import com.mints.enjoyboxjia.mvp.model.HotStyleListBean;
import com.mints.enjoyboxjia.mvp.model.OrderRecordBean; import com.mints.enjoyboxjia.mvp.model.OrderRecordBean;
...@@ -82,7 +83,7 @@ public interface LoanService { ...@@ -82,7 +83,7 @@ public interface LoanService {
/** /**
* 查询vip产品 * 查询vip产品
*/ */
@POST("api/vip/getVipProducts/fai") @POST("api/vip/getVipProducts/appv2")
Observable<BaseResponse<VipBean>> getVipProducts(@Body Map<String, Object> vo); Observable<BaseResponse<VipBean>> getVipProducts(@Body Map<String, Object> vo);
/** /**
...@@ -133,6 +134,14 @@ public interface LoanService { ...@@ -133,6 +134,14 @@ public interface LoanService {
@POST("api/vip/payError") @POST("api/vip/payError")
Observable<BaseResponse<Object>> payError(@Body Map<String, Object> vo); Observable<BaseResponse<Object>> payError(@Body Map<String, Object> vo);
/**
* 排行榜
*
* @return
*/
@POST("api/vedio/orders")
Observable<BaseResponse<BannerList>> orders();
/** /**
* 默认http工厂 * 默认http工厂
......
...@@ -66,7 +66,7 @@ class GuideActivity : BaseActivity(), GuideView { ...@@ -66,7 +66,7 @@ class GuideActivity : BaseActivity(), GuideView {
readyGoThenKill(MainActivity::class.java) readyGoThenKill(MainActivity::class.java)
} else { } else {
val bundle = Bundle() val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true) // bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle) readyGoThenKill(VipActivity::class.java, bundle)
} }
//带点渐变动画 //带点渐变动画
......
...@@ -56,11 +56,11 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -56,11 +56,11 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
item_phone.findViewById<TextView>(R.id.tv_right).text = "未授权" item_phone.findViewById<TextView>(R.id.tv_right).text = "未授权"
} }
if (!TextUtils.isEmpty(userManager.wxOpenid)) { // if (!TextUtils.isEmpty(userManager.wxOpenid)) {
item_wechat.findViewById<TextView>(R.id.tv_right).text = userManager.name // item_wechat.findViewById<TextView>(R.id.tv_right).text = userManager.name
} else { // } else {
item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权" // item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
} // }
} }
@SuppressLint("CutPasteId") @SuppressLint("CutPasteId")
......
...@@ -97,9 +97,7 @@ class SplashAdActivity : BaseActivity() { ...@@ -97,9 +97,7 @@ class SplashAdActivity : BaseActivity() {
if (UserManager.getInstance().vipFlag) { if (UserManager.getInstance().vipFlag) {
readyGoThenKill(MainActivity::class.java) readyGoThenKill(MainActivity::class.java)
} else { } else {
val bundle = Bundle() readyGoThenKill(VipActivity::class.java)
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
} }
} }
......
package com.mints.enjoyboxjia.ui.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mints.enjoyboxjia.R;
public class ImageTitleHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public TextView title;
public ImageTitleHolder(@NonNull View view) {
super(view);
imageView = view.findViewById(R.id.image);
title = view.findViewById(R.id.bannerTitle);
}
}
package com.mints.enjoyboxjia.ui.adapter package com.mints.enjoyboxjia.ui.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.graphics.Paint import android.graphics.Paint
import android.text.TextUtils import android.text.TextUtils
import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.mvp.model.VipBean import com.mints.enjoyboxjia.mvp.model.VipBean
import com.mints.enjoyboxjia.utils.BubbleUtils
import com.mints.enjoyboxjia.utils.SpanUtils
import com.mints.enjoyboxjia.utils.UIUtils
import kotlinx.android.synthetic.main.fragment_main_my.*
class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
RecyclerView.Adapter<VipAdapter.ViewHolder>() { RecyclerView.Adapter<VipAdapter.ViewHolder>() {
...@@ -36,7 +39,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -36,7 +39,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
} }
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val rlVipItemRoot: LinearLayout = view.findViewById(R.id.rlVipItemRoot) val rlVipItemRoot: FrameLayout = view.findViewById(R.id.rlVipItemRoot)
val tvVipItemCurMoney: TextView = view.findViewById(R.id.tvVipItemCurMoney) val tvVipItemCurMoney: TextView = view.findViewById(R.id.tvVipItemCurMoney)
val tvVipItemMoney: TextView = view.findViewById(R.id.tvVipItemMoney) val tvVipItemMoney: TextView = view.findViewById(R.id.tvVipItemMoney)
val tvVipItemTitle: TextView = view.findViewById(R.id.tvVipItemTitle) val tvVipItemTitle: TextView = view.findViewById(R.id.tvVipItemTitle)
...@@ -52,23 +55,82 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -52,23 +55,82 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val vipBean = vipList[position] val vipBean = vipList[position]
holder.tvVipItemTitle.text = vipBean.title
if (TextUtils.isEmpty(vipBean.topTitle)) { if (vipBean.trial != 0) {
holder.tvVipItemLable.visibility = View.INVISIBLE holder.tvVipItemLable.setPadding(0, 0, 0, 0)
} else { holder.tvVipItemLable.text = "限时特惠"
holder.tvVipItemLable.text = vipBean.topTitle holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.visibility = View.VISIBLE holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
}
holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
if (vipBean.oldPrice > 0) {
holder.tvVipItemMoney.visibility = View.VISIBLE
holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
holder.tvVipItemMoney.text = "原价:${vipBean.oldPrice}"
} else { } else {
holder.tvVipItemMoney.visibility = View.INVISIBLE holder.tvVipItemLable.setPadding(0, 0, 0, 0)
holder.tvVipItemLable.text = "热门"
holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
} }
// try {
// if(!TextUtils.isEmpty(vipBean.topTitle)){
//
// val topArray= vipBean.topTitle.split(",")
// holder.tvVipItemCurMoney.text = SpanUtils()
// .append(topArray[0])
// .append(topArray[1])
// .setFontSize(BubbleUtils.sp2px(28))
// .append(topArray[2])
// .create()
// holder.tvVipItemMoney.text = topArray[3]
// holder.tvVipItemTitle.text = topArray[4]
// }else{
// holder.tvVipItemTitle.text = vipBean.title
// if (vipBean.price < 1) {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
// } else {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
//// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
// }
// if (vipBean.oldPrice > 0) {
// holder.tvVipItemMoney.visibility = View.VISIBLE
// holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
// if (vipBean.oldPrice < 1) {
// holder.tvVipItemMoney.text = "原价:${vipBean.oldPrice}"
// } else {
// holder.tvVipItemMoney.text = "原价:${String.format("%.0f", vipBean.oldPrice)}"
// }
// } else {
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// }
//
// }
// }catch (e:Exception){
// e.printStackTrace()
holder.tvVipItemTitle.text = vipBean.title
// if (vipBean.price < 1) {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
// } else {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
//// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
// }
holder.tvVipItemCurMoney.text = SpanUtils()
.append(vipBean.price.toString())
.setFontSize(BubbleUtils.sp2px(34))
.append("元")
.create()
// if (vipBean.oldPrice > 0) {
// holder.tvVipItemMoney.visibility = View.VISIBLE
// holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
// if (vipBean.oldPrice < 1) {
// holder.tvVipItemMoney.text = "原价:${vipBean.oldPrice}"
// } else {
// holder.tvVipItemMoney.text = "原价:${String.format("%.0f", vipBean.oldPrice)}"
// }
// } else {
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// }
// }
holder.tvVipItemMoney.text = vipBean.topTitle
holder.rlVipItemRoot.setOnClickListener { holder.rlVipItemRoot.setOnClickListener {
mOnItemClickListener.onItemClick(position) mOnItemClickListener.onItemClick(position)
notifyDataSetChanged() notifyDataSetChanged()
...@@ -77,32 +139,20 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -77,32 +139,20 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
if (getPosition() == position) { if (getPosition() == position) {
//当前选中 //当前选中
holder.rlVipItemRoot.setBackgroundResource(R.drawable.shape_vip_adapter) holder.rlVipItemRoot.setBackgroundResource(R.drawable.shape_vip_adapter)
holder.tvVipItemTitle.setTextColor( // holder.tvVipItemCurMoney.setTextColor(
ContextCompat.getColor( // ContextCompat.getColor(
context, // context,
R.color.white // R.color.color_FD7E0E
) // )
) // )
holder.tvVipItemCurMoney.setTextColor(
ContextCompat.getColor(
context,
R.color.white
)
)
} else { } else {
holder.rlVipItemRoot.setBackgroundResource(R.drawable.shape_vip_adapter_none) holder.rlVipItemRoot.setBackgroundResource(R.drawable.shape_vip_adapter_none)
holder.tvVipItemTitle.setTextColor( // holder.tvVipItemCurMoney.setTextColor(
ContextCompat.getColor( // ContextCompat.getColor(
context, // context,
R.color.color_939AA3 // R.color.white
) // )
) // )
holder.tvVipItemCurMoney.setTextColor(
ContextCompat.getColor(
context,
R.color.color_939AA3
)
)
} }
holder.itemView.setTag(position) holder.itemView.setTag(position)
......
package com.mints.enjoyboxjia.ui.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.mints.enjoyboxjia.R;
import com.mints.enjoyboxjia.mvp.model.VedioBean;
import com.mints.library.utils.GlideUtils;
import com.youth.banner.adapter.BannerAdapter;
import java.util.List;
public class VipBannerAdapter extends BannerAdapter<VedioBean, ImageTitleHolder> {
private Context context;
public VipBannerAdapter(List<VedioBean> data) {
super(data);
}
@Override
public ImageTitleHolder onCreateHolder(ViewGroup parent, int viewType) {
context = parent.getContext();
return new ImageTitleHolder(LayoutInflater.from(context).inflate(R.layout.item_banner_vip, parent, false));
}
@Override
public void onBindView(ImageTitleHolder holder, VedioBean data, int position, int size) {
if (data.getCoverImage() != null) {
GlideUtils.INSTANCE.loadImageViewGifForCenterCrop(context, data.getCoverImage(), holder.imageView, 15);
}
holder.title.setText(data.getTitle());
}
}
package com.mints.enjoyboxjia.ui.fragment package com.mints.enjoyboxjia.ui.fragment
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.common.AppConfig import com.mints.enjoyboxjia.common.AppConfig
import com.mints.enjoyboxjia.common.Constant import com.mints.enjoyboxjia.common.Constant
import com.mints.enjoyboxjia.manager.UserManager
import com.mints.enjoyboxjia.mvp.presenters.CountPresenter
import com.mints.enjoyboxjia.mvp.views.CountView
import com.mints.enjoyboxjia.ui.fragment.base.LazyLoadBaseFragment import com.mints.enjoyboxjia.ui.fragment.base.LazyLoadBaseFragment
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main_count.*
import java.util.ArrayList
/** /**
* 统计 * 书库
*/ */
class CountFragment : LazyLoadBaseFragment() { class CountFragment : LazyLoadBaseFragment(), CountView, OnRefreshListener,
OnLoadMoreListener {
private val countPresenter by lazy { CountPresenter() }
private val userManager by lazy { UserManager.getInstance() }
private var hotPage = 1 // 分页
// private val videoData: ArrayList<VideoStyleBean> = arrayListOf()
private val videoData: ArrayList<Any> = arrayListOf()
// private lateinit var videoListAdapter: VideoListAdapter
override fun getContentViewLayoutID() = R.layout.fragment_main_count override fun getContentViewLayoutID() = R.layout.fragment_main_count
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
countPresenter.attachView(this)
initView()
initListener()
} }
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible() super.onFragmentFirstVisible()
srlMainPage.autoRefresh()
}
override fun onDestroy() {
super.onDestroy()
countPresenter.detachView()
} }
override fun onFragmentResume() { override fun onFragmentResume() {
super.onFragmentResume() super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_THREE) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_THREE) {
// if (AntiShake.check(ll_my_cancel?.id)) return
if (!TextUtils.isEmpty(userManager?.userID)) {
// countPresenter.getMyInfo()
} else {
countPresenter.userLogin()
}
}
}
override fun onRefresh(refreshLayout: RefreshLayout) {
hotPage = 1
videoData.clear()
srlMainPage.resetNoMoreData()
if (!TextUtils.isEmpty(userManager?.userID)) {
// videoListPresenter.getVedioPageList(hotPage, Constant.PAGE_SIZE, mType)
}
}
override fun onLoadMore(refreshLayout: RefreshLayout) {
hotPage = ++hotPage
// videoListPresenter.getVedioPageList(hotPage, Constant.PAGE_SIZE, mType)
}
// override fun getVedioPageListSuc(data: VideoStyleListBean) {
// if (activity == null || requireActivity().isFinishing
// ) {
// return
// }
//
// if (::videoListAdapter.isInitialized) {
// videoData.addAll(data.list)
// if (hotPage == 1) {
// srlMainPage.finishRefresh(true)
// videoListAdapter.notifyDataSetChanged()
// } else {
// if (data.list.size < Constant.PAGE_SIZE) {
// srlMainPage.finishLoadMoreWithNoMoreData()
// } else {
// srlMainPage.finishLoadMore()
// }
// videoListAdapter.notifyItemChanged(data.list.size)
// }
// }
// }
// override fun getVedioPageListFail() {
// srlMainPage.finishRefresh(false)
// srlMainPage.finishLoadMore(false)
// hotPage = if (hotPage == 1) 1 else hotPage - 1
// }
private fun initView() {
val gridLayoutManager = GridLayoutManager(requireContext(), 2)
// rv_video_list.layoutManager = gridLayoutManager
// videoListAdapter = VideoListAdapter(requireContext(), videoData)
// rv_video_list.adapter = videoListAdapter
// videoListAdapter.setOnItemClickListener(object : OnItemClickListener {
// override fun onItemClick(view: View?, position: Int) {
// if (videoData.size > 0) {
// }
// }
// })
} }
private fun initListener() {
srlMainPage.setOnRefreshListener(this)
srlMainPage.setOnLoadMoreListener(this)
} }
} }
\ No newline at end of file
...@@ -2,14 +2,16 @@ package com.mints.enjoyboxjia.ui.fragment ...@@ -2,14 +2,16 @@ package com.mints.enjoyboxjia.ui.fragment
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.mints.library.utils.nodoubleclick.AntiShake
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.common.AppConfig import com.mints.enjoyboxjia.common.AppConfig
import com.mints.enjoyboxjia.common.Constant import com.mints.enjoyboxjia.common.Constant
import com.mints.enjoyboxjia.manager.ActivityPageManager import com.mints.enjoyboxjia.manager.AppHttpManager
import com.mints.enjoyboxjia.manager.UserManager import com.mints.enjoyboxjia.manager.UserManager
import com.mints.enjoyboxjia.mvp.model.BaseResponse
import com.mints.enjoyboxjia.mvp.model.OrderRecordBean
import com.mints.enjoyboxjia.mvp.model.UserBean import com.mints.enjoyboxjia.mvp.model.UserBean
import com.mints.enjoyboxjia.mvp.presenters.MyPresenter import com.mints.enjoyboxjia.mvp.presenters.MyPresenter
import com.mints.enjoyboxjia.mvp.views.MyView import com.mints.enjoyboxjia.mvp.views.MyView
...@@ -17,35 +19,29 @@ import com.mints.enjoyboxjia.ui.activitys.* ...@@ -17,35 +19,29 @@ import com.mints.enjoyboxjia.ui.activitys.*
import com.mints.enjoyboxjia.ui.fragment.base.LazyLoadBaseFragment import com.mints.enjoyboxjia.ui.fragment.base.LazyLoadBaseFragment
import com.mints.enjoyboxjia.ui.widgets.DialogListener import com.mints.enjoyboxjia.ui.widgets.DialogListener
import com.mints.enjoyboxjia.ui.widgets.PhoneDialog import com.mints.enjoyboxjia.ui.widgets.PhoneDialog
import com.mints.enjoyboxjia.utils.SpanUtils
import com.mints.enjoyboxjia.utils.TimeRender import com.mints.enjoyboxjia.utils.TimeRender
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.fragment_main_my.* import kotlinx.android.synthetic.main.fragment_main_my.*
/** /**
* 描述:我 * 描述:我
* 作者:孟崔广 * 作者:孟崔广
* 时间:2023/7/7 11:30 * 时间:2024/9/20 11:30
*/ */
class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
private val myPresenter by lazy { MyPresenter() } private val myPresenter by lazy { MyPresenter() }
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
private var phoneDialog: PhoneDialog? = null private var phoneDialog: PhoneDialog? = null
private var mAgreementDTO: OrderRecordBean.AgreementDTO? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_my override fun getContentViewLayoutID() = R.layout.fragment_main_my
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
myPresenter.attachView(this) myPresenter.attachView(this)
tv_contact.text = SpanUtils()
.append("如有问题,请直接联系")
.append("在线客服\n")
.setForegroundColor(resources.getColor(R.color.main_mints))
.append("处理速度更快,")
.append("无需联系支付宝")
.setForegroundColor(resources.getColor(R.color.main_mints))
.create()
initListener() initListener()
} }
...@@ -63,7 +59,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -63,7 +59,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
super.onFragmentResume() super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
if (AntiShake.check(ll_my_read?.id)) return if (AntiShake.check(ll_my_cancel?.id)) return
if (!TextUtils.isEmpty(userManager?.userID)) { if (!TextUtils.isEmpty(userManager?.userID)) {
myPresenter.getMyInfo() myPresenter.getMyInfo()
...@@ -87,57 +83,68 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -87,57 +83,68 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
readyGo(VipActivity::class.java) readyGo(VipActivity::class.java)
} }
} }
R.id.ll_my_read -> { R.id.ll_my_history -> {
val activity = ActivityPageManager.getInstance().getActivity(MainActivity::class.java) readyGo(HistoryActivity::class.java)
if (activity != null && activity is MainActivity) {
activity.clickTab3Layout()
} }
R.id.ll_my_change -> {
// readyGo(HistoryActivity::class.java)
} }
R.id.ll_my_payrecord -> { R.id.ll_my_cancel -> {
readyGo(OrderRecordActivity::class.java) if (mAgreementDTO == null) {
showToast("暂未开通自动续费")
} else {
val bundle = Bundle()
bundle.putSerializable(ManageOrderActivity.AGREEMENT_DATA, mAgreementDTO)
readyGo(ManageOrderActivity::class.java, bundle)
} }
R.id.ll_my_history -> {
readyGo(HistoryActivity::class.java)
} }
R.id.ll_my_setting -> { R.id.ll_my_order -> {
readyGo(SettingsActivity::class.java) readyGo(OrderRecordActivity::class.java)
// readyGo(BillActivity::class.java)
} }
R.id.ll_contactus,R.id.iv_contactus -> { R.id.ll_my_phone -> {
backPhoneDialog() backPhoneDialog()
} }
R.id.ll_my_set -> {
readyGo(SettingsActivity::class.java)
}
} }
} }
override fun getUserSuc(data: UserBean) { override fun getUserSuc(data: UserBean) {
getData()
loginStatus(data) loginStatus(data)
} }
private fun loginStatus(consumer: UserBean) { private fun loginStatus(consumer: UserBean) {
// 2-是否有手机号 // 是否有手机号
if (!TextUtils.isEmpty(userManager.mobile)) { if (!TextUtils.isEmpty(userManager.mobile)) {
tv_my_account.text = "手机号:" + consumer.mobile.substring(0,3)+"****"+consumer.mobile.substring(consumer.mobile.length-4) tv_my_account.text =
"手机号:" + consumer.mobile.substring(0, 3) + "****" + consumer.mobile.substring(
consumer.mobile.length - 4
)
iv_my_bind.visibility = View.GONE iv_my_bind.visibility = View.GONE
} else { } else {
tv_my_account.text = "绑定手机号" tv_my_account.text = "绑定手机号"
iv_my_bind.visibility = View.VISIBLE iv_my_bind.visibility = View.VISIBLE
} }
tv_my_id.text = "用户ID:"+consumer.idcode tv_my_id.text = "书友" + consumer.idcode
// 3-vip // vip状态
if (consumer.expireTime > 0) { if (consumer.expireTime > 0) {
iv_my_bind.setImageResource(R.mipmap.ic_my_v)
tv_my_vip.text = "VIP会员" tv_my_vip.text = "VIP会员"
tv_my_btn.visibility = View.GONE
if (consumer.isForever) { if (consumer.isForever) {
tv_my_status.text = "有效期: 永久有效" tv_my_status.text = "有效期: 永久有效"
} else { } else {
tv_my_status.text = tv_my_status.text =
"到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.DEFAULT_FORMAT)}" "到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.DEFAULT_FORMAT)}"
} }
tv_my_btn.text = "已开通"
} else { } else {
tv_my_vip.text = "开通数据会员服务" iv_my_bind.setImageResource(R.mipmap.ic_my_pt)
tv_my_status.text = "随时随地查询房地产行情" tv_my_vip.text = "开通VIP会员"
tv_my_btn.visibility = View.VISIBLE tv_my_status.text = "万本小说免费看"
tv_my_btn.text = "立即开通" tv_my_btn.text = "立即开通"
} }
} }
...@@ -146,12 +153,12 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -146,12 +153,12 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
ll_my_login.setOnClickListener(this) ll_my_login.setOnClickListener(this)
tv_my_btn.setOnClickListener(this) tv_my_btn.setOnClickListener(this)
tv_my_account.setOnClickListener(this) tv_my_account.setOnClickListener(this)
ll_my_read.setOnClickListener(this)
ll_my_history.setOnClickListener(this) ll_my_history.setOnClickListener(this)
ll_my_payrecord.setOnClickListener(this) ll_my_change.setOnClickListener(this)
ll_my_setting.setOnClickListener(this) ll_my_cancel.setOnClickListener(this)
ll_contactus.setOnClickListener(this) ll_my_order.setOnClickListener(this)
iv_contactus.setOnClickListener(this) ll_my_phone.setOnClickListener(this)
ll_my_set.setOnClickListener(this)
} }
fun backPhoneDialog() { fun backPhoneDialog() {
...@@ -171,4 +178,19 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -171,4 +178,19 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
}) })
phoneDialog!!.show() phoneDialog!!.show()
} }
private fun getData() {
AppHttpManager.getInstance(baseApplication)
.call(baseApplication.loanService.cashOutRecords,
object : BaseSubscriber<BaseResponse<OrderRecordBean>>() {
override fun onError(e: Throwable) {
}
override fun onNext(t: BaseResponse<OrderRecordBean>) {
if (t.status == 200) {
mAgreementDTO = t.data.agreement
}
}
})
}
} }
\ No newline at end of file
...@@ -6,37 +6,28 @@ import android.view.Gravity ...@@ -6,37 +6,28 @@ import android.view.Gravity
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import android.widget.CheckBox import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.common.AppConfig import com.mints.enjoyboxjia.common.AppConfig
import com.mints.enjoyboxjia.mvp.model.VipBean import com.mints.enjoyboxjia.mvp.model.VipBean
import com.mints.enjoyboxjia.utils.SpanUtils
class PayYesDialog( class PayYesDialog(
context: Context, private val context: Context,
vipBean: VipBean.ListBean, vipBean: VipBean.ListBean,
private val listener: DialogListener private val listener: DialogListener
) : Dialog( ) : Dialog(
context, R.style.dialog context, R.style.dialog
) { ) {
private val lp: WindowManager.LayoutParams private val lp: WindowManager.LayoutParams
private var milliCountDownTimer: MilliDownTimer? = null private val tv_dialog_vip_next: TextView
private val tv_pay_yes_cancle: ImageView private val tv_dialog_vip_count: TextView
private val tv_pay_yes_next: TextView private val iv_dialog_vip_quit: ImageView
private val tv_pay_yes_title: TextView private val iv_dialog_vip_top: ImageView
private val tv_pay_yes_money: TextView private val rl_dialog_vip_bg: RelativeLayout
private val tv_pay_yes_preferential: TextView
private val tv_pay_yes_money_text: TextView
private val tv_origin: TextView
private val tv_time_min: TextView
private val tv_time_sec: TextView
private val tv_time_mil: TextView
private val tv_pay_text: TextView
private val cbVipAgreement: CheckBox
private val tvVipAgreement: TextView
init { init {
setContentView(R.layout.dialog_payyes) setContentView(R.layout.dialog_payyes)
...@@ -56,86 +47,31 @@ class PayYesDialog( ...@@ -56,86 +47,31 @@ class PayYesDialog(
// 查找View // 查找View
tv_origin = findViewById<View>(R.id.tv_origin) as TextView iv_dialog_vip_quit = findViewById<View>(R.id.iv_dialog_vip_quit) as ImageView
tv_time_min = findViewById<View>(R.id.tv_time_min) as TextView iv_dialog_vip_top = findViewById<View>(R.id.iv_dialog_vip_top) as ImageView
tv_time_sec = findViewById<View>(R.id.tv_time_sec) as TextView tv_dialog_vip_next = findViewById<View>(R.id.tv_dialog_vip_next) as TextView
tv_time_mil = findViewById<View>(R.id.tv_time_mil) as TextView tv_dialog_vip_count = findViewById<View>(R.id.tv_dialog_vip_count) as TextView
tv_pay_text = findViewById<View>(R.id.tv_pay_text) as TextView rl_dialog_vip_bg = findViewById<View>(R.id.rl_dialog_vip_bg) as RelativeLayout
iv_dialog_vip_quit.setOnClickListener(listener)
cbVipAgreement = findViewById<View>(R.id.cbVipAgreement) as CheckBox tv_dialog_vip_next.setOnClickListener(listener)
tvVipAgreement = findViewById<View>(R.id.tvVipAgreement) as TextView
if (vipBean.trial == 0) {
tv_pay_yes_cancle = findViewById<View>(R.id.tv_pay_yes_cancle) as ImageView //0-没签约 无0.01
tv_pay_yes_next = findViewById<View>(R.id.tv_pay_yes_next) as TextView tv_dialog_vip_count.text = SpanUtils()
tv_pay_yes_title = findViewById<View>(R.id.tv_pay_yes_title) as TextView .append("" + vipBean.price)
tv_pay_yes_money = findViewById<View>(R.id.tv_pay_yes_money) as TextView .setFontSize(30, true)
tv_pay_yes_preferential = findViewById<View>(R.id.tv_pay_yes_preferential) as TextView .append(" 元")
tv_pay_yes_money_text = findViewById<View>(R.id.tv_pay_yes_money_text) as TextView .setFontSize(16, true)
tvVipAgreement.setOnClickListener(listener) .create()
tv_pay_yes_cancle.setOnClickListener(listener) iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
tv_origin.setOnClickListener(listener)
tv_pay_yes_next.setOnClickListener(listener)
tv_pay_yes_money.text = "¥${vipBean.price}"
tv_pay_yes_money_text.text = vipBean.topTitle
tv_pay_yes_preferential.text = (vipBean.price).toString()
tv_pay_text.text = vipBean.remarks
tv_origin.text = "以后原价¥${vipBean.oldPrice}元买"
milliCountDownTimer = MilliDownTimer(getShowTime())
milliCountDownTimer?.start()
milliCountDownTimer?.setOnTickListener { min, sec, mil ->
tv_time_min.text = min
tv_time_sec.text = sec
tv_time_mil.text = mil
}
milliCountDownTimer?.setOnFinishListener {
tv_time_min.text = "00"
tv_time_sec.text = "00"
tv_time_mil.text = "00"
}
}
override fun dismiss() {
super.dismiss()
milliCountDownTimer?.cancel()
milliCountDownTimer = null
}
/**
* 获取倒计时时间
*/
fun getShowTime(): Long {
var showTime = 0L
val currentTime = System.currentTimeMillis()
val diff = (currentTime - AppConfig.splashTime) / 1000 / 60 //获取两个时间相差的分钟
// if (diff < 60) {
// showTime = 60 - diff
// } else {
// showTime = 59
// AppConfig.splashTime = currentTime
// }
if (diff < 10) {
showTime = 10 - diff
} else { } else {
showTime = 9 tv_dialog_vip_count.text = SpanUtils()
AppConfig.splashTime = currentTime .append(""+vipBean.price)
.setFontSize(30, true)
.append(" 元")
.setFontSize(16, true)
.create()
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
} }
return showTime * 60 * 1000
}
/**
* 设置同意协议
*/
fun getCheckboxStatus(): Boolean {
return cbVipAgreement.isChecked
}
/**
* 设置同意协议
*/
fun setCheckboxTrue() {
cbVipAgreement.isChecked = true
} }
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.bumptech.glide.request.transition.Transition ...@@ -15,6 +15,7 @@ import com.bumptech.glide.request.transition.Transition
import com.bumptech.glide.signature.ObjectKey import com.bumptech.glide.signature.ObjectKey
import com.mints.enjoyboxjia.utils.BubbleUtils import com.mints.enjoyboxjia.utils.BubbleUtils
import com.scwang.smartrefresh.layout.util.DensityUtil.px2dp import com.scwang.smartrefresh.layout.util.DensityUtil.px2dp
import jp.wasabeef.glide.transformations.BlurTransformation
/** /**
* 描述:GlideUtils * 描述:GlideUtils
...@@ -40,6 +41,45 @@ object GlideUtils { ...@@ -40,6 +41,45 @@ object GlideUtils {
Glide.with(mContext!!).load(path).into(mImageView!!) Glide.with(mContext!!).load(path).into(mImageView!!)
} }
//加载毛玻璃图片
fun loadBlurImageView(mContext: Context, url: String, imageView: ImageView) {
Glide.with(mContext).load(url)
.apply(RequestOptions.bitmapTransform(BlurTransformation(25, 4)))
.into(imageView)
}
fun loadImageViewGifForCenterCrop(mContext: Context, drawable: String, imageView: ImageView) {
val options = RequestOptions()
.transform(
CenterCrop(),
RoundedCorners(BubbleUtils.dp2px(5))
)
.diskCacheStrategy(DiskCacheStrategy.DATA)
Glide.with(mContext)
.load(drawable)
.apply(options)
.into(imageView)
}
fun loadImageViewGifForCenterCrop(
mContext: Context,
drawable: String,
imageView: ImageView,
dp: Int
) {
val options = RequestOptions()
.transform(
CenterCrop(),
RoundedCorners(BubbleUtils.dp2px(dp))
)
.diskCacheStrategy(DiskCacheStrategy.DATA)
Glide.with(mContext)
.load(drawable)
.apply(options)
.into(imageView)
}
fun loadImageViewFake(mContext: Context?, path: Any?, mImageView: ImageView?) { fun loadImageViewFake(mContext: Context?, path: Any?, mImageView: ImageView?) {
Glide.with(mContext!!) Glide.with(mContext!!)
.load(path) .load(path)
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#50000000" />
<corners android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#fef3f3"
android:endColor="#F8F8F8"
android:angle="270"/>
</shape>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<!-- 填充的颜色 --> <!-- 填充的颜色 -->
<solid android:color="#5B1500" /> <solid android:color="#FAD198" />
<!-- 设置按钮的四个角为弧形 --> <!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 --> <!-- android:radius 弧形的半径 -->
<corners android:radius="30dip" /> <corners android:radius="30dip" />
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<!-- 填充的颜色 --> <!-- 填充的颜色 -->
<stroke android:width="1dp" android:color="#FA57D7" /> <stroke android:width="2dp" android:color="#EFBC6A" />
<solid android:color="#282537" /> <solid android:color="@color/black" />
<!-- 设置按钮的四个角为弧形 --> <!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 --> <!-- android:radius 弧形的半径 -->
<corners android:radius="15dip" /> <corners android:radius="5dip" />
</shape> </shape>
\ No newline at end of file
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<!-- 填充的颜色 --> <!-- 填充的颜色 -->
<solid android:color="#282537" />
<solid android:color="@color/black" />
<!-- 设置按钮的四个角为弧形 --> <!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 --> <!-- android:radius 弧形的半径 -->
<corners android:radius="15dip" /> <corners android:radius="5dip" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:centerColor="@color/half_transparent"
android:centerX="0.5"
android:centerY="0.5"
android:endColor="@color/black"
android:gradientRadius="200dp"
android:startColor="@color/full_transparent"
android:type="radial" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<gradient
android:angle="180"
android:endColor="#f2d6a4"
android:startColor="#efbc6a" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="30dp"
/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<gradient
android:angle="180"
android:endColor="#f2d6a4"
android:startColor="#efbc6a" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp"
/>
</shape>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<TextView
android:id="@+id/bannerTitle"
android:layout_width="match_parent"
android:layout_height="32dp"
android:ellipsize="marquee"
android:focusable="true"
android:background="@drawable/bg_shape_twoban"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:singleLine="true"
android:textSize="14sp"
android:textColor="#ffffff"
android:paddingLeft="10dp"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
\ No newline at end of file
...@@ -2,8 +2,32 @@ ...@@ -2,8 +2,32 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@drawable/shape_mine"
android:orientation="vertical"> android:orientation="vertical">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srlMainPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="@color/color_FDFDFD">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_count_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="600dp"
android:overScrollMode="never" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="@color/color_FDFDFD" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/ic_vip_selected"
android:scaleType="fitXY" />
<TextView
android:visibility="gone"
android:id="@+id/bannerTitle"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="60dp"
android:background="@mipmap/ic_vip_lable"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/color_815136"
android:textSize="12sp" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/rlVipItemRoot" android:id="@+id/rlVipItemRoot"
android:layout_width="110dp" android:layout_width="match_parent"
android:layout_height="150dp" android:layout_height="110dp"
android:layout_margin="10dp" android:layout_marginTop="8dp"
android:background="@drawable/shape_vip_adapter_none" android:background="@drawable/shape_vip_adapter_none"
android:orientation="vertical"> android:orientation="vertical">
<TextView <RelativeLayout
android:id="@+id/tvVipItemLable" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_marginTop="-8dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@mipmap/ic_vip_lable" android:layout_gravity="center_vertical">
android:gravity="center"
android:paddingLeft="6dp"
android:paddingTop="2dp"
android:paddingRight="6dp"
android:paddingBottom="2dp"
android:textColor="@color/black"
android:textSize="12sp"
tools:text="包年会员" />
<TextView <TextView
android:id="@+id/tvVipItemTitle" android:id="@+id/tvVipItemTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp" android:layout_marginLeft="18dp"
android:textColor="@color/white" android:textColor="#efbc6a"
android:textSize="18sp" android:textSize="20sp"
android:layout_centerVertical="true"
android:textStyle="bold"
tools:text="包年会员" /> tools:text="包年会员" />
<TextView <TextView
android:id="@+id/tvVipItemCurMoney" android:id="@+id/tvVipItemCurMoney"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_centerVertical="true"
android:layout_marginTop="10dp" android:layout_alignParentRight="true"
android:layout_marginRight="18dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="#efbc6a"
android:textSize="24sp" android:textSize="16sp"
android:textStyle="bold"
tools:text="$78" /> tools:text="$78" />
</RelativeLayout>
<TextView <TextView
android:id="@+id/tvVipItemMoney" android:id="@+id/tvVipItemMoney"
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_gravity="bottom"
android:background="@drawable/shape_vip_lable"
android:gravity="center"
android:textColor="#A24240"
android:textSize="12sp"
tools:text="原价:123" />
</FrameLayout>
<TextView
android:id="@+id/tvVipItemLable"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:background="@mipmap/ic_vip_lable"
android:layout_marginTop="10dp" android:gravity="center"
android:layout_marginBottom="16dp" android:paddingLeft="6dp"
android:textColor="@color/color_939AA3" android:paddingTop="2dp"
android:paddingRight="6dp"
android:paddingBottom="2dp"
android:textColor="@color/color_815136"
android:textSize="14sp" android:textSize="14sp"
tools:text="原价:123" /> tools:text="包年会员" />
</FrameLayout>
</LinearLayout> \ No newline at end of file
\ No newline at end of file
book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png

24.8 KB | W: | H:

book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png

76.9 KB | W: | H:

book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png
book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png
book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png
book/app/src/main/res/mipmap-xhdpi/bg_my_vip.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<color name="color_FDFDFD">#FDFDFD</color> <color name="color_FDFDFD">#FDFDFD</color>
<color name="color_8B560F">#8B560F</color> <color name="color_8B560F">#8B560F</color>
<color name="red_e73a3d">#e73a3d</color> <color name="red_e73a3d">#e73a3d</color>
<color name="half_transparent">#80000000</color>
<color name="id_photo_gray">#E0E4E7</color> <color name="id_photo_gray">#E0E4E7</color>
<color name="color_815136">#815136</color>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment