diff --git a/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java b/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java index 089347d62..5174659b3 100644 --- a/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java +++ b/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java @@ -206,6 +206,17 @@ public class IMLoginModel extends BaseModel { private List> list; @SerializedName("slide") private List slide; + @SerializedName("gift_effect") + private boolean giftEffect =false; + + public boolean isGiftEffect() { + return giftEffect; + } + + public IMLoginModel setGiftEffect(boolean giftEffect) { + this.giftEffect = giftEffect; + return this; + } public String getAvatar() { return avatar; diff --git a/common/src/main/java/com/yunbao/common/bean/SlideInBannerModel.java b/common/src/main/java/com/yunbao/common/bean/SlideInBannerModel.java new file mode 100644 index 000000000..7bbc46510 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SlideInBannerModel.java @@ -0,0 +1,27 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * 获取首页banner + */ +public class SlideInBannerModel extends BaseModel { + /** + * info : [{"slide":[{"slide_pic":"https://qny.shayucm.com/20220810/81a4c030334a4a5a30eb62b84191f46d.jpg","slide_url":"https://napi.yaoulive.com/h5/monthlyActivities/202208QIXI/index.html?t=1660619212"},{"slide_pic":"https://qny.shayucm.com/%E9%A6%96%E5%85%85_%E9%A6%96%E9%A1%B5banner1.png","slide_url":"https://napi.yaoulive.com/h5/activity/firstTopUp/newUp.html?t=1660619212"},{"slide_pic":"https://qny.shayucm.com/20220815/3baafb907ffde92e511be6a565b0b1d5.jpg","slide_url":"https://napi.yaoulive.com/h5/activity/TopWeekStar/index.html?t=1660619212"},{"slide_pic":"https://qny.shayucm.com/%E5%8A%A8%E6%84%9F%E9%9B%B6%E9%92%BB%E8%B4%AD_banner.png","slide_url":"https://napi.yaoulive.com/h5/Exchange/Exchange/Exchange1.html?t=1660619212"},{"slide_pic":"https://qny.shayucm.com/20220808/a55397394f5051ddf462acb0d445bc6b.jpg","slide_url":"162509"},{"slide_pic":"https://qny.shayucm.com/banner/%E8%AC%B9%E9%98%B2%E4%BB%A3%E8%B3%BC%E5%8F%97%E9%A8%99.jpg","slide_url":"https://napi.yaoulive.com/h5/antiFraud.html?t=1660619212"}],"list":[{"islive":1,"uid":96772,"title":"","stream":"96772_1660615596","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/96772_2022.flv","thumb":"https://qny.shayucm.com/20220812112111_b96244618c5b742327db5f88d013fe24?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"11636","content_pic_size_one":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_two":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_three":"https://qny.shayucm.com/label/new/default/label_beauty3.png","nums":"29","avatar":"https://qny.shayucm.com/20220812112111_b96244618c5b742327db5f88d013fe24?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220812112111_b96244618c5b742327db5f88d013fe24?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/9fca23839a1af172cd7f18378c1c971e.jpeg","user_nicename":"鹿儿","level":"21","level_anchor":"31"},{"islive":1,"uid":116935,"title":"绑一大哥","stream":"116935_1660614579","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/116935_2022.flv","thumb":"https://qny.shayucm.com/20220805125250_c55b4a955645b11e12cbffbd60bf3df8?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"6306","content_pic_size_one":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_two":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_three":"https://qny.shayucm.com/label/new/default/label_beauty3.png","nums":"22","avatar":"https://qny.shayucm.com/20220805125250_c55b4a955645b11e12cbffbd60bf3df8?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220805125250_c55b4a955645b11e12cbffbd60bf3df8?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"糖浆","level":"19","level_anchor":"27"},{"islive":1,"uid":144660,"title":"哦哈哟","stream":"144660_1660615125","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/144660_2022.flv","thumb":"https://qny.shayucm.com/20220805125133_18d18f5434852d36c74369ae40be03c8?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"6306","content_pic_size_one":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_two":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_three":"https://qny.shayucm.com/label/new/default/label_beauty3.png","nums":"22","avatar":"https://qny.shayucm.com/20220805125133_18d18f5434852d36c74369ae40be03c8?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220805125133_18d18f5434852d36c74369ae40be03c8?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"小怡同学","level":"11","level_anchor":"22"},{"islive":1,"uid":143245,"title":"嗯 早","stream":"143245_1660614821","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/143245_2022.flv","thumb":"https://qny.shayucm.com/20220721002728_82ca4ca3f535203a15e48c8f093e7ab7?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":12,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"5615","content_pic_size_one":null,"content_pic_size_two":null,"content_pic_size_three":null,"nums":"20","avatar":"https://qny.shayucm.com/20220721002728_82ca4ca3f535203a15e48c8f093e7ab7?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220721002728_82ca4ca3f535203a15e48c8f093e7ab7?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"胡渊渊","level":"15","level_anchor":"26"},{"is_week":"1","img":"https://qny.shayucm.com/homelist_weekstar.png?id=20221658725320","url":"/h5/activity/TopWeekStar/index.html"},{"islive":1,"uid":118096,"title":"","stream":"118096_1660614273","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/118096_2022.flv","thumb":"https://qny.shayucm.com/20220808131131_75ecf2615c6f99b53c9f4c273c6b2244?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"5440","content_pic_size_one":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_two":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_three":"https://qny.shayucm.com/label/new/default/label_beauty3.png","nums":"18","avatar":"https://qny.shayucm.com/20220808131131_75ecf2615c6f99b53c9f4c273c6b2244?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220808131131_75ecf2615c6f99b53c9f4c273c6b2244?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"周周.","level":"14","level_anchor":"30"},{"islive":1,"uid":136611,"title":"呀~","stream":"136611_1660610199","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/136611_2022.flv","thumb":"https://qny.shayucm.com/20220723141213_cffe8c89fc1616cfedb922bce3ac1f22?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":15,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"5255","content_pic_size_one":null,"content_pic_size_two":null,"content_pic_size_three":null,"nums":"27","avatar":"https://qny.shayucm.com/20220723141213_cffe8c89fc1616cfedb922bce3ac1f22?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220723141213_cffe8c89fc1616cfedb922bce3ac1f22?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"赵一鹿","level":"12","level_anchor":"12"},{"islive":1,"uid":111214,"title":"请求辅助","stream":"111214_1660617570","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/111214_2022.flv","thumb":"https://qny.shayucm.com/20220725210555_c136bfaf1bdbf5bfe5c49d158b9c4dce?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"drpk_status":"0","distance":100,"hot_num":"3950","content_pic_size_one":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_two":"https://qny.shayucm.com/label/new/default/label_beauty2.png","content_pic_size_three":"https://qny.shayucm.com/label/new/default/label_beauty3.png","nums":"26","avatar":"https://qny.shayucm.com/20220725210555_c136bfaf1bdbf5bfe5c49d158b9c4dce?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220725210555_c136bfaf1bdbf5bfe5c49d158b9c4dce?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"敏小主","level":"14","level_anchor":"26"},{"id":32041,"user_nicename":"蜜蜜","avatar":"https://qny.shayucm.com/20220608235418_c56e685e9ccfef776c69e1d64df15030?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220608235418_c56e685e9ccfef776c69e1d64df15030?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/a503ef50bdf2a5991baa0db2b5409c74.jpeg","user_status":1,"issuper":0,"uid":32041,"islive":0,"level":"14","level_anchor":"60","thumb":"https://qny.shayucm.com/20220608235418_c56e685e9ccfef776c69e1d64df15030?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":33446,"user_nicename":"幕安迪","avatar":"https://qny.shayucm.com/20220725180734_b876eca27e986b0bf71d9c9daf9f8eda?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220725180734_b876eca27e986b0bf71d9c9daf9f8eda?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":33446,"islive":0,"level":"18","level_anchor":"60","thumb":"https://qny.shayucm.com/20220725180734_b876eca27e986b0bf71d9c9daf9f8eda?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":31852,"user_nicename":"小淘气","avatar":"https://qny.shayucm.com/20220622181003_b205cfb1114cb73ccb32177700014273?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220622181003_b205cfb1114cb73ccb32177700014273?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":31852,"islive":0,"level":"16","level_anchor":"60","thumb":"https://qny.shayucm.com/20220622181003_b205cfb1114cb73ccb32177700014273?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":32034,"user_nicename":"苏晴","avatar":"https://qny.shayucm.com/20220114205342_1073d13673db37e102b063f02a787929?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220114205342_1073d13673db37e102b063f02a787929?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/9436d46f3fdd83fe5d91eccb2f2496fc.jpeg","user_status":1,"issuper":0,"uid":32034,"islive":0,"level":"8","level_anchor":"58","thumb":"https://qny.shayucm.com/20220114205342_1073d13673db37e102b063f02a787929?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":31872,"user_nicename":"鲨鲨在线","avatar":"https://qny.shayucm.com/20220804002853_802a8df90bcd53d5b0be1842e89189e5?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220804002853_802a8df90bcd53d5b0be1842e89189e5?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":31872,"islive":0,"level":"13","level_anchor":"58","thumb":"https://qny.shayucm.com/20220804002853_802a8df90bcd53d5b0be1842e89189e5?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":42676,"user_nicename":"小娱","avatar":"https://qny.shayucm.com/20220804065324_ee8cca3a189c826156156dc564479294?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220804065324_ee8cca3a189c826156156dc564479294?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":42676,"islive":0,"level":"18","level_anchor":"56","thumb":"https://qny.shayucm.com/20220804065324_ee8cca3a189c826156156dc564479294?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":34827,"user_nicename":"糖糖","avatar":"http://qny.shayucm.com/20210704143639_17c9b7eaa6b94f0202359652153429f6?imageView2/2/w/600/h/600","avatar_thumb":"http://qny.shayucm.com/20210704143639_17c9b7eaa6b94f0202359652153429f6?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/af8f0eaf125e1c801c826df3cd6106cc.jpeg","user_status":1,"issuper":0,"uid":34827,"islive":0,"level":"18","level_anchor":"56","thumb":"http://qny.shayucm.com/20210704143639_17c9b7eaa6b94f0202359652153429f6?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":31857,"user_nicename":"果果冻","avatar":"https://qny.shayucm.com/20220104202925_5ec0e7b88e0e9b9bf970a7baa4a989ca?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220104202925_5ec0e7b88e0e9b9bf970a7baa4a989ca?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":31857,"islive":0,"level":"16","level_anchor":"54","thumb":"https://qny.shayucm.com/20220104202925_5ec0e7b88e0e9b9bf970a7baa4a989ca?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":105188,"user_nicename":"柠檬","avatar":"https://qny.shayucm.com/20220416155554_38e81f456d013315d3020970ec427718?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220416155554_38e81f456d013315d3020970ec427718?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":105188,"islive":0,"level":"10","level_anchor":"54","thumb":"https://qny.shayucm.com/20220416155554_38e81f456d013315d3020970ec427718?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":42699,"user_nicename":"噜噜","avatar":"https://qny.shayucm.com/20220803222951_da4c19c96858b90689f0b37f3cee0667?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220803222951_da4c19c96858b90689f0b37f3cee0667?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/80c9934ba6e35e9588b10e415b81442d.jpeg","user_status":1,"issuper":0,"uid":42699,"islive":0,"level":"22","level_anchor":"52","thumb":"https://qny.shayucm.com/20220803222951_da4c19c96858b90689f0b37f3cee0667?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":31870,"user_nicename":"安之","avatar":"https://qny.shayucm.com/20220813202900_98a4662828f9fc95e0a63e3ee38f9f01?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220813202900_98a4662828f9fc95e0a63e3ee38f9f01?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":31870,"islive":0,"level":"16","level_anchor":"52","thumb":"https://qny.shayucm.com/20220813202900_98a4662828f9fc95e0a63e3ee38f9f01?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":40396,"user_nicename":"奶思呀","avatar":"https://qny.shayucm.com/20220713151056_01af86554cfb17c5e7bf6fb3019167c0?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220713151056_01af86554cfb17c5e7bf6fb3019167c0?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/3ad8338cb62c9ec20b7d155adbbf158f.jpeg","user_status":1,"issuper":0,"uid":40396,"islive":0,"level":"16","level_anchor":"50","thumb":"https://qny.shayucm.com/20220713151056_01af86554cfb17c5e7bf6fb3019167c0?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":32752,"user_nicename":"晨小米","avatar":"http://qny.shayucm.com/20210506165400_fafd8cd796c3948046553df3da86990a?imageView2/2/w/600/h/600","avatar_thumb":"http://qny.shayucm.com/20210506165400_fafd8cd796c3948046553df3da86990a?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":32752,"islive":0,"level":"14","level_anchor":"50","thumb":"http://qny.shayucm.com/20210506165400_fafd8cd796c3948046553df3da86990a?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":62519,"user_nicename":"小泡芙","avatar":"https://qny.shayucm.com/20220709210727_fdf4f21872acae589d489a67895b9507?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220709210727_fdf4f21872acae589d489a67895b9507?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":62519,"islive":0,"level":"16","level_anchor":"49","thumb":"https://qny.shayucm.com/20220709210727_fdf4f21872acae589d489a67895b9507?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":46179,"user_nicename":"乔一","avatar":"https://qny.shayucm.com/20220712153108_77a9e4c93de8f930be744e3d4e96a165?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220712153108_77a9e4c93de8f930be744e3d4e96a165?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/7d952a7b81f44a56ec930721bfe8134a.jpeg","user_status":1,"issuper":0,"uid":46179,"islive":0,"level":"19","level_anchor":"49","thumb":"https://qny.shayucm.com/20220712153108_77a9e4c93de8f930be744e3d4e96a165?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":74408,"user_nicename":"西柚again","avatar":"https://qny.shayucm.com/20220813171735_9fdaee085f519a29b4dbbdb0d9a45dcd?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220813171735_9fdaee085f519a29b4dbbdb0d9a45dcd?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/6e5b1b30404a545470140fd74c873a5b.jpeg","user_status":1,"issuper":0,"uid":74408,"islive":0,"level":"17","level_anchor":"48","thumb":"https://qny.shayucm.com/20220813171735_9fdaee085f519a29b4dbbdb0d9a45dcd?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":70926,"user_nicename":"未来","avatar":"https://qny.shayucm.com/20220807163202_5b2bc728075db4e7591f0aefae021513?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220807163202_5b2bc728075db4e7591f0aefae021513?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":70926,"islive":0,"level":"16","level_anchor":"48","thumb":"https://qny.shayucm.com/20220807163202_5b2bc728075db4e7591f0aefae021513?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":76721,"user_nicename":"圆宝","avatar":"https://qny.shayucm.com/20220721150801_fdf4f82eaa5c2a6c5b36cc5beaaf1e0d?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220721150801_fdf4f82eaa5c2a6c5b36cc5beaaf1e0d?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/b910a65fc77764703fefa45ccdc2554f.jpeg","user_status":1,"issuper":0,"uid":76721,"islive":0,"level":"28","level_anchor":"47","thumb":"https://qny.shayucm.com/20220721150801_fdf4f82eaa5c2a6c5b36cc5beaaf1e0d?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":107611,"user_nicename":"AA","avatar":"https://qny.shayucm.com/20220715121250_fbcfe638ab04bf3dc4704ac6f3cdfe2f?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220715121250_fbcfe638ab04bf3dc4704ac6f3cdfe2f?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":107611,"islive":0,"level":"11","level_anchor":"47","thumb":"https://qny.shayucm.com/20220715121250_fbcfe638ab04bf3dc4704ac6f3cdfe2f?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":75625,"user_nicename":"瓶子","avatar":"https://qny.shayucm.com/20220804182909_074bef63a6482c5634189fa5b16e9df8?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220804182909_074bef63a6482c5634189fa5b16e9df8?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":75625,"islive":0,"level":"17","level_anchor":"47","thumb":"https://qny.shayucm.com/20220804182909_074bef63a6482c5634189fa5b16e9df8?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":72875,"user_nicename":"紫依","avatar":"https://qny.shayucm.com/20220227142600_b48c813314a7e855fa59137455dc9199?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220227142600_b48c813314a7e855fa59137455dc9199?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":72875,"islive":0,"level":"9","level_anchor":"47","thumb":"https://qny.shayucm.com/20220227142600_b48c813314a7e855fa59137455dc9199?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":31876,"user_nicename":"关关","avatar":"https://qny.shayucm.com/20220319190332_8593ab14e27b21c921b3c1cf20462e39?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220319190332_8593ab14e27b21c921b3c1cf20462e39?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/04f2742c15dbc1447b783410db691949.jpeg","user_status":1,"issuper":0,"uid":31876,"islive":0,"level":"15","level_anchor":"46","thumb":"https://qny.shayucm.com/20220319190332_8593ab14e27b21c921b3c1cf20462e39?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":80562,"user_nicename":"星星_","avatar":"https://qny.shayucm.com/20220814042859_e9bcdfaaca8d7e93deab4e59496fa01e?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220814042859_e9bcdfaaca8d7e93deab4e59496fa01e?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":80562,"islive":0,"level":"13","level_anchor":"46","thumb":"https://qny.shayucm.com/20220814042859_e9bcdfaaca8d7e93deab4e59496fa01e?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":32560,"user_nicename":"唐小妖","avatar":"https://qny.shayucm.com/20220501034916_7c5220f27d2d8ece6124799dd212322b?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220501034916_7c5220f27d2d8ece6124799dd212322b?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":32560,"islive":0,"level":"12","level_anchor":"46","thumb":"https://qny.shayucm.com/20220501034916_7c5220f27d2d8ece6124799dd212322b?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":52093,"user_nicename":"八月","avatar":"https://qny.shayucm.com/20220314135441_61971665d859aa21855738bba53a2649?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220314135441_61971665d859aa21855738bba53a2649?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":52093,"islive":0,"level":"24","level_anchor":"46","thumb":"https://qny.shayucm.com/20220314135441_61971665d859aa21855738bba53a2649?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":98306,"user_nicename":"小熊^-^","avatar":"https://qny.shayucm.com/20220730234913_ce1582d28bf90e6785a5e0e7e41fd382?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220730234913_ce1582d28bf90e6785a5e0e7e41fd382?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":98306,"islive":0,"level":"14","level_anchor":"45","thumb":"https://qny.shayucm.com/20220730234913_ce1582d28bf90e6785a5e0e7e41fd382?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":62961,"user_nicename":"薇薇","avatar":"https://qny.shayucm.com/20220208160832_64e774225bb5800e1648aa2376406ad5?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220208160832_64e774225bb5800e1648aa2376406ad5?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/ddd7316822dd3cfcf6e0dfd70d8d7a64.jpeg","user_status":1,"issuper":0,"uid":62961,"islive":0,"level":"8","level_anchor":"44","thumb":"https://qny.shayucm.com/20220208160832_64e774225bb5800e1648aa2376406ad5?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":55048,"user_nicename":"知念","avatar":"https://qny.shayucm.com/20220804135702_a5fd7ecad0662d20dfc27a19abd0d49b?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220804135702_a5fd7ecad0662d20dfc27a19abd0d49b?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/1282d8cf7b62d380021098e3ee824fb1.jpeg","user_status":1,"issuper":0,"uid":55048,"islive":0,"level":"29","level_anchor":"44","thumb":"https://qny.shayucm.com/20220804135702_a5fd7ecad0662d20dfc27a19abd0d49b?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":97029,"user_nicename":"多比","avatar":"https://qny.shayucm.com/20220614060735_8ea3d20ded2dd010fbcddaddb7d217ce?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220614060735_8ea3d20ded2dd010fbcddaddb7d217ce?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":97029,"islive":0,"level":"10","level_anchor":"44","thumb":"https://qny.shayucm.com/20220614060735_8ea3d20ded2dd010fbcddaddb7d217ce?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":91628,"user_nicename":"小火龙","avatar":"https://qny.shayucm.com/20220714115304_2e250c9dd2a39c596def8daa4a03b1f9?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220714115304_2e250c9dd2a39c596def8daa4a03b1f9?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/b31c231a0544b705cad61ccd868846b3.jpeg","user_status":1,"issuper":0,"uid":91628,"islive":0,"level":"17","level_anchor":"44","thumb":"https://qny.shayucm.com/20220714115304_2e250c9dd2a39c596def8daa4a03b1f9?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":76780,"user_nicename":"好哆奶🥰","avatar":"https://qny.shayucm.com/20220415214901_c65fdf6eb5c93f4235fa16ace9c7417f?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220415214901_c65fdf6eb5c93f4235fa16ace9c7417f?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/ed274d6d5d96c7c0c00458a1207f2e08.jpeg","user_status":1,"issuper":0,"uid":76780,"islive":0,"level":"13","level_anchor":"44","thumb":"https://qny.shayucm.com/20220415214901_c65fdf6eb5c93f4235fa16ace9c7417f?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":116402,"user_nicename":"哪吒","avatar":"https://qny.shayucm.com/20220812011506_603671c0ba8781442bb5d97752d8af3c?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220812011506_603671c0ba8781442bb5d97752d8af3c?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":116402,"islive":0,"level":"18","level_anchor":"43","thumb":"https://qny.shayucm.com/20220812011506_603671c0ba8781442bb5d97752d8af3c?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":42852,"user_nicename":"可欣","avatar":"https://qny.shayucm.com/20220718083540_ce5605dcfea57afd77f2711bb7a02e0a?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220718083540_ce5605dcfea57afd77f2711bb7a02e0a?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":42852,"islive":0,"level":"23","level_anchor":"43","thumb":"https://qny.shayucm.com/20220718083540_ce5605dcfea57afd77f2711bb7a02e0a?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":56406,"user_nicename":"柒柒.","avatar":"https://qny.shayucm.com/20220707003110_b09a3ca5bc595dfa627ceafe40bb11ca?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220707003110_b09a3ca5bc595dfa627ceafe40bb11ca?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":56406,"islive":0,"level":"19","level_anchor":"43","thumb":"https://qny.shayucm.com/20220707003110_b09a3ca5bc595dfa627ceafe40bb11ca?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":64666,"user_nicename":"子葵","avatar":"https://qny.shayucm.com/20220801210914_b47e48eb0beb15534e594438aaf62c3f?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220801210914_b47e48eb0beb15534e594438aaf62c3f?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":64666,"islive":0,"level":"20","level_anchor":"43","thumb":"https://qny.shayucm.com/20220801210914_b47e48eb0beb15534e594438aaf62c3f?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":50774,"user_nicename":"米粒","avatar":"https://qny.shayucm.com/20220618153911_c44f161cb3aa209aed5a71c7e8ec47e0?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220618153911_c44f161cb3aa209aed5a71c7e8ec47e0?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/05f593a71bf5e110179fa17f1dbcff90.jpeg","user_status":1,"issuper":0,"uid":50774,"islive":0,"level":"16","level_anchor":"43","thumb":"https://qny.shayucm.com/20220618153911_c44f161cb3aa209aed5a71c7e8ec47e0?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":61545,"user_nicename":"小铃铛暴富","avatar":"https://qny.shayucm.com/20220522163107_a301340e347b4161f296aff860b7698a?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220522163107_a301340e347b4161f296aff860b7698a?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/15b349c14138845773d4fbfa85bfdc7e.jpeg","user_status":1,"issuper":0,"uid":61545,"islive":0,"level":"15","level_anchor":"43","thumb":"https://qny.shayucm.com/20220522163107_a301340e347b4161f296aff860b7698a?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":67748,"user_nicename":"小海绵","avatar":"https://qny.shayucm.com/20220813083241_81be87d2b622884b7d640b55f30a5c3d?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220813083241_81be87d2b622884b7d640b55f30a5c3d?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":67748,"islive":0,"level":"27","level_anchor":"43","thumb":"https://qny.shayucm.com/20220813083241_81be87d2b622884b7d640b55f30a5c3d?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":40813,"user_nicename":"贰贰","avatar":"https://qny.shayucm.com/20220103160359_52efeecc6418d44a3df921e1b671e370?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220103160359_52efeecc6418d44a3df921e1b671e370?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/27aee6f4a4197cdaa9a1d71d2c3d6777.jpeg","user_status":1,"issuper":0,"uid":40813,"islive":0,"level":"9","level_anchor":"43","thumb":"https://qny.shayucm.com/20220103160359_52efeecc6418d44a3df921e1b671e370?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":102521,"user_nicename":"恩艺","avatar":"https://qny.shayucm.com/20220809210325_125dd8c5b489741a1d2bc9a1c483c4d4?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220809210325_125dd8c5b489741a1d2bc9a1c483c4d4?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/ff2d341004f357dc2022c88cd0cd6f37.jpeg","user_status":1,"issuper":0,"uid":102521,"islive":0,"level":"17","level_anchor":"43","thumb":"https://qny.shayucm.com/20220809210325_125dd8c5b489741a1d2bc9a1c483c4d4?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":78268,"user_nicename":"球妹","avatar":"https://qny.shayucm.com/20220615161840_9cca94e70e08badf15d3af204cbb76d1?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220615161840_9cca94e70e08badf15d3af204cbb76d1?imageView2/2/w/200/h/200","avatar2":"https://qny.shayucm.com/20220406/034d5f0937d32f56c1a8ddb3931d0a5b.jpeg","user_status":1,"issuper":0,"uid":78268,"islive":0,"level":"16","level_anchor":"43","thumb":"https://qny.shayucm.com/20220615161840_9cca94e70e08badf15d3af204cbb76d1?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":72367,"user_nicename":"格格","avatar":"https://qny.shayucm.com/20220525014649_087b8b98923302f9edc703cb957be27f?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220525014649_087b8b98923302f9edc703cb957be27f?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":72367,"islive":0,"level":"16","level_anchor":"43","thumb":"https://qny.shayucm.com/20220525014649_087b8b98923302f9edc703cb957be27f?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":54244,"user_nicename":"小周老师","avatar":"https://qny.shayucm.com/20220509175608_e9e8860f8f155148282204b5d9461aea?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220509175608_e9e8860f8f155148282204b5d9461aea?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":54244,"islive":0,"level":"14","level_anchor":"43","thumb":"https://qny.shayucm.com/20220509175608_e9e8860f8f155148282204b5d9461aea?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":67747,"user_nicename":"木兮","avatar":"https://qny.shayucm.com/20220427042205_080067537a40ef2f57596792b175456f?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220427042205_080067537a40ef2f57596792b175456f?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":67747,"islive":0,"level":"19","level_anchor":"42","thumb":"https://qny.shayucm.com/20220427042205_080067537a40ef2f57596792b175456f?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":65491,"user_nicename":"婷婷","avatar":"https://qny.shayucm.com/20220726202410_04b27b5a53b6bb6f9689ec07053669bf?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220726202410_04b27b5a53b6bb6f9689ec07053669bf?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":65491,"islive":0,"level":"29","level_anchor":"42","thumb":"https://qny.shayucm.com/20220726202410_04b27b5a53b6bb6f9689ec07053669bf?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":78413,"user_nicename":"安安","avatar":"https://qny.shayucm.com/20220221233526_0cfe85c77e77ef2f80508500c65ef584?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220221233526_0cfe85c77e77ef2f80508500c65ef584?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":78413,"islive":0,"level":"15","level_anchor":"42","thumb":"https://qny.shayucm.com/20220221233526_0cfe85c77e77ef2f80508500c65ef584?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"},{"id":64461,"user_nicename":"钰钰","avatar":"https://qny.shayucm.com/20220730164257_c1a0a0062750ce2e2992755d19c045b7?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220730164257_c1a0a0062750ce2e2992755d19c045b7?imageView2/2/w/200/h/200","avatar2":"","user_status":1,"issuper":0,"uid":64461,"islive":0,"level":"19","level_anchor":"42","thumb":"https://qny.shayucm.com/20220730164257_c1a0a0062750ce2e2992755d19c045b7?imageView2/2/w/600/h/600","hot_num":"0","drpk_status":"0"}]}] + */ + + @SerializedName("slide") + private List slide = new ArrayList<>(); + + public List getSlide() { + return slide; + } + + public SlideInBannerModel setSlide(List slide) { + this.slide = slide; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/SlideInfoModel.java b/common/src/main/java/com/yunbao/common/bean/SlideInfoModel.java new file mode 100644 index 000000000..cb17e7763 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SlideInfoModel.java @@ -0,0 +1,36 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +/** + * 直播首页轮播和侧边栏轮播 + */ +public class SlideInfoModel extends BaseModel { + /** + * slide_pic : https://qny.shayucm.com/20220810/81a4c030334a4a5a30eb62b84191f46d.jpg + * slide_url : https://napi.yaoulive.com/h5/monthlyActivities/202208QIXI/index.html?t=1660619212 + */ + + @SerializedName("slide_pic") + private String slidePic = ""; + @SerializedName("slide_url") + private String slideUrl = ""; + + public String getSlidePic() { + return slidePic; + } + + public SlideInfoModel setSlidePic(String slidePic) { + this.slidePic = slidePic; + return this; + } + + public String getSlideUrl() { + return slideUrl; + } + + public SlideInfoModel setSlideUrl(String slideUrl) { + this.slideUrl = slideUrl; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java b/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java index 5fe1d2a70..cf2b2994d 100644 --- a/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java +++ b/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java @@ -2,10 +2,6 @@ package com.yunbao.common.custom; import android.content.Context; import android.content.res.TypedArray; -import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.SimpleItemAnimator; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; @@ -13,6 +9,11 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.FrameLayout; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.SimpleItemAnimator; + import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; @@ -163,6 +164,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen } } mDataHelper.onRefreshSuccess(adapter.getList(), adapter.getItemCount()); + } @@ -265,6 +267,18 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen } }; + public void onFinish() { + if (mLoadFailureView != null && mLoadFailureView.getVisibility() == View.VISIBLE) { + mLoadFailureView.setVisibility(View.INVISIBLE); + } + if (mEmptyLayout != null && mEmptyLayout.getVisibility() == View.VISIBLE) { + mEmptyLayout.setVisibility(View.INVISIBLE); + } + if (mSmartRefreshLayout != null) { + mSmartRefreshLayout.finishRefresh(true); + } + } + public void setDataHelper(DataHelper dataHelper) { mDataHelper = dataHelper; } @@ -328,6 +342,9 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen mPageCount = 1; mDataHelper.loadData(mPageCount, mRefreshCallback); } + if (dataHelperNew != null) { + dataHelperNew.refresh(); + } } private void loadMore() { @@ -338,6 +355,9 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen mPageCount++; mDataHelper.loadData(mPageCount, mLoadMoreCallback); } + if (dataHelperNew != null) { + dataHelperNew.loadData(mPageCount); + } } public int getPageCount() { @@ -376,6 +396,18 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen } } + public interface DataHelperNew { + void loadData(int p); + + void refresh(); + } + + private DataHelperNew dataHelperNew; + + public CommonRefreshView setDataHelperNew(DataHelperNew dataHelperNew) { + this.dataHelperNew = dataHelperNew; + return this; + } public interface DataHelper { RefreshAdapter getAdapter(); diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 79ab59cfd..6b1bdb583 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -8,10 +8,8 @@ import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SetAttentsModel; +import com.yunbao.common.bean.SlideInBannerModel; -import org.json.JSONObject; - -import java.util.HashMap; import java.util.List; import io.reactivex.Observable; @@ -135,4 +133,12 @@ public interface PDLiveApi { Observable>> setAttents( @Query("touid") String liveuid ); + + /** + * 获取首页位 + */ + @GET("/api/public/?service=Home.getHot") + Observable>> getHot( + @Query("p") int page + ); } diff --git a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java index b6054bdfb..72f572e39 100644 --- a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java @@ -2,16 +2,15 @@ package com.yunbao.common.http.main; import android.app.Activity; -import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.AnchorRecommendModel; +import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.SearchModel; +import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.http.API; import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.base.HttpCallback; -import org.json.JSONObject; - import java.util.List; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -70,6 +69,7 @@ public class MainNetManager { /** * FB是否替换新Key + * * @param callback */ public void FaceBookUp(HttpCallback callback) { @@ -89,6 +89,7 @@ public class MainNetManager { } }).isDisposed(); } + /** * 猜你喜欢 * @@ -120,7 +121,7 @@ public class MainNetManager { * @param p 頁碼 */ public void search(String jianKey, String fanKey, int type, int p, HttpCallback>> callback) { - API.get().pdLiveApi(mContext).search(jianKey,fanKey,type,p) + API.get().pdLiveApi(mContext).search(jianKey, fanKey, type, p) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { @@ -134,6 +135,7 @@ public class MainNetManager { } }).isDisposed(); } + /** * 搜索 * @@ -143,7 +145,7 @@ public class MainNetManager { * @param p 頁碼 */ public void searchNew(String jianKey, String fanKey, int type, int p, HttpCallback> callback) { - API.get().pdLiveApi(mContext).searchNew(jianKey,fanKey,type,p) + API.get().pdLiveApi(mContext).searchNew(jianKey, fanKey, type, p) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { @@ -158,4 +160,23 @@ public class MainNetManager { }).isDisposed(); } + /** + * 获取首页轮播 + */ + public void getHot(int page, HttpCallback> callback) { + API.get().pdLiveApi(mContext).getHot(page) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(slideInBannerModelResponseModel -> { + if (!mContext.isFinishing() && callback != null) { + List slideInfoModels = slideInBannerModelResponseModel.getData().getInfo().get(0).getSlide(); + callback.onSuccess(slideInfoModels); + } + }, throwable -> { + if (!mContext.isFinishing() && callback != null) { + callback.onError(throwable.getMessage()); + } + }).isDisposed(); + } + } diff --git a/common/src/main/java/com/yunbao/common/views/SlideInBannerViewHolder.java b/common/src/main/java/com/yunbao/common/views/SlideInBannerViewHolder.java new file mode 100644 index 000000000..a99cf4667 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/SlideInBannerViewHolder.java @@ -0,0 +1,27 @@ +package com.yunbao.common.views; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; + +import com.bumptech.glide.Glide; +import com.ms.banner.holder.BannerViewHolder; +import com.yunbao.common.bean.SlideInfoModel; + +public class SlideInBannerViewHolder implements BannerViewHolder { + + @Override + public View createView(Context context, int position, SlideInfoModel data) { + // 返回mImageView页面布局 + ImageView imageView = new ImageView(context); + ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT + ); + imageView.setLayoutParams(params); + imageView.setScaleType(ImageView.ScaleType.FIT_XY); + Glide.with(context).load(data.getSlidePic()).into(imageView); + + return imageView; + } + +} diff --git a/common/src/main/res/layout/view_home_float_banner.xml b/common/src/main/res/layout/view_home_float_banner.xml index 018d19021..e92c02a28 100644 --- a/common/src/main/res/layout/view_home_float_banner.xml +++ b/common/src/main/res/layout/view_home_float_banner.xml @@ -33,6 +33,7 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_centerInParent="true" + android:scaleType="centerCrop" android:layout_gravity="center" /> @@ -49,6 +50,7 @@ @@ -70,6 +72,7 @@ android:id="@+id/clip_image3" android:layout_width="29dp" android:layout_height="29dp" + android:scaleType="centerCrop" android:layout_centerInParent="true" android:layout_gravity="center" /> @@ -83,11 +86,13 @@ android:background="@drawable/bg_white_clip" android:gravity="center" android:padding="1dp" + android:visibility="visible"> diff --git a/common/src/main/res/layout/view_refresh_default.xml b/common/src/main/res/layout/view_refresh_default.xml index c3e03f8b6..81e2968eb 100644 --- a/common/src/main/res/layout/view_refresh_default.xml +++ b/common/src/main/res/layout/view_refresh_default.xml @@ -1,11 +1,9 @@ - + android:layout_height="match_parent"> + app:srlTextUpdate="@string/refresh_header_update" /> + android:overScrollMode="never" /> + android:visibility="invisible"> + android:textSize="14sp" /> @@ -59,33 +53,29 @@ android:gravity="center_horizontal" android:orientation="vertical" android:translationY="-60dp" - android:visibility="invisible" - > + android:visibility="invisible"> + android:src="@mipmap/bg_load_failure" /> + android:textSize="14sp" /> + android:textSize="14sp" /> + android:textSize="14sp" /> @@ -107,14 +96,13 @@ android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="wrap_content" + android:visibility="gone" app:srlTextFailed="@string/refresh_footer_failed" app:srlTextFinish="@string/refresh_footer_finish" app:srlTextLoading="@string/refresh_footer_loading" app:srlTextNothing="@string/refresh_footer_nothing" app:srlTextPulling="@string/refresh_footer_pulling" app:srlTextRefreshing="@string/refresh_footer_refreshing" - app:srlTextRelease="@string/refresh_footer_release" - android:visibility="gone" - /> + app:srlTextRelease="@string/refresh_footer_release" /> \ No newline at end of file diff --git a/common/src/main/res/values-en/strings.xml b/common/src/main/res/values-en/strings.xml index d535fb8cc..6b2700e66 100644 --- a/common/src/main/res/values-en/strings.xml +++ b/common/src/main/res/values-en/strings.xml @@ -846,4 +846,18 @@ Limited ride And limited avatar frame Whole station horn quote Available times: %s Note: Update times at 4:00 am on the 1st of each month + Content cannot be empty + Noble exclusive site-wide news + Display messages on the whole station and jump to the current live room + Open noble king, emperor, super emperor to get free + back + to the nobles + Use successfully + Go to the live room + search history + you may also like + anchor + More + Wonderful live + recommended for you diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 7d280ed29..97983f066 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -871,4 +871,5 @@ 主播 更多 精彩直播 + 為您推薦 diff --git a/config.gradle b/config.gradle index 492fa93ba..3f66756b1 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //測試 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 782d469ec..27de3c796 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -315,8 +315,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL if (bean.getmLiveUId().equals(bean.getRoomnum())) { mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1); } - -// mLiveRoomViewHolder.showGiftMessage(bean); mLiveRoomViewHolder.showGiftMessage(bean, mIsAnchor); } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index d93b9117c..432d4cda9 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -3,6 +3,7 @@ package com.yunbao.live.activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; +import android.graphics.Outline; import android.media.AudioManager; import android.os.Bundle; import android.os.CountDownTimer; @@ -10,15 +11,20 @@ import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import android.util.Log; +import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.ViewOutlineProvider; import android.view.ViewParent; import android.widget.FrameLayout; import android.widget.ImageView; import androidx.annotation.IdRes; import androidx.annotation.NonNull; +import androidx.core.view.GravityCompat; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.PagerAdapter; @@ -27,6 +33,7 @@ import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.ms.banner.Banner; import com.opensource.svgaplayer.SVGAImageView; import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMManager; @@ -34,16 +41,26 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.activity.WebViewActivity; +import com.yunbao.common.bean.AnchorRecommendItemModel; +import com.yunbao.common.bean.AnchorRecommendModel; +import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.bean.UserBean; +import com.yunbao.common.custom.CommonRefreshView; +import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.custom.MyViewPager; import com.yunbao.common.dialog.LiveChargeDialogFragment; +import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.main.MainNetManager; +import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.pay.PayCallback; import com.yunbao.common.pay.PayPresenter; +import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessResultUtil; @@ -51,8 +68,10 @@ import com.yunbao.common.utils.RandomUtil; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.SlideInBannerViewHolder; import com.yunbao.live.R; import com.yunbao.live.adapter.LiveRoomScrollAdapter; +import com.yunbao.live.adapter.SidebarAdapter; import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LivePKUserListBean; @@ -61,6 +80,7 @@ import com.yunbao.live.dialog.BlowkissDialog; import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.event.LinkMicTxAccEvent; +import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; @@ -121,7 +141,11 @@ public class LiveAudienceActivity extends LiveActivity { public static String anyway; public static JSONObject pkInfo; public static LiveAudienceActivity liveAudienceActivity; - + private Banner mBanner; + public CommonRefreshView sidebarList; + private SidebarAdapter sidebarAdapter; + private ImageView sidebarBack; + private DrawerLayout drawerLayout; public static void forward(Context context, LiveBean liveBean, int liveType, int liveTypeVal, String key, int position, int liveSdk) { Intent intent = new Intent(context, LiveAudienceActivity.class); @@ -159,6 +183,8 @@ public class LiveAudienceActivity extends LiveActivity { public static ProcessResultUtil mProcessResultUtil; private LiveImDeletUtil liveImDeletUtil; public static int isattention; + private ImageView liveBack; + private LiveBean liveBean; @Override public T findViewById(@IdRes int id) { @@ -186,7 +212,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override protected void main() { - + Bus.getOn(this); liveImDeletUtil = new LiveImDeletUtil(); if (getIntent().getIntExtra("isry", 0) == 1) { @@ -219,19 +245,17 @@ public class LiveAudienceActivity extends LiveActivity { mContainerWrap = mSecondPage.findViewById(R.id.container_wrap); mContainer = mSecondPage.findViewById(R.id.container); btnSmallScreen = findViewById(R.id.btn_small_screen); - btnSmallScreen.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mViewPager.setCurrentItem(1); - btnSmallScreen.setVisibility(View.GONE); - ((LiveAudienceActivity) mContext).mLivePlayViewHolder.smallScreen(); - } + btnSmallScreen.setOnClickListener(v -> { + mViewPager.setCurrentItem(1); + btnSmallScreen.setVisibility(View.GONE); + ((LiveAudienceActivity) mContext).mLivePlayViewHolder.smallScreen(); }); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, (GifImageView) mSecondPage.findViewById(R.id.gift_gif), (SVGAImageView) mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, getWindowManager()); mLiveRoomViewHolder.addToParent(); mLiveRoomViewHolder.subscribeActivityLifeCycle(); mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); mLiveAudienceViewHolder.addToParent(); + mLiveAudienceViewHolder.subscribeActivityLifeCycle(); mLiveBottomViewHolder = mLiveAudienceViewHolder; mViewPager.setAdapter(new PagerAdapter() { @@ -312,10 +336,87 @@ public class LiveAudienceActivity extends LiveActivity { } mLiveType = intent.getIntExtra(Constants.LIVE_TYPE, Constants.LIVE_TYPE_NORMAL); mLiveTypeVal = intent.getIntExtra(Constants.LIVE_TYPE_VAL, 0); - LiveBean liveBean = intent.getParcelableExtra(Constants.LIVE_BEAN); + liveBean = intent.getParcelableExtra(Constants.LIVE_BEAN); setLiveRoomData(liveBean); enterRoom(); + //直播页面背景 + liveBack = findViewById(R.id.live_back); + ImgLoader.displayBlur(mContext, liveBean.getAvatar(), liveBack); + + //侧边栏 + drawerLayout = findViewById(R.id.drawer_layout); + sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList); + sidebarBack = findViewById(R.id.sidebar_back); + ImgLoader.displayBlur(mContext, liveBean.getAvatar(), sidebarBack); + //禁止滑动打开侧边栏 + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); + sidebarList.setEmptyLayoutId(R.layout.view_no_data_live); + GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false); + sidebarList.setLayoutManager(gridLayoutManager); + ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 5, 0); + decoration.setOnlySetItemOffsetsButNoDraw(true); + sidebarList.setItemDecoration(decoration); + Display mDisplay = getWindowManager().getDefaultDisplay(); + sidebarAdapter = new SidebarAdapter(mContext, mDisplay.getHeight()); + sidebarAdapter.setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(AnchorRecommendItemModel bean, int position) { + gotoLive(bean.getUid()); + } + }); + sidebarAdapter.setHasStableIds(true); + sidebarList.setRecyclerViewAdapter(sidebarAdapter); + + sidebarList.setDataHelperNew(new CommonRefreshView.DataHelperNew() { + @Override + public void loadData(int p) { + + } + + @Override + public void refresh() { + //推荐位 + MainNetManager.get(mContext) + .anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(AnchorRecommendModel data) { + if (isFinishing()) return; + + sidebarAdapter.addData(data.getList()); + sidebarList.onFinish(); + } + + @Override + public void onError(String error) { + } + }); + + + } + }); + sidebarList.initData(); + mBanner = findViewById(R.id.banner); + mBanner.setOutlineProvider(new ViewOutlineProvider() { + @Override + public void getOutline(View view, Outline outline) { + outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); + } + }); + mBanner.setClipToOutline(true); + //侧边栏 + MainNetManager.get(mContext) + .getHot(1, new com.yunbao.common.http.base.HttpCallback>() { + @Override + public void onSuccess(List data) { + onBanner(data); + } + + @Override + public void onError(String error) { + + } + }); } //定时器 @@ -480,7 +581,7 @@ public class LiveAudienceActivity extends LiveActivity { logger.logEvent("FB_enterroom"); //观看1分钟 - if (obj.getIntValue("see_time") >= 60){ + if (obj.getIntValue("see_time") >= 60) { AdjustEvent good_user = new AdjustEvent("7zxuxz"); Adjust.trackEvent(good_user); CommonHttpUtil.setAdvertisingChannels("7zxuxz", new HttpCallback() { @@ -534,7 +635,7 @@ public class LiveAudienceActivity extends LiveActivity { mLiveRoomViewHolder.setVotes(obj.getString("votestotal")); //真爱排行 数量 mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum")); - isattention =obj.getIntValue("isattention"); + isattention = obj.getIntValue("isattention"); if (isattention == 0) { if (countDownTimer != null) { countDownTimer.cancel(); @@ -669,7 +770,6 @@ public class LiveAudienceActivity extends LiveActivity { mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); } } -// Constants.isSend = obj.getString("front_task"); } } }); @@ -1052,6 +1152,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override protected void onDestroy() { super.onDestroy(); + Bus.getOff(this); L.e("LiveAudienceActivity-------onDestroy------->"); } @@ -1217,5 +1318,69 @@ public class LiveAudienceActivity extends LiveActivity { } + /** + * 侧滑轮播 + */ + public void onBanner(List data) { + if (data == null || data.size() == 0 || mBanner == null) { + return; + } + + if (mBanner.isStart()) { + mBanner.update(data); + } else { + mBanner.setAutoPlay(true) + .setPages(data, new SlideInBannerViewHolder()) + .setDelayTime(3000) + .setOnBannerClickListener((datas, p) -> { + if (p >= 0 && p < data.size()) { + SlideInfoModel bean = data.get(p); + if (bean != null) { + String link = bean.getSlideUrl(); + if (link.contains("http")) { + WebViewActivity.forward(mContext, link, true); + } else { + gotoLive(link); + } + } + } + }).start(); + } + + } + + /** + * 前往直播间 + */ + private void gotoLive(final String liveId) { + LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + if (mCheckLivePresenter == null) { + mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { + if (liveBean1 == null) { + return; + } + LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk); + finish(); + }); + } + mCheckLivePresenter.checkLive(liveBean); + + } else { + RouteUtil.forwardUserHome(mContext, liveId, 0); + finish(); + } + } + }); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onOpenDrawer(LiveAudienceEvent event) { + //从右边打开侧边栏 + drawerLayout.openDrawer(GravityCompat.END); + } } diff --git a/live/src/main/java/com/yunbao/live/adapter/SidebarAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SidebarAdapter.java new file mode 100644 index 000000000..ad759b27b --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/SidebarAdapter.java @@ -0,0 +1,60 @@ +package com.yunbao.live.adapter; + +import android.content.Context; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.adapter.RefreshAdapter; +import com.yunbao.common.bean.AnchorRecommendItemModel; +import com.yunbao.live.R; +import com.yunbao.live.views.SidebarLiveItemViewHolder; + +import java.util.ArrayList; +import java.util.List; + +/** + * 侧边栏列表 + */ +public class SidebarAdapter extends RefreshAdapter { + private int mHeight; + private Context mContext; + private List itemModelList = new ArrayList<>(); + + public SidebarAdapter(Context context, int height) { + super(context); + mHeight = height; + mContext = context; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + + return new SidebarLiveItemViewHolder(mInflater.inflate(R.layout.item_main_home_lives, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof SidebarLiveItemViewHolder) { + ((SidebarLiveItemViewHolder) holder).loadViewDate(mList.get(position ), position , mHeight, new SidebarLiveItemViewHolder.OnItemClickListener() { + @Override + public void onItemClick(AnchorRecommendItemModel bean, int position) { + if (mOnItemClickListener!=null){ + mOnItemClickListener.onItemClick(bean,position); + } + } + }); + } + } + + /** + * 添加数据 + * + * @param list + */ + public void addData(List list) { + refreshData(list); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index 33b187367..a2765ea53 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -5,12 +5,6 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; import android.os.Message; - -import androidx.core.content.ContextCompat; -import androidx.viewpager.widget.ViewPager; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - import android.text.TextUtils; import android.util.Log; import android.view.Gravity; @@ -23,7 +17,11 @@ import android.widget.PopupWindow; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; -import android.widget.Toast; + +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager.widget.ViewPager; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; @@ -31,15 +29,12 @@ import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.facebook.appevents.AppEventsLogger; -import com.google.firebase.analytics.FirebaseAnalytics; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean2; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.AbsDialogFragment; -import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; @@ -68,7 +63,6 @@ import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; import static com.yunbao.common.utils.RouteUtil.PATH_COIN; import static com.yunbao.live.presenter.LiveLinkMicPresenter.bean1; -//import cn.jmessage.support.qiniu.android.utils.Json; /** * Created by cxf on 2018/10/12. @@ -172,39 +166,36 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On giftTopAdapter = new GiftTopAdapter(mContext); items.setAdapter(giftTopAdapter); items.setOnClickListener(this); - giftTopAdapter.setOnItemClickListener(new OnItemClickListener() { - @Override - public void onItemClick(GiftTopBean bean, int position) { - manager.scrollToPositionWithOffset(position, 0); - giftTopAdapter.notifyDataSetChanged(); - type = position; - type_name = bean.getName(); - if (!bean.getName().equals(WordUtil.getString(R.string.live_wrap))) { - upData(); - //点击礼物,展示礼物列表 - mCurrentId = 0; - if (mViewPager != null) { - mViewPager.setVisibility(View.VISIBLE); - mRadioGroup.setVisibility(View.VISIBLE); - } - if (mVPWrapList != null) { - mVPWrapList.setVisibility(View.GONE); - mRGroupWrap.setVisibility(View.GONE); - } + giftTopAdapter.setOnItemClickListener((bean, position) -> { + manager.scrollToPositionWithOffset(position, 0); + giftTopAdapter.notifyDataSetChanged(); + type = position; + type_name = bean.getName(); + if (!bean.getName().equals(WordUtil.getString(R.string.live_wrap))) { + upData(); + //点击礼物,展示礼物列表 + mCurrentId = 0; + if (mViewPager != null) { + mViewPager.setVisibility(View.VISIBLE); + mRadioGroup.setVisibility(View.VISIBLE); + } + if (mVPWrapList != null) { + mVPWrapList.setVisibility(View.GONE); + mRGroupWrap.setVisibility(View.GONE); + } - } else { + } else { - //点击包裹,展示包裹列表 - mCurrentId = 1; - loadWrapListData(); - if (mViewPager != null) { - mViewPager.setVisibility(View.GONE); - mRadioGroup.setVisibility(View.GONE); - } - if (mVPWrapList != null) { - mVPWrapList.setVisibility(View.VISIBLE); - mRGroupWrap.setVisibility(View.VISIBLE); - } + //点击包裹,展示包裹列表 + mCurrentId = 1; + loadWrapListData(); + if (mViewPager != null) { + mViewPager.setVisibility(View.GONE); + mRadioGroup.setVisibility(View.GONE); + } + if (mVPWrapList != null) { + mVPWrapList.setVisibility(View.VISIBLE); + mRGroupWrap.setVisibility(View.VISIBLE); } } }); @@ -287,7 +278,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On private void loadGiftListData() { //根据变量,判断是否取缓存 -// List giftList = null; if (isGetNewWrap) { isGetNewWrap = false; } else { @@ -325,41 +315,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On }); } else { mLoading.setVisibility(View.INVISIBLE); -// if(!type_name.equals("包裹")) { upData(); -// }else{ -// List name = new ArrayList<>(); -// for (int i = 0; i < lsit.size(); i++) { -// JSONObject data = lsit.getJSONObject(i); -// GiftTopBean giftTopBean = new GiftTopBean(); -// giftTopBean.setName(data.getString("name")); -// name.add(giftTopBean); -// } -// GiftTopBean data = new GiftTopBean(); -// data.setName("包裹"); -// name.add(data); -// -// giftTopAdapter.setList(name); -// //从心愿单过来默认选中第一个 -// if (!TextUtils.isEmpty(mWishGiftId)) { -// giftTopAdapter.choice = 0; -// type = 0; -// giftTopAdapter.notifyDataSetChanged(); -// } -// -// //点击包裹,展示包裹列表 -// mCurrentId = 1; -// loadWrapListData(); -// if (mViewPager != null) { -// mViewPager.setVisibility(View.GONE); -// mRadioGroup.setVisibility(View.GONE); -// } -// if (mVPWrapList != null) { -// mVPWrapList.setVisibility(View.VISIBLE); -// mRGroupWrap.setVisibility(View.VISIBLE); -// } -// } -// showGiftList(giftList); LiveHttpUtil.getCoin(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -384,12 +340,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On GiftTopBean data = new GiftTopBean(); data.setName(WordUtil.getString(R.string.live_wrap)); name.add(data); - -// //从心愿单过来默认选中第一个 -// if (!TextUtils.isEmpty(mWishGiftId)) { -// type = 0; -// } - giftTopAdapter.setList(name); JSONObject obj2 = lsit.getJSONObject(type); String giftJson = obj2.getString("giftlist"); @@ -429,9 +379,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } private void showGiftList(List list) { - if (IMLoginManager.get(mContext).isNewUserGif() == true && type_name.equals("熱門")|| type_name.equals("Hot")) { + if (IMLoginManager.get(mContext).isNewUserGif() == true && type_name.equals("熱門") || type_name.equals("Hot")) { list.add(0, bean1); - if(mWishGiftId==null) { + if (mWishGiftId == null) { mWishGiftId = "" + bean1.getId(); } } @@ -527,7 +477,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } else if (i == R.id.goldCoin) { forwardMyCoin(); } else if (i == R.id.go_charge) { -// startActivity(new Intent(mContext,RechargeActivity.)); forwardMyCoin(); } else if (i == R.id.btn_luck_gift_tip) { dismiss(); @@ -536,33 +485,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } } -// //礼物列表局部刷新 -// private void refreshGiftListAfterSend() { -// if (mObjGiftSendback != null) { -// if (mGiftList != null) { -// int size = mGiftList.size(); -// for (int j = 0; j < size; j++) { -// LiveGiftBean bean = mGiftList.get(j); -// if (mLiveGiftBean.getId() == bean.getId()) { -// int wrapGiftNum = -1; -// try { -// wrapGiftNum = mObjGiftSendback.getIntValue("wrap_gift_num"); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// if (wrapGiftNum == -1) { -// } else if (wrapGiftNum == 0) { -// } else if (wrapGiftNum > 0) { -// bean.setGiftNum(wrapGiftNum + ""); -// if (mLiveGiftPagerAdapter != null) -// mLiveGiftPagerAdapter.notifyRefresh(j); -// //礼物列表更新缓存 -// } -// } -// } -// } -// } -// } //包裹列表局部刷新 private void refreshWrapListAfterSend() { @@ -660,19 +582,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On mBtnChooseCount.setText(DEFAULT_COUNT); } if (mBtnChooseCount != null) { -// if (bean.getSwf().contains("svga")) { -// if (mBtnChooseCount.getVisibility() == View.VISIBLE) { -// mBtnChooseCount.setVisibility(View.INVISIBLE); -// mArrow.setVisibility(View.INVISIBLE); -// mBtnSend.setBackground(mDrawable2); -// } -// } else { -// if (mBtnChooseCount.getVisibility() != View.VISIBLE) { mBtnChooseCount.setVisibility(View.VISIBLE); mArrow.setVisibility(View.VISIBLE); mBtnSend.setBackground(mDrawable1); -// } -// } } } @@ -794,8 +706,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } if (mContext != null && mGiftBean != null) { ((LiveActivity) mContext).onCoinChanged(coin);// -// ((LiveActivity) mContext).sendGiftMessage(mGiftBean, obj.getString("gifttoken")); - if (by != null) { ((LiveActivity) mContext).sendGiftMessage(mGiftBean, obj.getString("gifttoken") , obj.getString("ancherName"), "1"); @@ -811,7 +721,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On //刷新包裹列表wrap_gift_num -1:表示数量没有变化 mObjGiftSendback = obj; isGetNewWrap = true; -// refreshGiftListAfterSend(); refreshWrapListAfterSend(); } } else { @@ -820,6 +729,4 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } } } - - } diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java new file mode 100644 index 000000000..50eeec712 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -0,0 +1,6 @@ +package com.yunbao.live.event; + +import com.yunbao.common.bean.BaseModel; + +public class LiveAudienceEvent extends BaseModel { +} diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java index fe7ae0d8f..79ecf186c 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java @@ -35,6 +35,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GifCacheUtil; import com.yunbao.common.utils.ScreenDimenUtil; @@ -278,7 +279,7 @@ public class LiveEnterRoomAnimPresenter { } try { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); - mSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseCompletionCallback, true,null,null); + mSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseCompletionCallback, true, null, null); } catch (Exception e) { Log.i("fff", e.getMessage()); e.printStackTrace(); @@ -413,7 +414,10 @@ public class LiveEnterRoomAnimPresenter { colocNow = "#" + car.getCar_colour(); playText = car.getUser_nicename() + mContext.getResources().getString(R.string.enter_room); } - GifCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); + if (IMLoginManager.get(mContext).getUserInfo().isGiftEffect()){ + GifCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); + } + } } if (!needAnim) { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index fd60e2c3e..07d8bde0b 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; -import android.content.res.AssetManager; import android.graphics.drawable.Drawable; import android.os.CountDownTimer; import android.os.Handler; @@ -42,6 +41,7 @@ import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GifCacheUtil; import com.yunbao.common.utils.HtmlTagHandler; @@ -66,11 +66,6 @@ import com.yunbao.live.views.LiveTitleAnimViewHolder; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; import java.lang.ref.SoftReference; import java.util.HashMap; import java.util.Map; @@ -800,7 +795,8 @@ public class LiveGiftAnimPresenter { } } } else { - if (bean.getGifUrl().contains("svga") || bean.getGifUrl().contains("gif")) { + if ((bean.getGifUrl().contains("svga") || bean.getGifUrl().contains("gif")) && + IMLoginManager.get(mContext).getUserInfo().isGiftEffect()) { //同一直播间,玩家自己送礼物,也能看到全服通知 //同一直播间,其他玩家也能看到全服通知 @@ -1233,6 +1229,28 @@ public class LiveGiftAnimPresenter { mSvgaPlayTime = System.currentTimeMillis(); mSVGAImageView.setVideoItem(svgaVideoEntity); mSVGAImageView.startAnimation(); + mSVGAImageView.setCallback(new SVGACallback() { + @Override + public void onPause() { + + } + + @Override + public void onFinished() { + mSVGAImageView.clear(); + mSVGAImageView.setVisibility(View.GONE); + } + + @Override + public void onRepeat() { + + } + + @Override + public void onStep(int i, double v) { + + } + }); } } @@ -1264,7 +1282,7 @@ public class LiveGiftAnimPresenter { } try { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); - mSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseCompletionCallback, true,null,null); + mSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseCompletionCallback, true, null, null); } catch (Exception e) { e.printStackTrace(); mShowGif = false; @@ -1300,7 +1318,7 @@ public class LiveGiftAnimPresenter { } try { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); - mIconSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseIconCompletionCallback, true,null,null); + mIconSVGAParser.decodeFromInputStream(bis, file.getAbsolutePath(), mParseIconCompletionCallback, true, null, null); } catch (Exception e) { e.printStackTrace(); mShowAllServer = false; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java index 431dde842..ae2c06b6c 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java @@ -1,6 +1,5 @@ package com.yunbao.live.socket; -import android.os.Message; import android.util.Log; import com.tencent.imsdk.v2.V2TIMCallback; @@ -13,11 +12,8 @@ import com.yunbao.common.bean.UserBean; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; -import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.http.LiveHttpUtil; -import java.util.logging.SocketHandler; - /** * Created by cxf on 2018/10/9. * 直播间发言 @@ -92,7 +88,7 @@ public class SocketChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal_honor", u.getMedal_no_display_src()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("uid", u.getId()) .param("liangname", u.getGoodName()) .param("vip_type", u.getVip().getType()) @@ -145,7 +141,7 @@ public class SocketChatUtil { .param("heart", heart) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("guard_type", guardType) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) @@ -246,7 +242,7 @@ public class SocketChatUtil { .param("ct", giftToken) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("guard_type", guard_type + "") @@ -261,25 +257,6 @@ public class SocketChatUtil { Log.i("tag", "禮物im"); } }); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+liveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } @@ -305,7 +282,7 @@ public class SocketChatUtil { .param("vip_type", u.getVip().getType()) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("ct", giftToken) .param("ancherName", ancherName) .param("medal_name", u.getMedalName()) @@ -323,25 +300,6 @@ public class SocketChatUtil { Log.i("tag", "禮物im"); } }); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+liveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } @@ -636,32 +594,13 @@ public class SocketChatUtil { .param("uid", u.getId()) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("uname", u.getUserNiceName()) .param("uhead", u.getAvatar()) .param("votestotal", votes) .param("guard_nums", guardNum) .param("guard_type", guardType); msg.create(); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } @@ -685,30 +624,9 @@ public class SocketChatUtil { .param("liveuid", liveId) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("guard_type", guardType); msg.create(); -// Log.i("tx",mLiveUid+msg.mResult.toString()); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); - } /** diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index 15395e6f3..4d98df654 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -1,9 +1,6 @@ package com.yunbao.live.socket; import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.Toast; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; @@ -15,7 +12,6 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.http.LiveHttpUtil; -import com.yunbao.live.views.LiveRoomViewHolder; import org.greenrobot.eventbus.EventBus; @@ -36,7 +32,7 @@ import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; public class SocketRyChatUtil { //关闭直播 - public static void closeLive(final String votes,final String length,final String nums,final String mLiveUid, SocketRyClient client) { + public static void closeLive(final String votes, final String length, final String nums, final String mLiveUid, SocketRyClient client) { UserBean u = CommonAppConfig.getInstance().getUserBean(); final SocketSendBean msg = new SocketSendBean() .param("_method_", Constants.SOCKET_LIVE_END) @@ -45,9 +41,9 @@ public class SocketRyChatUtil { .param("equipment", "app") .param("uname", u.getUserNiceName()) .param("uid", u.getId()) - .param("length",length) - .param("votes",votes) - .param("nums",nums) + .param("length", length) + .param("votes", votes) + .param("nums", nums) .param("roomnum", u.getId()) .param("ct", "直播关闭"); msg.create(); @@ -76,6 +72,7 @@ public class SocketRyChatUtil { }); } + /** * 发言 */ @@ -97,7 +94,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal_honor", u.getMedal_no_display_src()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("uid", u.getId()) .param("liangname", u.getGoodName()) .param("vip_type", u.getVip().getType()) @@ -121,14 +118,14 @@ public class SocketRyChatUtil { @Override public void onSuccess(Message message) { - Log.i("tx", "发送成功"+mLiveUid); + Log.i("tx", "发送成功" + mLiveUid); //首发言成功 AdjustEvent adjustEvent1 = new AdjustEvent("j7isvr"); Adjust.trackEvent(adjustEvent1); CommonHttpUtil.setAdvertisingChannels("j7isvr", new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code == 0) { + if (code == 0) { mFirebaseAnalytics.logEvent("FS_liveinteraction", null); logger.logEvent("FB_liveinteraction "); } @@ -171,7 +168,7 @@ public class SocketRyChatUtil { .param("heart", heart) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("guard_type", guardType) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) @@ -201,7 +198,7 @@ public class SocketRyChatUtil { LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code == 0) { + if (code == 0) { EventBus.getDefault().post("stop_svga_new_user_double1"); } @@ -286,7 +283,7 @@ public class SocketRyChatUtil { .param("ct", giftToken) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("guard_type", guard_type + "") @@ -307,8 +304,7 @@ public class SocketRyChatUtil { /** * 发送礼物消息 增加主播名字 */ - public static void sendGiftMessage(int giftType, String giftToken, - String liveUid, String ancherName, int guard_type, String by) { + public static void sendGiftMessage(int giftType, String giftToken, String liveUid, String ancherName, int guard_type, String by) { UserBean u = CommonAppConfig.getInstance().getUserBean(); if (u == null) { return; @@ -326,7 +322,7 @@ public class SocketRyChatUtil { .param("vip_type", u.getVip().getType()) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("ct", giftToken) .param("ancherName", ancherName) .param("medal_name", u.getMedalName()) @@ -344,25 +340,6 @@ public class SocketRyChatUtil { Log.i("tag", "禮物im"); } }); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+liveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } @@ -674,32 +651,13 @@ public class SocketRyChatUtil { .param("uid", u.getId()) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("uname", u.getUserNiceName()) .param("uhead", u.getAvatar()) .param("votestotal", votes) .param("guard_nums", guardNum) .param("guard_type", guardType); msg.create(); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } @@ -723,29 +681,9 @@ public class SocketRyChatUtil { .param("liveuid", liveId) .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) - .param("medal_new",u.getDress().getMedal_new()) + .param("medal_new", u.getDress().getMedal_new()) .param("guard_type", guardType); msg.create(); -// Log.i("tx",mLiveUid+msg.mResult.toString()); -// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { -// @Override -// public void onProgress(int progress) { -// Log.i("tx","发送中"+progress); -// -// } -// -// @Override -// public void onSuccess(V2TIMMessage v2TIMMessage) { -// Log.i("tx","发送成功"); -//// SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString()+""); -// } -// -// @Override -// public void onError(int code, String desc) { -// Log.i("tx",code+"发送失败"+desc); -// -// } -// }); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index caa374185..327997d48 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -8,6 +8,7 @@ import android.os.Message; import android.os.SystemClock; import android.text.TextUtils; import android.util.Log; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; @@ -48,6 +49,7 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ScreenDimenUtil; @@ -55,6 +57,7 @@ import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; +import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAnchorActivity; @@ -77,6 +80,7 @@ import com.yunbao.live.custom.TopGradual; import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment; +import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveDanmuPresenter; @@ -103,7 +107,7 @@ import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer; * Created by cxf on 2018/10/9. * 直播间公共逻辑 */ -public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickListener { +public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickListener{ public static Context Contexts; private int mOffsetY; @@ -230,6 +234,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mSVGAImageView = svgaImageView; mLiveGiftPrizePoolContainer = liveGiftPrizePoolContainer; this.windowManager = windowManager; + } @@ -537,6 +542,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void init() { + time = (TextView) findViewById(R.id.time); pkText1 = (TextView) findViewById(R.id.pk_text1); pkText2 = (TextView) findViewById(R.id.pk_text2); @@ -786,6 +792,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis ft_hot_add = (FrameLayout) findViewById(R.id.ft_hot_add); img_hot_gif = (ImageView) findViewById(R.id.img_hot_gif); findViewById(R.id.ft_hot_add).setOnClickListener(this); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.open_sidebar), () -> Bus.get().post(new LiveAudienceEvent())); } //点击头像 @@ -1865,4 +1872,5 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION); } + } diff --git a/live/src/main/java/com/yunbao/live/views/SidebarLiveItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/SidebarLiveItemViewHolder.java new file mode 100644 index 000000000..8bf25a176 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/SidebarLiveItemViewHolder.java @@ -0,0 +1,160 @@ +package com.yunbao.live.views; + +import android.content.Context; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.jakewharton.rxbinding3.view.RxView; +import com.squareup.picasso.Picasso; +import com.yunbao.common.Constants; +import com.yunbao.common.bean.AnchorRecommendItemModel; +import com.yunbao.common.custom.RatioRoundImageView; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.formatBigNum; +import com.yunbao.live.R; +import com.yunbao.live.utils.MainIconUtil; + +import java.util.concurrent.TimeUnit; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import kotlin.Unit; + +/** + * 直播页面布局 + */ +public class SidebarLiveItemViewHolder extends RecyclerView.ViewHolder { + private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar; + private RatioRoundImageView bgs; + private View views; + private TextView mLiveState, mTitle, mName, mNum; + + public SidebarLiveItemViewHolder(@NonNull View itemView) { + super(itemView); + //展示普通布局,隐藏周星榜布局 + itemView.findViewById(R.id.live_info_view).setVisibility(View.VISIBLE); + itemView.findViewById(R.id.lt_week_list).setVisibility(View.GONE); + mCover = itemView.findViewById(R.id.cover); + bgs = itemView.findViewById(R.id.bgs); + liveType = itemView.findViewById(R.id.live_type); + views = itemView.findViewById(R.id.views); + mLiveIco = (ImageView) itemView.findViewById(R.id.tv_live_ico); + mLiveState = (TextView) itemView.findViewById(R.id.tv_live_state); + mType = (ImageView) itemView.findViewById(R.id.type); + mTitle = (TextView) itemView.findViewById(R.id.title); + mName = (TextView) itemView.findViewById(R.id.name); + mNum = (TextView) itemView.findViewById(R.id.num); + pkico = (ImageView) itemView.findViewById(R.id.pk_ico); + drPkIco = (ImageView) itemView.findViewById(R.id.dr_pk_ico); + pkAvatar = (ImageView) itemView.findViewById(R.id.pk_avatar); + } + + /** + * 设置页面数据 + * + * @param bean 数据类 + * @param position 下标 + */ + public void loadViewDate(AnchorRecommendItemModel bean, int position, int height, OnItemClickListener listener) { + Context mContext = itemView.getContext(); + itemView.setTag(position); + liveType.setImageDrawable(null); + if (bean.getContentPicSizeTwo() != null && !bean.getContentPicSizeTwo().equals("") && height <= 1920) { + Picasso.with(mContext) + .load(bean.getContentPicSizeTwo()) + .into(liveType); + } else if (bean.getContentPicSizeThree() != null && !bean.getContentPicSizeThree().equals("") && height > 1920) { + Picasso.with(mContext) + .load(bean.getContentPicSizeThree()) + .into(liveType); + } + ImgLoader.display(itemView.getContext(), bean.getThumb(), mCover); + bgs.setVisibility(View.VISIBLE); + pkico.setVisibility(View.GONE); + pkAvatar.setVisibility(View.GONE); + drPkIco.setVisibility(View.GONE); + if (bean.getDrpkStatus() != null && bean.getDrpkStatus().equals("1")) { + drPkIco.setVisibility(View.VISIBLE); + } + if (bean.getPkAvatarThumb() != null && !bean.getPkAvatarThumb().equals("")) { + ImgLoader.display(mContext, bean.getPkAvatarThumb(), pkAvatar); + pkico.setVisibility(View.VISIBLE); + pkAvatar.setVisibility(View.VISIBLE); + } + mName.setText(bean.getUserNicename()); + if (TextUtils.isEmpty(bean.getTitle())) { + if (mTitle.getVisibility() == View.VISIBLE) { + mTitle.setVisibility(View.GONE); + } + } else { + if (mTitle.getVisibility() != View.VISIBLE) { + mTitle.setVisibility(View.VISIBLE); + } + mTitle.setText(bean.getTitle()); + } + mNum.setText(formatBigNum.formatBigNum(bean.getHotNum())); + views.setVisibility(View.GONE); + if ("1".equals(bean.getIslive())) { + views.setVisibility(View.VISIBLE); + //直播中 + mType.setImageResource(MainIconUtil.getLiveTypeIcon(Integer.parseInt(bean.getType()))); + mType.setVisibility(View.VISIBLE); + mLiveIco.setImageResource(R.mipmap.icon_main_rest_work); + mNum.setVisibility(View.VISIBLE); + liveType.setVisibility(View.VISIBLE); + mLiveState.setText(R.string.lives_state); + } else { + views.setVisibility(View.VISIBLE); + //休息中 + mType.setImageResource(MainIconUtil.getLiveTypeIcon(Constants.LIVE_TYPE_RESTING)); + mType.setVisibility(View.GONE); + mLiveIco.setImageResource(R.mipmap.icon_main_rest_spot); + mLiveState.setText(R.string.rest_state); + liveType.setVisibility(View.GONE); + mNum.setVisibility(View.GONE); + } + RxView.clicks(itemView) + .throttleFirst(2, TimeUnit.SECONDS) // 才发送 2s内第1次点击按钮的事件 + .subscribe(new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(Unit unit) { + if (listener != null) { + listener.onItemClick(bean, position); + } + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + views.setVisibility(View.GONE); + mLiveIco.setVisibility(View.GONE); + mLiveState.setVisibility(View.GONE); + mNum.setVisibility(View.GONE); + pkAvatar.setVisibility(View.GONE); + pkico.setVisibility(View.GONE); + mTitle.setVisibility(View.GONE); + drPkIco.setVisibility(View.GONE); + } + + public interface OnItemClickListener { + void onItemClick(AnchorRecommendItemModel bean, int position); + } + +} diff --git a/live/src/main/res/drawable/bg_live_item_right.xml b/live/src/main/res/drawable/bg_live_item_right.xml new file mode 100644 index 000000000..bf6218738 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_item_right.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/activity_live_audience.xml b/live/src/main/res/layout/activity_live_audience.xml index 6ab4305a1..2d8e8cee0 100644 --- a/live/src/main/res/layout/activity_live_audience.xml +++ b/live/src/main/res/layout/activity_live_audience.xml @@ -1,39 +1,115 @@ - + android:layout_height="match_parent"> + android:layout_height="match_parent"> - + + + + + + + + + + + + + + + android:id="@+id/left_drawer" + android:layout_width="240dp" + android:layout_height="match_parent" + android:layout_gravity="end" + android:background="@mipmap/live_bg" + android:choiceMode="singleChoice" + android:dividerHeight="0dp" + android:orientation="vertical" + + android:scrollbars="none"> + + + + + + + + + + + + + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index e106dd238..abc802a79 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -224,210 +224,210 @@ + + + + + + + + + + android:id="@+id/btn_zg1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@id/btn_zg"> - - - - - - - - - - - - - + android:background="@mipmap/img_bg" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:src="@mipmap/play" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + layout="@layout/view_whole_station_horn_layout" + android:visibility="gone" /> diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 0e7993bb7..9c6ddd9b4 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -5,6 +5,8 @@ android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginBottom="45dp" + android:paddingTop="15dp"> @@ -260,7 +262,7 @@ android:visibility="gone" /> - + + android:paddingRight="5dp" + android:visibility="gone"> + + + + + + + + + android:layout_height="match_parent" /> - + android:layout_marginRight="19dp" + android:orientation="vertical"> - - + + android:layout_centerHorizontal="true" + android:src="@mipmap/voice" /> - + android:layout_marginTop="19dp" + android:visibility="gone"> + app:riv_oval="true" /> + android:layout_centerHorizontal="true" + android:src="@mipmap/voice" /> - + app:riv_oval="true" /> + android:src="@mipmap/voice" /> diff --git a/live/src/main/res/layout/view_no_data_live.xml b/live/src/main/res/layout/view_no_data_live.xml new file mode 100644 index 000000000..389699d51 --- /dev/null +++ b/live/src/main/res/layout/view_no_data_live.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png b/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png new file mode 100644 index 000000000..8a52712d3 Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png differ diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index 47c78b65c..0af5096e6 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -142,12 +142,6 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { } }); -// itemView.setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View v) { - -// } -// }); } public interface OnItemClickListener { diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 82fbed8eb..36d4e899f 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -3,9 +3,6 @@ package com.yunbao.main.views; import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Outline; -import androidx.recyclerview.widget.GridLayoutManager; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -13,6 +10,10 @@ import android.view.ViewGroup; import android.view.ViewOutlineProvider; import android.widget.ImageView; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ms.banner.Banner; @@ -403,7 +404,6 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement } - @Override public void loadData() { } diff --git a/main/src/main/res/layout/item_main_home_live_head.xml b/main/src/main/res/layout/item_main_home_live_head.xml index 0b1de06c8..348ef45bd 100644 --- a/main/src/main/res/layout/item_main_home_live_head.xml +++ b/main/src/main/res/layout/item_main_home_live_head.xml @@ -1,12 +1,10 @@ - + android:orientation="vertical"> + app:indicator_width="8dp" />