Commit 17282d82 authored by mengcuiguang's avatar mengcuiguang

优化书库vip界面等

parent ecfade87
{"v":"5.9.6","fr":29.9700012207031,"ip":0,"op":20.0000008146167,"w":140,"h":140,"nm":"收藏-白","ddd":0,"assets":[{"id":"image_0","w":108,"h":105,"u":"images/","p":"home_cancel_collect_img_0.png","e":0},{"id":"image_1","w":108,"h":105,"u":"images/","p":"home_cancel_collect_img_1.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"收藏-黄.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[70,70,0],"ix":2,"l":2},"a":{"a":0,"k":[54,52.5,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":2,"s":[102,102,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":4,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":6,"s":[102,102,100]},{"t":12.00000048877,"s":[0,0,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":20.0000008146167,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"收藏-白.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[70,70,0],"ix":2,"l":2},"a":{"a":0,"k":[54,52.5,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":12,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":14,"s":[105,105,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":16,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":17,"s":[102,102,100]},{"t":18.000000733155,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":20.0000008146167,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{"v":"5.4.2","fr":50,"ip":0,"op":100,"w":500,"h":500,"nm":"navigation","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"navigation Outlines - Group 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.477],"y":[1]},"o":{"x":[0.768],"y":[0]},"n":["0p477_1_0p768_0"],"t":0,"s":[0],"e":[-27]},{"i":{"x":[0.435],"y":[1]},"o":{"x":[0.63],"y":[0]},"n":["0p435_1_0p63_0"],"t":25,"s":[-27],"e":[0]},{"i":{"x":[0.33],"y":[1]},"o":{"x":[0.619],"y":[0]},"n":["0p33_1_0p619_0"],"t":50,"s":[0],"e":[27]},{"i":{"x":[0.503],"y":[1]},"o":{"x":[0.622],"y":[0]},"n":["0p503_1_0p622_0"],"t":77,"s":[27],"e":[0]},{"t":99}],"ix":10},"p":{"a":0,"k":[250.281,229.995,0],"ix":2},"a":{"a":0,"k":[150.281,144.495,0],"ix":1},"s":{"a":0,"k":[110,110,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[45.583,44.635],[-0.206,-44.635],[-45.583,43.823],[-0.206,20.489]],"o":[[45.583,44.635],[-0.206,-44.635],[-45.583,43.823],[-0.206,20.489]],"v":[[45.583,44.635],[-0.206,-44.635],[-45.583,43.823],[-0.206,20.489]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.0314,0.3412,0.6275,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":1,"lj":1,"ml":10,"ml2":{"a":0,"k":10,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0,0.8667,0.702,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[150.281,144.495],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":100,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":2,"ty":4,"nm":"Merged Shape Layer","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250.25,262.648,0],"ix":2},"a":{"a":0,"k":[250.25,262.648,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[96.863,33.474],[53.496,-60.609],[-96.863,-33.474],[-53.496,60.609]],"o":[[96.863,-33.474],[-53.496,-60.609],[-96.863,33.474],[53.496,60.609]],"v":[[96.863,0],[0,-60.609],[-96.863,0],[0,60.609]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.0314,0.3412,0.6275,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":1,"lj":1,"ml":10,"ml2":{"a":0,"k":10,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[150.25,150],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 2","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[250.25,250],"ix":2},"a":{"a":0,"k":[150.25,150],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"navigation Outlines - Group 2","np":1,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-96.863,-27.952],[-96.863,-17.656],[-53.496,42.952],[96.863,15.817999999999998],[96.863,-27.952]],"o":[[-96.863,-27.952],[-96.863,15.817999999999998],[53.496,42.952],[96.863,-17.656],[96.863,-27.952]],"v":[[-96.863,-27.952],[-96.863,-17.656],[0,42.952],[96.863,-17.656],[96.863,-27.952]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.0314,0.3412,0.6275,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":1,"lj":1,"ml":10,"ml2":{"a":0,"k":10,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[150.25,182.452],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 3","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[250.25,292.953],"ix":2},"a":{"a":0,"k":[150.25,192.952],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"navigation Outlines - Group 3","np":1,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":100,"st":0,"bm":0,"completed":true}],"markers":[],"__complete":true}
\ No newline at end of file
This diff is collapsed.
package com.mints.enjoyboxjia.common package com.mints.enjoyboxjia.common
import com.mints.enjoyboxjia.BuildConfig
import com.mints.enjoyboxjia.utils.VersionUtils
object Constant { object Constant {
const val LOAN_PERMISSION_FLAG = "loan_permission_flag" const val LOAN_PERMISSION_FLAG = "loan_permission_flag"
const val FIRST_SPLASH = "first_splash" const val FIRST_SPLASH = "first_splash"
...@@ -16,7 +19,7 @@ object Constant { ...@@ -16,7 +19,7 @@ object Constant {
const val PAGE_SIZE = 10 const val PAGE_SIZE = 10
// 协议地址 // 协议地址
var REGISTER_URL = "http://mints-web.mints-id.com/agreements/roomprophet/yhxy.html"//注册协议 var REGISTER_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/yhxy.html"//注册协议
var PRIVACY_URL = "http://mints-web.mints-id.com/agreements/roomprophet/syzc.html"//隐私协议 var PRIVACY_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/syzc.html"//隐私协议
var MEMBERS_URL = "http://mints-web.mints-id.com/agreements/roomprophet/gmxy.html"//会员付费服务协议 var MEMBERS_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/gmxy.html"//会员付费服务协议
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ public class BookBean implements Serializable { ...@@ -18,7 +18,7 @@ public class BookBean implements Serializable {
private int commentCount; private int commentCount;
private int likeCount; private int likeCount;
private int collectCount; private int collectCount;
private String isCollect; private Boolean isCollect;
private String commentContent; private String commentContent;
private String categoryName; private String categoryName;
private String categoryId; private String categoryId;
...@@ -153,14 +153,10 @@ public class BookBean implements Serializable { ...@@ -153,14 +153,10 @@ public class BookBean implements Serializable {
this.collectCount = collectCount; this.collectCount = collectCount;
} }
public String getIsCollect() { public boolean getIsCollect() {
return isCollect; return isCollect;
} }
public void setIsCollect(String isCollect) {
this.isCollect = isCollect;
}
public Object getCommentContent() { public Object getCommentContent() {
return commentContent; return commentContent;
} }
......
package com.mints.enjoyboxjia.mvp.model;
import java.io.Serializable;
import java.util.List;
/**
* @author Assen
* @date 2024/9/20
* @desc
*/
public class BookList2Bean implements Serializable {
/**
* id : 80917
* username : null
* userAvatar : null
* title : 伴娘闺蜜企图毁我婚礼
* author : 小雨
* avatar : https://mints-sh.oss-cn-shanghai.aliyuncs.com/vedioApp/coverImage/1724381017651.jpeg
* summary : 因为我知道,从一开始她就不是真心要来给我当伴娘。
* isStick : 1
* isOriginal : 1
* isPublish : 1
* quantity : 0
* commentCount : null
* likeCount : null
* collectCount : 0
* isCollect : null
* commentContent : null
* categoryName : null
* categoryId : null
* createTime : 2024-08-22 19:49:52
* lastReadTime : null
* formatCreateTime : null
* tagList : [{"id":"305","name":"都市情感","clickVolume":0,"sort":0,"createTime":"2023-12-08 19:09:46","updateTime":"2023-12-08 19:09:45","type":1},{"id":"493","name":"爱情","clickVolume":0,"sort":0,"createTime":null,"updateTime":"2024-08-20 18:27:03","type":1},{"id":"496","name":"现实生活","clickVolume":0,"sort":0,"createTime":null,"updateTime":"2024-08-20 18:27:31","type":1},{"id":"497","name":"感情","clickVolume":0,"sort":0,"createTime":null,"updateTime":"2024-08-20 18:28:40","type":1}]
* shortis : 0
* commonNum : 0
* viewPermissions : 0
* carouselUrl : null
*/
private List<BookBean> list;
public List<BookBean> getRecords() {
return list;
}
public void setRecords(List<BookBean> records) {
this.list = records;
}
}
...@@ -6,6 +6,7 @@ import com.mints.enjoyboxjia.mvp.views.PicContentView ...@@ -6,6 +6,7 @@ import com.mints.enjoyboxjia.mvp.views.PicContentView
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.mvp.model.BannerList import com.mints.enjoyboxjia.mvp.model.BannerList
import com.mints.enjoyboxjia.mvp.model.BookListBean
class PicContentPresenter : BasePresenter<PicContentView>() { class PicContentPresenter : BasePresenter<PicContentView>() {
...@@ -17,7 +18,7 @@ class PicContentPresenter : BasePresenter<PicContentView>() { ...@@ -17,7 +18,7 @@ class PicContentPresenter : BasePresenter<PicContentView>() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.getHomeV1List(vo), .call(loanService.getHomeV1List(vo),
object : BaseSubscriber<BaseResponse<BannerList>>() { object : BaseSubscriber<BaseResponse<BookListBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
} }
...@@ -28,7 +29,7 @@ class PicContentPresenter : BasePresenter<PicContentView>() { ...@@ -28,7 +29,7 @@ class PicContentPresenter : BasePresenter<PicContentView>() {
view.getHomePageImageListFail() view.getHomePageImageListFail()
} }
override fun onNext(baseResponse: BaseResponse<BannerList>) { override fun onNext(baseResponse: BaseResponse<BookListBean>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
......
...@@ -245,9 +245,12 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -245,9 +245,12 @@ class VipPresenter : BasePresenter<VipView>() {
} }
fun orders() { fun orders() {
val vo = HashMap<String, Any>()
vo["flag"] = "newbook"
vo["quantity"] = "8"
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.orders(), .call(loanService.getRecommendV1(vo),
object : BaseSubscriber<BaseResponse<BannerList>>() { object : BaseSubscriber<BaseResponse<BookListBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
} }
...@@ -256,7 +259,7 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -256,7 +259,7 @@ class VipPresenter : BasePresenter<VipView>() {
if (isLinkView) return if (isLinkView) return
} }
override fun onNext(baseResponse: BaseResponse<BannerList>) { override fun onNext(baseResponse: BaseResponse<BookListBean>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
......
...@@ -6,20 +6,25 @@ import com.mints.library.net.neterror.Throwable ...@@ -6,20 +6,25 @@ import com.mints.library.net.neterror.Throwable
import com.mints.enjoyboxjia.manager.AppHttpManager import com.mints.enjoyboxjia.manager.AppHttpManager
import com.mints.enjoyboxjia.mvp.model.BannerList 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.BookList2Bean
import com.mints.enjoyboxjia.mvp.model.BookListBean
import com.mints.enjoyboxjia.mvp.views.WatchRecordView import com.mints.enjoyboxjia.mvp.views.WatchRecordView
import java.util.HashMap import java.util.HashMap
class WatchRecordPresenter : BasePresenter<WatchRecordView>() { class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
fun getHistory() { fun getHistory() {
val vo = hashMapOf<String, Any>()
vo["page"] = 1
vo["size"] = 100
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.history(), object : BaseSubscriber<BaseResponse<BannerList>>() { .call(loanService.history(vo), object : BaseSubscriber<BaseResponse<BookList2Bean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
} }
override fun onNext(baseResponse: BaseResponse<BannerList>) { override fun onNext(baseResponse: BaseResponse<BookList2Bean>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -47,9 +52,9 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() { ...@@ -47,9 +52,9 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
} }
fun collect(videoId: String) { fun collect(articleId: String) {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["vedioId"] = videoId vo["articleId"] = articleId
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.collect(vo), object : BaseSubscriber<BaseResponse<JsonObject>>() { .call(loanService.collect(vo), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() { override fun onCompleted() {
...@@ -85,9 +90,9 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() { ...@@ -85,9 +90,9 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
} }
fun cancelCollect(videoId: String) { fun cancelCollect(articleId: String) {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["vedioId"] = videoId vo["articleId"] = articleId
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call( .call(
loanService.collectCancel(vo), loanService.collectCancel(vo),
......
...@@ -3,6 +3,6 @@ package com.mints.enjoyboxjia.mvp.views ...@@ -3,6 +3,6 @@ package com.mints.enjoyboxjia.mvp.views
import com.mints.enjoyboxjia.mvp.model.* import com.mints.enjoyboxjia.mvp.model.*
interface PicContentView : BaseView { interface PicContentView : BaseView {
fun getHomePageImageListSuc(data: BannerList) fun getHomePageImageListSuc(data: BookListBean)
fun getHomePageImageListFail() fun getHomePageImageListFail()
} }
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.*
import com.mints.enjoyboxjia.mvp.model.UserBean
import com.mints.enjoyboxjia.mvp.model.VipBean
import com.mints.enjoyboxjia.mvp.model.WxPayParamBean
interface VipView : BaseView { interface VipView : BaseView {
fun getVipProductSuc(data: VipBean) fun getVipProductSuc(data: VipBean)
...@@ -11,5 +8,5 @@ interface VipView : BaseView { ...@@ -11,5 +8,5 @@ interface VipView : BaseView {
fun queryVipOrderSuc(isPay:Boolean) fun queryVipOrderSuc(isPay:Boolean)
fun getUserSuc(data: UserBean) fun getUserSuc(data: UserBean)
fun ordersSuc(data: BannerList?) fun ordersSuc(data: BookListBean?)
} }
\ No newline at end of file
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.BookList2Bean
import com.mints.enjoyboxjia.mvp.model.BookListBean
interface WatchRecordView : BaseView { interface WatchRecordView : BaseView {
fun getHistorySuc(historyBean: BannerList) fun getHistorySuc(historyBean: BookList2Bean)
fun getHistoryFail() fun getHistoryFail()
fun collectSuc() fun collectSuc()
......
...@@ -6,6 +6,7 @@ import com.google.gson.JsonObject; ...@@ -6,6 +6,7 @@ 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.BannerList;
import com.mints.enjoyboxjia.mvp.model.BaseResponse; import com.mints.enjoyboxjia.mvp.model.BaseResponse;
import com.mints.enjoyboxjia.mvp.model.BookList2Bean;
import com.mints.enjoyboxjia.mvp.model.HotBookTypeList; import com.mints.enjoyboxjia.mvp.model.HotBookTypeList;
import com.mints.enjoyboxjia.mvp.model.BookContentBean; import com.mints.enjoyboxjia.mvp.model.BookContentBean;
import com.mints.enjoyboxjia.mvp.model.BookListBean; import com.mints.enjoyboxjia.mvp.model.BookListBean;
...@@ -145,12 +146,12 @@ public interface LoanService { ...@@ -145,12 +146,12 @@ public interface LoanService {
Observable<BaseResponse<BannerList>> orders(); Observable<BaseResponse<BannerList>> orders();
/** /**
* 历史记录 * 阅读记录
* *
* @return * @return
*/ */
@POST("api/vedioV1/history") @POST("api/book/readRecordList")
Observable<BaseResponse<BannerList>> history(); Observable<BaseResponse<BookList2Bean>> history(@Body Map<String, Object> vo);
/** /**
...@@ -183,7 +184,7 @@ public interface LoanService { ...@@ -183,7 +184,7 @@ public interface LoanService {
* @return * @return
*/ */
@POST("api/book/articleList") @POST("api/book/articleList")
Observable<BaseResponse<BannerList>> getHomeV1List(@Body Map<String, Object> vo); Observable<BaseResponse<BookListBean>> getHomeV1List(@Body Map<String, Object> vo);
/** /**
* 书库分类 * 书库分类
......
...@@ -34,6 +34,10 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -34,6 +34,10 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.activity_settings
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
initLayout() initLayout()
...@@ -158,9 +162,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -158,9 +162,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
item_cancel.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE item_cancel.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
} }
override fun getContentViewLayoutID() = R.layout.activity_settings
override fun isApplyKitKatTranslucency() = false
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
......
...@@ -255,9 +255,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -255,9 +255,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} }
} }
override fun ordersSuc(data: BannerList?) { override fun ordersSuc(data: BookListBean?) {
data?.let { data?.let {
setBanner(it.list) setBanner(it.records)
} }
} }
...@@ -642,7 +642,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -642,7 +642,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
cdaa.show() cdaa.show()
} }
private fun setBanner(data: List<VedioBean>) { private fun setBanner(data: List<BookBean>) {
mainHandler.postDelayed({ mainHandler.postDelayed({
val scrollToBottomAnimator = val scrollToBottomAnimator =
ValueAnimator.ofInt(0, nsv.getChildAt(0).height - nsv.height) ValueAnimator.ofInt(0, nsv.getChildAt(0).height - nsv.height)
...@@ -678,13 +678,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -678,13 +678,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} }
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
GlideUtils.loadBlurImageView(mContext, data[position].coverImage, iv_blur) GlideUtils.loadBlurImageView(mContext, data[position].avatar, iv_blur)
tv_banner_title.text = String.format("《%1s》", data[position].title) tv_banner_title.text = String.format("《%1s》", data[position].title)
} }
override fun onPageScrollStateChanged(state: Int) {} override fun onPageScrollStateChanged(state: Int) {}
}) })
GlideUtils.loadBlurImageView(mContext, data[0].coverImage, iv_blur) GlideUtils.loadBlurImageView(mContext, data[0].avatar, iv_blur)
tv_banner_title.text = String.format("《%1s》", data[0].title) tv_banner_title.text = String.format("《%1s》", data[0].title)
} }
......
package com.mints.enjoyboxjia.ui.activitys package com.mints.enjoyboxjia.ui.activitys
import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.mvp.model.BannerList import com.mints.enjoyboxjia.mvp.model.*
import com.mints.enjoyboxjia.mvp.model.VedioBean
import com.mints.enjoyboxjia.mvp.presenters.WatchRecordPresenter import com.mints.enjoyboxjia.mvp.presenters.WatchRecordPresenter
import com.mints.enjoyboxjia.mvp.views.WatchRecordView import com.mints.enjoyboxjia.mvp.views.WatchRecordView
import com.mints.enjoyboxjia.ui.activitys.base.BaseActivity import com.mints.enjoyboxjia.ui.activitys.base.BaseActivity
import com.mints.enjoyboxjia.ui.adapter.WatchRecordAdapter import com.mints.enjoyboxjia.ui.adapter.WatchRecordAdapter
import com.mints.enjoyboxjia.ui.widgets.StickHeaderDecoration
import kotlinx.android.synthetic.main.activity_watch_record.* import kotlinx.android.synthetic.main.activity_watch_record.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
...@@ -19,14 +18,14 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView { ...@@ -19,14 +18,14 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
private val watchRecordPresenter by lazy { WatchRecordPresenter() } private val watchRecordPresenter by lazy { WatchRecordPresenter() }
private var mWatchRecordAdapter: WatchRecordAdapter? = null private var mWatchRecordAdapter: WatchRecordAdapter? = null
private var datas = mutableListOf<VedioBean>() private var datas = mutableListOf<BookBean>()
override fun getContentViewLayoutID() = R.layout.activity_watch_record override fun getContentViewLayoutID() = R.layout.activity_watch_record
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
watchRecordPresenter.attachView(this) watchRecordPresenter.attachView(this)
tv_title.text = "观看记录" tv_title.text = "阅读记录"
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.setOnClickListener { finish() } iv_left_icon.setOnClickListener { finish() }
...@@ -38,26 +37,22 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView { ...@@ -38,26 +37,22 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
mWatchRecordAdapter?.setEmptyView(emptyView) mWatchRecordAdapter?.setEmptyView(emptyView)
mWatchRecordAdapter?.setNewInstance(datas) mWatchRecordAdapter?.setNewInstance(datas)
mWatchRecordAdapter?.setOnItemClickListener { adapter, view, position -> mWatchRecordAdapter?.setOnItemClickListener { adapter, view, position ->
// LocalVedioManager.startVedioDetailActivityForType( val bundle = Bundle()
// this@WatchRecordActivity, bundle.putString(BookReadActivity.BOOK_ID, datas.get(position).id)
// datas[position] readyGo(BookReadActivity::class.java, bundle)
// )
} }
mWatchRecordAdapter?.setOnItemCollectClickListener(object : mWatchRecordAdapter?.setOnItemCollectClickListener(object :
WatchRecordAdapter.OnItemCollectClickListener { WatchRecordAdapter.OnItemCollectClickListener {
override fun onItemCollectClick(position: Int) { override fun onItemCollectClick(bean: BookBean) {
if (datas[position].collect == 0) { if (!bean.isCollect) {
datas[position].collect = 1 watchRecordPresenter.collect(bean.id)
watchRecordPresenter.collect("" + datas[position].vedioId)
} else { } else {
datas[position].collect = 0 watchRecordPresenter.cancelCollect(bean.id)
watchRecordPresenter.cancelCollect("" + datas[position].vedioId)
} }
mWatchRecordAdapter?.notifyItemChanged(position) mWatchRecordAdapter?.notifyDataSetChanged()
} }
}) })
rv_watch_record.layoutManager = LinearLayoutManager(this) rv_watch_record.layoutManager = LinearLayoutManager(this)
rv_watch_record.addItemDecoration(StickHeaderDecoration(this))
rv_watch_record.adapter = mWatchRecordAdapter rv_watch_record.adapter = mWatchRecordAdapter
} }
...@@ -68,13 +63,10 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView { ...@@ -68,13 +63,10 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
watchRecordPresenter.detachView() watchRecordPresenter.detachView()
} }
override fun getHistorySuc(historyBean: BannerList) { override fun getHistorySuc(historyBean: BookList2Bean) {
// datas.clear() // datas.clear()
val data = historyBean.list this.datas = historyBean.records
for (datum in data) { mWatchRecordAdapter?.setNewInstance(historyBean.records)
// datum.topTabsReamrk = TimeHelp.format(datum.seeUpdateTime * 1000)
datas.add(datum)
}
mWatchRecordAdapter?.notifyDataSetChanged() mWatchRecordAdapter?.notifyDataSetChanged()
} }
......
package com.mints.enjoyboxjia.ui.adapter package com.mints.enjoyboxjia.ui.adapter
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.view.View import android.view.View
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.core.content.ContextCompat
import com.airbnb.lottie.LottieAnimationView
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.mvp.model.VedioBean import com.mints.enjoyboxjia.mvp.model.BookBean
import com.mints.enjoyboxjia.ui.adapter.base.OnItemClickListener import com.mints.enjoyboxjia.ui.adapter.base.OnItemClickListener
import com.mints.enjoyboxjia.utils.RoundBackgroundColorSpan
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
class CountAdapter : class CountAdapter :
BaseQuickAdapter<VedioBean, BaseViewHolder>(R.layout.item_list_orderrecord) { BaseQuickAdapter<BookBean, BaseViewHolder>(R.layout.item_list_count) {
override fun convert(holder: BaseViewHolder, item: VedioBean) { override fun convert(holder: BaseViewHolder, item: BookBean) {
// GlideUtils.loadImageViewNoAnim2(context, item.coverImage, holder.getView(R.id.image_iv)) holder.getView<TextView>(R.id.title_tv).text = item.title
holder.getView<TextView>(R.id.title_tv).text = "123123" holder.getView<TextView>(R.id.info_tv).text = item.summary
// holder.getView<TextView>(R.id.info_tv).text = "观看至第${item.seeIndex}集" if (item.tagList != null && item.tagList.size > 0) {
// val span = SpannableStringBuilder()
// if (item.collect == 0) {
// // 未收藏 for (i in 0 until item.tagList.size) {
// holder.getView<LottieAnimationView>(R.id.iv_collect) val labelText = SpannableString(" " + item.tagList[i].name + " ")
// .setImageResource(R.mipmap.home_collect_img_0) val start = 0
// } else { val end = item.tagList[i].name.length + 4
// // 已收藏
// holder.getView<LottieAnimationView>(R.id.iv_collect) labelText.setSpan(
// .setImageResource(R.mipmap.home_collect_img_1) RoundBackgroundColorSpan(
// } ContextCompat.getColor(context, R.color.color_FEF3F3),
ContextCompat.getColor(context, R.color.color_F1413C)
), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
span.append(labelText)
}
holder.getView<TextView>(R.id.label_tv).text = span
}
GlideUtils.loadImageViewNoAnim2(context, item.avatar, holder.getView(R.id.image_iv))
holder.getView<LinearLayout>(R.id.ll_count_root).setOnClickListener {
mOnItemClickListener?.onItemClick(item)
}
} }
private var mOnItemClickListener: OnItemClickListener? = null private var mOnItemClickListener: OnCountItemClickListener? = null
fun setOnItemClickListener(listener: OnItemClickListener) { fun setOnCountItemClickListener(listener: OnCountItemClickListener) {
mOnItemClickListener = listener mOnItemClickListener = listener
} }
interface OnCountItemClickListener {
fun onItemClick(bean: BookBean)
}
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ package com.mints.enjoyboxjia.ui.adapter ...@@ -3,7 +3,7 @@ package com.mints.enjoyboxjia.ui.adapter
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
import com.mints.enjoyboxjia.mvp.model.BookTypeBean import com.mints.enjoyboxjia.mvp.model.BookTypeBean
import com.mints.enjoyboxjia.ui.fragment.MovieFragment import com.mints.enjoyboxjia.ui.fragment.BookListFragment
class HomeVideoPageAdapter( class HomeVideoPageAdapter(
private val data: List<BookTypeBean>, private val data: List<BookTypeBean>,
...@@ -20,7 +20,7 @@ class HomeVideoPageAdapter( ...@@ -20,7 +20,7 @@ class HomeVideoPageAdapter(
override fun getItemCount() = data.size override fun getItemCount() = data.size
override fun createFragment(position: Int): Fragment { override fun createFragment(position: Int): Fragment {
val newFragment = MovieFragment.newInstance(data[position].id.toInt(),position) val newFragment = BookListFragment.newInstance(data[position].id.toInt(),position)
fragments[position] = newFragment fragments[position] = newFragment
return newFragment return newFragment
} }
......
...@@ -5,17 +5,18 @@ import android.view.LayoutInflater; ...@@ -5,17 +5,18 @@ import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
import com.mints.enjoyboxjia.R; import com.mints.enjoyboxjia.R;
import com.mints.enjoyboxjia.mvp.model.BookBean;
import com.mints.enjoyboxjia.mvp.model.VedioBean; import com.mints.enjoyboxjia.mvp.model.VedioBean;
import com.mints.library.utils.GlideUtils; import com.mints.library.utils.GlideUtils;
import com.youth.banner.adapter.BannerAdapter; import com.youth.banner.adapter.BannerAdapter;
import java.util.List; import java.util.List;
public class VipBannerAdapter extends BannerAdapter<VedioBean, ImageTitleHolder> { public class VipBannerAdapter extends BannerAdapter<BookBean, ImageTitleHolder> {
private Context context; private Context context;
public VipBannerAdapter(List<VedioBean> data) { public VipBannerAdapter(List<BookBean> data) {
super(data); super(data);
} }
...@@ -26,9 +27,9 @@ public class VipBannerAdapter extends BannerAdapter<VedioBean, ImageTitleHolder> ...@@ -26,9 +27,9 @@ public class VipBannerAdapter extends BannerAdapter<VedioBean, ImageTitleHolder>
} }
@Override @Override
public void onBindView(ImageTitleHolder holder, VedioBean data, int position, int size) { public void onBindView(ImageTitleHolder holder, BookBean data, int position, int size) {
if (data.getCoverImage() != null) { if (data.getAvatar() != null) {
GlideUtils.INSTANCE.loadImageViewGifForCenterCrop(context, data.getCoverImage(), holder.imageView, 15); GlideUtils.INSTANCE.loadImageViewGifForCenterCrop(context, data.getAvatar(), holder.imageView, 15);
} }
holder.title.setText(data.getTitle()); holder.title.setText(data.getTitle());
} }
......
...@@ -8,67 +8,29 @@ import com.airbnb.lottie.LottieCompositionFactory ...@@ -8,67 +8,29 @@ import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable import com.airbnb.lottie.LottieDrawable
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mints.library.utils.GlideUtils
import com.mints.enjoyboxjia.R import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.mvp.model.VedioBean import com.mints.enjoyboxjia.mvp.model.BookBean
class WatchRecordAdapter : class WatchRecordAdapter :
BaseQuickAdapter<VedioBean, BaseViewHolder>(R.layout.item_watch_record) { BaseQuickAdapter<BookBean, BaseViewHolder>(R.layout.item_watch_record) {
override fun convert(holder: BaseViewHolder, item: VedioBean) { override fun convert(holder: BaseViewHolder, item: BookBean) {
GlideUtils.loadImageViewNoAnim2(context, item.coverImage, holder.getView(R.id.image_iv))
holder.getView<TextView>(R.id.title_tv).text = item.title
holder.getView<TextView>(R.id.info_tv).text = "观看至第${item.seeIndex}集"
if (item.collect == 0) { holder.getView<TextView>(R.id.tv_watch_title).text = item.title
// 未收藏 holder.getView<TextView>(R.id.tv_watch_text).text = item.summary
holder.getView<LottieAnimationView>(R.id.iv_collect) holder.getView<TextView>(R.id.tv_watch_user).text = item.author
.setImageResource(R.mipmap.home_collect_img_0)
} else {
// 已收藏
holder.getView<LottieAnimationView>(R.id.iv_collect)
.setImageResource(R.mipmap.home_collect_img_1)
}
holder.getView<View>(R.id.ll_collect).setOnClickListener { holder.getView<View>(R.id.ll_collect).setOnClickListener {
if (item.collect == 0) { if (!item.isCollect) {
mOnItemCollectClickListener?.onItemCollectClick(holder.adapterPosition) mOnItemCollectClickListener?.onItemCollectClick(item)
playCollectAnim(holder.getView(R.id.iv_collect)) playCollectAnim(holder.getView(R.id.iv_collect))
} else { } else {
mOnItemCollectClickListener?.onItemCollectClick(holder.adapterPosition) mOnItemCollectClickListener?.onItemCollectClick(item)
playCancelCollectAnim(holder.getView(R.id.iv_collect)) playCancelCollectAnim(holder.getView(R.id.iv_collect))
} }
} }
} }
/**
* 判断position对应的Item是否是组的第一项
*
* @param position
* @return
*/
fun isItemHeader(position: Int): Boolean {
if (data.size == 0 || position >= data.size) return false
return if (position == 0) {
true
} else {
val lastGroupName: String = data[position - 1].topTabsReamrk
val currentGroupName: String = data[position].topTabsReamrk
//判断上一个数据的组别和下一个数据的组别是否一致,如果不一致则是不同组,也就是为第一项(头部)
lastGroupName != currentGroupName
}
}
/**
* 获取position对应的Item组名
*
* @param position
* @return
*/
fun getGroupName(position: Int): String {
if (data.size == 0) return ""
return data[position].topTabsReamrk
}
private fun playCollectAnim(view: LottieAnimationView) { private fun playCollectAnim(view: LottieAnimationView) {
val lottieDrawable = LottieDrawable() val lottieDrawable = LottieDrawable()
...@@ -101,8 +63,7 @@ class WatchRecordAdapter : ...@@ -101,8 +63,7 @@ class WatchRecordAdapter :
} }
interface OnItemCollectClickListener { interface OnItemCollectClickListener {
fun onItemCollectClick(position: Int) fun onItemCollectClick(bean:BookBean)
} }
} }
\ No newline at end of file
...@@ -7,8 +7,11 @@ import com.mints.enjoyboxjia.R ...@@ -7,8 +7,11 @@ import com.mints.enjoyboxjia.R
import com.mints.enjoyboxjia.ad.express.MainExpressManager import com.mints.enjoyboxjia.ad.express.MainExpressManager
import com.mints.enjoyboxjia.common.Constant import com.mints.enjoyboxjia.common.Constant
import com.mints.enjoyboxjia.mvp.model.BannerList import com.mints.enjoyboxjia.mvp.model.BannerList
import com.mints.enjoyboxjia.mvp.model.BookBean
import com.mints.enjoyboxjia.mvp.model.BookListBean
import com.mints.enjoyboxjia.mvp.presenters.PicContentPresenter import com.mints.enjoyboxjia.mvp.presenters.PicContentPresenter
import com.mints.enjoyboxjia.mvp.views.PicContentView import com.mints.enjoyboxjia.mvp.views.PicContentView
import com.mints.enjoyboxjia.ui.activitys.BookReadActivity
import com.mints.enjoyboxjia.ui.adapter.CountAdapter import com.mints.enjoyboxjia.ui.adapter.CountAdapter
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.api.RefreshLayout
...@@ -16,10 +19,15 @@ import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener ...@@ -16,10 +19,15 @@ import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.scwang.smartrefresh.layout.listener.OnRefreshListener import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_movie.* import kotlinx.android.synthetic.main.fragment_movie.*
class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener, OnLoadMoreListener { /**
* 书库-列表
*/
class BookListFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener,
OnLoadMoreListener {
private var mType = 0 private var mType = 0
private var mPosition = 0 // 首页-第一个tab-第一个recyclerview Item private var mPosition = 0 // 首页-第一个tab-第一个recyclerview Item
private var hotBookData: MutableList<BookBean> = mutableListOf()
companion object { companion object {
private const val VIDEO_TYPE = "VIDEO_TYPE" private const val VIDEO_TYPE = "VIDEO_TYPE"
...@@ -29,7 +37,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener, ...@@ -29,7 +37,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener,
val args = Bundle() val args = Bundle()
args.putInt(VIDEO_TYPE, type) args.putInt(VIDEO_TYPE, type)
args.putInt(VIDEO_POSITION, position) args.putInt(VIDEO_POSITION, position)
val fragment = MovieFragment() val fragment = BookListFragment()
fragment.arguments = args fragment.arguments = args
return fragment return fragment
} }
...@@ -77,7 +85,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener, ...@@ -77,7 +85,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener,
picContentPresenter.getHomePageImageList(mType, hotPage, hotPageSize) picContentPresenter.getHomePageImageList(mType, hotPage, hotPageSize)
} }
override fun getHomePageImageListSuc(data: BannerList) { override fun getHomePageImageListSuc(data: BookListBean) {
if (activity == null || requireActivity().isFinishing) { if (activity == null || requireActivity().isFinishing) {
srlMainPage?.finishRefresh(true) srlMainPage?.finishRefresh(true)
return return
...@@ -86,14 +94,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener, ...@@ -86,14 +94,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener,
if (::hotStyleAdapter.isInitialized) { if (::hotStyleAdapter.isInitialized) {
if (hotPage == 1) { if (hotPage == 1) {
srlMainPage.finishRefresh(true) srlMainPage.finishRefresh(true)
hotStyleAdapter.setNewInstance(data.list) hotStyleAdapter.setNewInstance(data.records)
} else { } else {
if (data.list.size < hotPageSize) { if (data.records.size < hotPageSize) {
srlMainPage.finishLoadMoreWithNoMoreData() srlMainPage.finishLoadMoreWithNoMoreData()
} else { } else {
srlMainPage.finishLoadMore() srlMainPage.finishLoadMore()
} }
hotStyleAdapter.addData(data.list) hotStyleAdapter.addData(data.records)
} }
} }
} }
...@@ -108,6 +116,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener, ...@@ -108,6 +116,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnRefreshListener,
hotStyleAdapter = CountAdapter() hotStyleAdapter = CountAdapter()
hotStyleAdapter.animationEnable = false hotStyleAdapter.animationEnable = false
rv_pic_list.adapter = hotStyleAdapter rv_pic_list.adapter = hotStyleAdapter
hotStyleAdapter?.setOnCountItemClickListener(object :
CountAdapter.OnCountItemClickListener {
override fun onItemClick(bean: BookBean) {
val bundle = Bundle()
bundle.putString(BookReadActivity.BOOK_ID, bean.id)
readyGo(BookReadActivity::class.java, bundle)
}
})
} }
private fun initListener() { private fun initListener() {
......
...@@ -104,7 +104,7 @@ public class CycleProgress extends View { ...@@ -104,7 +104,7 @@ public class CycleProgress extends View {
pathMeasure.getSegment(0, pathMeasure.getLength() * mAnimatorValue, dstPath, true); pathMeasure.getSegment(0, pathMeasure.getLength() * mAnimatorValue, dstPath, true);
//渐变 //渐变
Shader mShader = new LinearGradient(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth, mHeight - mStrokeWidth / 2, Shader mShader = new LinearGradient(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth, mHeight - mStrokeWidth / 2,
Color.parseColor("#187CFB"), Color.parseColor("#187CFB"), Shader.TileMode.REPEAT); Color.parseColor("#F1413C"), Color.parseColor("#F1413C"), Shader.TileMode.REPEAT);
//遮罩 //遮罩
mProgressPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); mProgressPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
mProgressPaint.setShader(mShader); mProgressPaint.setShader(mShader);
......
package com.mints.enjoyboxjia.ui.widgets;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mints.enjoyboxjia.ui.adapter.WatchRecordAdapter;
/**
* 自定义装饰器(实现分组+吸顶效果)
* Create by: chenWei.li
* Date: 2018/11/2
* Time: 上午1:14
* Email: lichenwei.me@foxmail.com
*/
public class StickHeaderDecoration extends RecyclerView.ItemDecoration {
//头部的高
private int mItemHeaderHeight;
private int mTextPaddingLeft;
//画笔,绘制头部和分割线
private Paint mItemHeaderPaint;
private Paint mTextPaint;
private Paint mLinePaint;
private Rect mTextRect;
public StickHeaderDecoration(Context context) {
mItemHeaderHeight = dp2px(context, 40);
mTextPaddingLeft = dp2px(context, 10);
mTextRect = new Rect();
mItemHeaderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mItemHeaderPaint.setColor(Color.WHITE);
mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextSize(46);
mTextPaint.setColor(Color.BLACK);
mLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mLinePaint.setColor(Color.GRAY);
}
/**
* 绘制Item的分割线和组头
*
* @param c
* @param parent
* @param state
*/
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (parent.getAdapter() instanceof WatchRecordAdapter) {
WatchRecordAdapter adapter = (WatchRecordAdapter) parent.getAdapter();
int count = parent.getChildCount();//获取可见范围内Item的总数
for (int i = 0; i < count; i++) {
View view = parent.getChildAt(i);
int position = parent.getChildLayoutPosition(view);
boolean isHeader = adapter.isItemHeader(position);
int left = parent.getPaddingLeft();
int right = parent.getWidth() - parent.getPaddingRight();
if (isHeader) {
c.drawRect(left, view.getTop() - mItemHeaderHeight, right, view.getTop(), mItemHeaderPaint);
mTextPaint.getTextBounds(adapter.getGroupName(position), 0, adapter.getGroupName(position).length(), mTextRect);
c.drawText(adapter.getGroupName(position), left + mTextPaddingLeft, (view.getTop() - mItemHeaderHeight) + mItemHeaderHeight / 2 + mTextRect.height() / 2, mTextPaint);
} else {
// c.drawRect(left, view.getTop() - 1, right, view.getTop(), mLinePaint);
}
}
}
}
/**
* 绘制Item的顶部布局(吸顶效果)
*
* @param c
* @param parent
* @param state
*/
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (parent.getAdapter() instanceof WatchRecordAdapter) {
WatchRecordAdapter adapter = (WatchRecordAdapter) parent.getAdapter();
int position = ((LinearLayoutManager) (parent.getLayoutManager())).findFirstVisibleItemPosition();
View view = parent.findViewHolderForAdapterPosition(position).itemView;
boolean isHeader = adapter.isItemHeader(position + 1);
int top = parent.getPaddingTop();
int left = parent.getPaddingLeft();
int right = parent.getWidth() - parent.getPaddingRight();
if (isHeader) {
int bottom = Math.min(mItemHeaderHeight, view.getBottom());
c.drawRect(left, top + view.getTop() - mItemHeaderHeight, right, top + bottom, mItemHeaderPaint);
mTextPaint.getTextBounds(adapter.getGroupName(position), 0, adapter.getGroupName(position).length(), mTextRect);
c.drawText(adapter.getGroupName(position), left + mTextPaddingLeft, top + mItemHeaderHeight / 2 + mTextRect.height() / 2 - (mItemHeaderHeight - bottom), mTextPaint);
} else {
c.drawRect(left, top, right, top + mItemHeaderHeight, mItemHeaderPaint);
mTextPaint.getTextBounds(adapter.getGroupName(position), 0, adapter.getGroupName(position).length(), mTextRect);
c.drawText(adapter.getGroupName(position), left + mTextPaddingLeft, top + mItemHeaderHeight / 2 + mTextRect.height() / 2, mTextPaint);
}
c.save();
}
}
/**
* 设置Item的间距
*
* @param outRect
* @param view
* @param parent
* @param state
*/
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
if (parent.getAdapter() instanceof WatchRecordAdapter) {
WatchRecordAdapter adapter = (WatchRecordAdapter) parent.getAdapter();
int position = parent.getChildLayoutPosition(view);
boolean isHeader = adapter.isItemHeader(position);
if (isHeader) {
outRect.top = mItemHeaderHeight;
} else {
outRect.top = 1;
}
}
}
/**
* dp转换成px
*/
private int dp2px(Context context, float dpValue) {
float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
}
\ No newline at end of file
package com.mints.enjoyboxjia.utils
import android.os.Build
import com.mints.enjoyboxjia.common.Constant
object VersionUtils {
/**
* 判断是否是Android L版本
*
* @return
*/
fun isAndroidL(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
}
/**
* 判断是否是Android N版本
*
* @return
*/
fun isAndroidN(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
}
/**
* 判断是否是AndroidO版本
*
* @return
*/
fun isAndroidO(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
}
/**
* 判断是否是Android P版本
*
* @return
*/
fun isAndroidP(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
}
/**
* 判断是否是Android Q版本
*
* @return
*/
fun isAndroidQ(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
}
fun getEndPkg(): String {
var endPkg = ""
try {
val split = Constant.MINTS_PKG_NAME.split(".")
val size = split.size
endPkg = split[size - 1]
} catch (e: Exception) {
e.printStackTrace()
}
return endPkg
}
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ import com.bumptech.glide.request.RequestOptions ...@@ -13,6 +13,7 @@ import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition import com.bumptech.glide.request.transition.Transition
import com.bumptech.glide.signature.ObjectKey import com.bumptech.glide.signature.ObjectKey
import com.mints.enjoyboxjia.R
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 import jp.wasabeef.glide.transformations.BlurTransformation
...@@ -115,6 +116,14 @@ object GlideUtils { ...@@ -115,6 +116,14 @@ object GlideUtils {
) )
).dontAnimate().into(mImageView!!) ).dontAnimate().into(mImageView!!)
} }
fun loadImageViewNoAnim3(mContext: Context?, path: Any?, mImageView: ImageView?) {
Glide.with(mContext!!).load(path).apply(
RequestOptions().placeholder(R.mipmap.ic_launcher_main).transform(
CenterCrop(),
RoundedCorners(BubbleUtils.dp2px(10))
)
).dontAnimate().into(mImageView!!)
}
//设置加载中图片 //设置加载中图片
fun loadImageViewLoding( fun loadImageViewLoding(
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
layout="@layout/item_settings" /> layout="@layout/item_settings" />
<include <include
android:visibility="gone"
android:id="@+id/item_wechat" android:id="@+id/item_wechat"
layout="@layout/item_settings" /> layout="@layout/item_settings" />
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
android:paddingRight="2dp" android:paddingRight="2dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:text="用户注册协议" android:text="用户注册协议"
android:textColor="@color/main_mints" android:textColor="#4BB93F"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
android:paddingRight="2dp" android:paddingRight="2dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:text="隐私政策" android:text="隐私政策"
android:textColor="@color/main_mints" android:textColor="#4BB93F"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/main_mints" android:background="#4BB93F"
android:text="同意并进入" android:text="同意并进入"
android:textColor="@color/white" /> android:textColor="@color/white" />
</LinearLayout> </LinearLayout>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
android:paddingRight="2dp" android:paddingRight="2dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:text="用户注册协议" android:text="用户注册协议"
android:textColor="@color/main_mints" android:textColor="#4BB93F"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
android:paddingRight="2dp" android:paddingRight="2dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:text="隐私政策" android:text="隐私政策"
android:textColor="@color/main_mints" android:textColor="#4BB93F"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/main_mints" android:background="#4BB93F"
android:text="同意" android:text="同意"
android:textColor="@color/white" /> android:textColor="@color/white" />
</LinearLayout> </LinearLayout>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="20dp" android:layout_marginTop="48dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:paddingTop="-10dp" android:paddingTop="-10dp"
app:tabBackground="@null" app:tabBackground="@null"
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2" android:id="@+id/vp2"
android:layout_margin="15dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<FrameLayout 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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@drawable/shape_bg_mobile"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.scwang.smartrefresh.layout.SmartRefreshLayout <com.scwang.smartrefresh.layout.SmartRefreshLayout
...@@ -9,7 +10,7 @@ ...@@ -9,7 +10,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:srlAccentColor="@color/black" app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5"> app:srlPrimaryColor="#fef3f3">
<com.scwang.smartrefresh.layout.header.ClassicsHeader <com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -20,14 +21,13 @@ ...@@ -20,14 +21,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginLeft="14dp" android:layout_margin="12dp"
android:layout_marginRight="14dp"
android:overScrollMode="never" /> android:overScrollMode="never" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter <com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:srlAccentColor="@color/black" app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5" /> app:srlPrimaryColor="#F8F8F8" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout> </com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_count_root"
android:layout_width="match_parent"
android:layout_height="126dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/image_iv"
android:layout_width="100dp"
android:layout_height="126dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="126dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingStart="10dp">
<TextView
android:id="@+id/title_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:lines="2"
android:textStyle="bold"
android:text="我去平行时空"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:id="@+id/info_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:lines="2"
android:textColor="@color/gray"
android:textSize="16sp" />
<TextView
android:id="@+id/label_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:text="热闹" android:text="热闹"
android:gravity="center" android:gravity="center"
android:paddingTop="10dp" android:paddingTop="10dp"
android:background="@drawable/shape_book_text_none"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:textColor="@color/color_8D8F90" android:textColor="@color/color_8D8F90"
android:textSize="18sp" android:textSize="18sp"
......
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/ll_watch_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp"> android:layout_margin="10dp"
android:background="@drawable/shape_bg_write"
<ImageView android:orientation="horizontal"
android:id="@+id/image_iv" android:padding="8dp">
android:layout_width="100dp"
android:layout_height="120dp"
android:src="@mipmap/ic_launcher_main"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_weight="1">
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@id/image_iv"
app:layout_constraintStart_toEndOf="@id/image_iv"
app:layout_constraintTop_toTopOf="@id/image_iv">
<TextView <TextView
android:id="@+id/title_tv" android:id="@+id/tv_watch_title"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="重回80年代" android:layout_marginTop="4dp"
android:textColor="@color/black" /> android:lines="2"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
tools:text="我去平行时空" />
<TextView <TextView
android:id="@+id/info_tv" android:id="@+id/tv_watch_text"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxWidth="140dp"
android:maxLines="2"
android:text="重回80年代"
android:textColor="@color/gray" android:textColor="@color/gray"
android:textSize="12sp" /> android:textSize="16sp"
tools:text="123123123" />
<TextView
android:id="@+id/tv_watch_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="14sp"
tools:text="123123123" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_collect" android:id="@+id/ll_collect"
android:layout_width="wrap_content" android:layout_width="50dp"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView <com.airbnb.lottie.LottieAnimationView
android:id="@+id/iv_collect" android:id="@+id/iv_collect"
...@@ -66,9 +63,9 @@ ...@@ -66,9 +63,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:gravity="center" android:gravity="center"
android:text="追剧" android:text="收藏"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </LinearLayout>
\ No newline at end of file \ 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