Commit aed2f222 authored by mengcuiguang's avatar mengcuiguang

添加穿山甲短剧sdk

parent a15540eb
...@@ -223,6 +223,11 @@ dependencies { ...@@ -223,6 +223,11 @@ dependencies {
// 穿山甲聚合 接入【穿山甲、快手】 // 穿山甲聚合 接入【穿山甲、快手】
implementation "com.pangle.cn:mediation-sdk:6.4.1.5" implementation "com.pangle.cn:mediation-sdk:6.4.1.5"
// 穿山甲短剧
// implementation 'com.pangle.cn:ads-sdk-pro:6.4.1.5'
implementation 'com.pangle.cn:pangrowth-base:2.6.0.0'
implementation 'com.pangle.cn:pangrowth-djx-sdk-lite:2.6.0.0'
// 穿山甲Applog 上报组件(必须) // 穿山甲Applog 上报组件(必须)
implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:6.16.9' implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:6.16.9'
// 穿山甲商业化转化组件(必须) // 穿山甲商业化转化组件(必须)
......
...@@ -138,6 +138,10 @@ ...@@ -138,6 +138,10 @@
android:name=".ui.activitys.AboutusActivity" android:name=".ui.activitys.AboutusActivity"
android:exported="false" android:exported="false"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.CsjDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.OrderRecordActivity" android:name=".ui.activitys.OrderRecordActivity"
android:exported="false" android:exported="false"
......
{
"init": {
"site_id": "5458827",
"app_id": "568164",
"partner": "pangle_568164",
"secure_key": "647c996ce2f452df17ed73d77a808a6a",
"secure_key_d": "410345d2ec668d63a1aea3c8a745d5bd"
},
"feed": {
"news_list_ad_code_id": "",
"news_first_ad_code_id": "",
"news_second_ad_code_id": "",
"video_first_ad_code_id": "",
"video_second_ad_code_id": "",
"related_ad_code_id": "",
"news_draw_ad_code_id": "954961061",
"news_draw_native_ad_code_id": "954961062",
"news_outer_list_ad_code_id": "",
"news_outer_first_ad_code_id": "",
"news_outer_second_ad_code_id": "",
"outer_video_second_ad_code_id": "",
"outer_related_ad_code_id": "",
"news_outer_draw_ad_code_id": "954961065",
"news_outer_draw_native_ad_code_id": "954961069",
"news_interstitial_code_id": ""
},
"small_video": {
"draw_ad_code_id": "954961080",
"draw_native_ad_code_id": "954961081",
"grid_ad_code_id": "954961083",
"grid_draw_ad_code_id": "954961085",
"grid_draw_native_ad_code_id": "954961076",
"video_card_ad_code_id": "954961072",
"video_card_draw_ad_code_id": "954961067",
"video_card_draw_native_ad_code_id": "954961075",
"interstitial_ad_code_id": "",
"interstitial_note_ad_code_id": "954961071",
"staggered_grid_ad_code_id": "954961078",
"staggered_grid_draw_ad_code_id": "954961080",
"staggered_grid_draw_native_ad_code_id": "954961081",
"draw_interstitial_ad_code_id": "954961070",
"draw_fullscreen_interstitial_ad_code_id": "954961082",
"draw_banner_code_id": "954961066",
"drama_rewarded_ad_code_id": "954961077",
"drama_rewarded_ad_code_id_02": "954961063",
"drama_draw_ad_code_id": "954961073",
"staggered_grid_ad_code_id_02": "961667898"
},
"novel": {
"status": 0,
"pre_ad_code_id": "",
"mid_ad_code_id": "",
"exciting_ad_code_id": "",
"interstitial_code_id": "",
"banner_ad_code_id": "",
"end_ad_code_id": ""
},
"live": null,
"license_config": [
{
"PackageName": "com.duben.roseplaylet",
"BundleId": "com.duben.roseplaylet",
"StartTime": "20250108T090808Z",
"ExpireTime": "20270108T090808Z",
"CreatedTime": "20250108T090807Z",
"Signature": "BfQIVvZw+lEBU4jTsn0G609hsXCRIaimSx09z2YWgn6QSdFU6XQcenbYbwyYR290usNAiV4FCuepcQtryfHAZYT2+yiYdRq3fjKuSGeVwm0vev8pHOfaSPPTywqVpnxk13deUQxAB6XW0lDX8oyg9hcaLFZgOjsMXMbremSYF6rBW51NX5sGFhbJ5ywSyJKA68Oi36ijgRmKZOCI44LyrbEtri5HPlUWjnAoulcD1GlzNumocWRfddzoCXbqpXsAQTGY/uEihke/2JN57fD8PCS9B4SPhVKsmRVMGEg5/fIIGUlYW+fp9/nu2QPj6quIFQY8ySdchiT/aV9WcrXdaQ==",
"Content": "eyJJZCI6Ijk0MDIzMDY3MSIsICJWZXJzaW9uIjoyLCAiQ2hhbm5lbCI6ImFkX2NzaiIsICJUeXBlIjoyLCAiUGFja2FnZU5hbWUiOiJjb20uZHViZW4ucm9zZXBsYXlsZXQiLCAiQnVuZGxlSWQiOiJjb20uZHViZW4ucm9zZXBsYXlsZXQiLCAiTW9kdWxlcyI6W3siTmFtZSI6InZvZF9wbGF5IiwgIkVkaXRpb24iOiJwcmVtaXVtX2VkaXRpb24iLCAiU3RhcnRUaW1lIjoxNzM2MzI3Mjg3NzcwLCAiRXhwaXJlVGltZSI6MTc5OTM5OTI4Nzc3MCwgIkV4cGlyZUJ1ZmZlciI6MTU1NTIwMDAwMDB9XSwgIkZpbGVWZXJzaW9uIjoiMTczNjMyNzI4Nzc4NTE2MjAzNiJ9",
"MainURL": "https://vod-license-b.volccdn.com/vod-license/l-940230671-ch-ad_csj-a-568164.lic?lk3s=0d9f7a7d\u0026x-expires=4889927287\u0026x-signature=v1R%2FDnmkTZl%2Bk%2B0AIseUC1abRFY%3D",
"BackupURL": "https://vod-license-m.volccdn.com/vod-license/l-940230671-ch-ad_csj-a-568164.lic?lk3s=0d9f7a7d\u0026x-expires=4889927287\u0026x-signature=fQli%2FQNn4XF9Z1alH4qh5o84OLQ%3D",
"Id": "940230671"
}
]
}
\ No newline at end of file
package com.duben.roseplaylet; package com.duben.roseplaylet;
import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -12,6 +13,7 @@ import com.downloader.PRDownloaderConfig; ...@@ -12,6 +13,7 @@ import com.downloader.PRDownloaderConfig;
import com.duben.roseplaylet.ad.TTAdManagerHolder; import com.duben.roseplaylet.ad.TTAdManagerHolder;
import com.duben.roseplaylet.common.Constant; import com.duben.roseplaylet.common.Constant;
import com.duben.roseplaylet.manager.CsjAppLogManager; import com.duben.roseplaylet.manager.CsjAppLogManager;
import com.duben.roseplaylet.manager.CsjDJXSdkManager;
import com.duben.roseplaylet.manager.TXCSDKService; import com.duben.roseplaylet.manager.TXCSDKService;
import com.duben.roseplaylet.manager.TalkingDataManager; import com.duben.roseplaylet.manager.TalkingDataManager;
import com.duben.roseplaylet.net.LoanService; import com.duben.roseplaylet.net.LoanService;
...@@ -80,12 +82,16 @@ public class MintsApplication extends MultiDexApplication { ...@@ -80,12 +82,16 @@ public class MintsApplication extends MultiDexApplication {
TTAdManagerHolder.init(this); TTAdManagerHolder.init(this);
CsjDJXSdkManager.INSTANCE.init(this);
TXCSDKService.init(this); TXCSDKService.init(this);
CsjAppLogManager.INSTANCE.init(this); CsjAppLogManager.INSTANCE.init(this);
TalkingDataManager.INSTANCE.init(this); TalkingDataManager.INSTANCE.init(this);
// PR下载附件 // PR下载附件
initPRDownloader(); initPRDownloader();
......
package com.duben.roseplaylet.ad; package com.duben.roseplaylet.ad;
import android.app.Application;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
...@@ -13,6 +14,7 @@ import com.bytedance.sdk.openadsdk.mediation.init.MediationPrivacyConfig; ...@@ -13,6 +14,7 @@ import com.bytedance.sdk.openadsdk.mediation.init.MediationPrivacyConfig;
import com.duben.roseplaylet.BuildConfig; import com.duben.roseplaylet.BuildConfig;
import com.duben.roseplaylet.MintsApplication; import com.duben.roseplaylet.MintsApplication;
import com.duben.roseplaylet.common.Constant; import com.duben.roseplaylet.common.Constant;
import com.duben.roseplaylet.manager.CsjDJXSdkManager;
import com.duben.roseplaylet.utils.AppPreferencesManager; import com.duben.roseplaylet.utils.AppPreferencesManager;
import com.duben.roseplaylet.utils.DeviceUuidFactory; import com.duben.roseplaylet.utils.DeviceUuidFactory;
import com.duben.roseplaylet.utils.LogUtil; import com.duben.roseplaylet.utils.LogUtil;
...@@ -54,7 +56,8 @@ public class TTAdManagerHolder { ...@@ -54,7 +56,8 @@ public class TTAdManagerHolder {
TTAdSdk.start(new TTAdSdk.Callback() { TTAdSdk.start(new TTAdSdk.Callback() {
@Override @Override
public void success() { public void success() {
Log.i(TAG, "success: " + TTAdSdk.isInitSuccess()); LogUtil.d(TAG, "success: " + TTAdSdk.isInitSuccess());
CsjDJXSdkManager.INSTANCE.start((Application) context);
} }
@Override @Override
......
package com.duben.roseplaylet.manager
import android.app.Application
import android.widget.Toast
import com.bytedance.sdk.djx.DJXSdk
import com.bytedance.sdk.djx.DJXSdkConfig
import com.bytedance.sdk.djx.IDJXService
import com.bytedance.sdk.djx.model.DJXDrama
import com.bytedance.sdk.djx.model.DJXError
import com.bytedance.sdk.djx.model.DJXOthers
import com.duben.library.utils.json.JsonUtil
import com.duben.roseplaylet.BuildConfig
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.mvp.model.HotStyleTypesBean
import com.duben.roseplaylet.mvp.model.VedioBean
import com.duben.roseplaylet.utils.LogUtil
/**
* 描述:穿山甲短剧
*
* 作者:孟崔广
*/
object CsjDJXSdkManager {
private const val TAG = "CsjDJXSdkManager"
/**
* 短剧初始化
*
* 注意:穿山甲广告sdk初始成功后使用
*/
fun init(application: Application) {
//初始化,最好放到application.onCreate()执行
val config = DJXSdkConfig.Builder().build()
DJXSdk.init(application, "SDK_Setting_5458827.json", config)
}
fun start(application: Application) {
DJXSdk.start(object : DJXSdk.StartListener {
override fun onStartComplete(p0: Boolean, p1: String?, p2: DJXError?) {
LogUtil.d(TAG, "p0 = $p0--p1 = $p1--p2 = ${JsonUtil.toJson(p2)}")
}
})
}
/**
* 短剧分类
*/
fun requestDramaCategoryList(listener: CsjdramaCategoryListListener) {
if (DJXSdk.isStartSuccess()) {
DJXSdk.service()
.requestDramaCategoryList(object : IDJXService.IDJXCallback<MutableList<String>?> {
override fun onError(error: DJXError) {
LogUtil.d(TAG, "request failed, code = $error")
listener.dramaCategoryListFail()
}
override fun onSuccess(
categoryList: MutableList<String>?,
others: DJXOthers?
) {
val hotStyleTypesBeanList = mutableListOf<HotStyleTypesBean>()
categoryList?.let { list ->
list?.forEach { data ->
}
val categoty = list.listIterator()
while (categoty.hasNext()) {
val HotStyleTypesBean = HotStyleTypesBean()
val typeId =categoty.nextIndex()
val type =categoty.next()
if (BuildConfig.DEBUG) {
LogUtil.d(
TAG,
"Index: ${typeId}, Category: ${type}"
)
}
HotStyleTypesBean.typeId = typeId
HotStyleTypesBean.type = type
HotStyleTypesBean.torder = typeId
hotStyleTypesBeanList.add(HotStyleTypesBean)
}
listener.dramaCategoryListSuccess(hotStyleTypesBeanList)
}
}
})
} else {
listener.dramaCategoryListFail()
}
}
interface CsjdramaCategoryListListener {
fun dramaCategoryListSuccess(list: MutableList<HotStyleTypesBean>)
fun dramaCategoryListFail()
}
/**
* 按分类查询短剧
*/
fun requestDramaByCategory(
category: String,
page: Int,
size: Int,
listener: CsjrequestDramaByCategoryListener
) {
if (DJXSdk.isStartSuccess()) {
val order = 0// 0是正序 1是倒序
DJXSdk.service().requestDramaByCategory(
category,
page,
size,
order,
object : IDJXService.IDJXCallback<MutableList<out DJXDrama>?> {
override fun onError(error: DJXError) {
LogUtil.d(
TAG,
"drama category: request failed, code = $error"
)
listener.dramaCategoryListFail()
}
override fun onSuccess(
dataList: MutableList<out DJXDrama>?,
others: DJXOthers?
) {
val vedioList = mutableListOf<VedioBean>()
LogUtil.d(TAG, "request success, drama size = " + dataList?.size)
dataList?.forEach { drama ->
LogUtil.d(TAG, "drama category: $drama")
//{freeSet=0, lockSet=1, reqId='202501071912576331796EC2409C457B02', groupId=0, providerId=2, channelId=0, rankId=1, visibility=false, id=1042, title='重回90年代', coverImage='https://p3-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/1c0eca384bef41569220a05b18b30976~tplv-4g66r8cj84-jpeg.image?rk3s=363bf5d8&x-expires=1736853177&x-signature=rCgxWR0dK60b2cLh9%2B527%2Be%2F7PA%3D', coverImages2='null', status=0, total=59, index=1, type='悬疑', typeId=4, desc='彭显光遭遇小人陷害,家破人亡,妻离子散;同时他意外穿越回1990年,遇到了已故的妻女,他发誓这辈子一定要好好守护妻女,抓住幕后的恶人,不会让历史重蹈覆辙!', scriptName='', scriptAuthor='', createTime=1693405348', actionTime=0', unlockIndex=0', episodeStatuses=null', icpNumber=1108324230306040}
val vedioBean = VedioBean()
vedioBean.completeStatus = 0
vedioBean.title = drama.title
vedioBean.vedioDesc = drama.desc
vedioBean.coverImage = drama.coverImage
vedioBean.thirdId = drama.id.toString()
// 设置短剧的免费集数
vedioBean.freeIndex = 5
// 设置短剧广告解锁剧贪杯
vedioBean.unlockIndex = 1
vedioList.add(vedioBean)
}
listener.dramaCategoryListSuccess(vedioList)
}
})
} else {
listener.dramaCategoryListFail()
}
}
interface CsjrequestDramaByCategoryListener {
fun dramaCategoryListSuccess(list: MutableList<VedioBean>)
fun dramaCategoryListFail()
}
fun requestDrama(id: Long, callback: (DJXDrama) -> Unit) {
DJXSdk.service().requestDrama(
listOf(id),
object : IDJXService.IDJXCallback<MutableList<out DJXDrama>?> {
override fun onError(error: DJXError) {
Toast.makeText(MintsApplication.getContext(), "请求失败", Toast.LENGTH_SHORT)
.show()
LogUtil.d(TAG, "request failed, code = $error")
}
override fun onSuccess(
dataList: MutableList<out DJXDrama>?,
others: DJXOthers?
) {
dataList?.takeIf { it.isNotEmpty() }?.first()?.let {
//{freeSet=0, lockSet=1, reqId='20250108144948E0223379C7C0B34AB595', groupId=0, providerId=28, channelId=0, rankId=1, visibility=false, id=6187, title='荒楼诡事', coverImage='https://p6-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-size:1000000.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=c5Qnc%2F1KSmz5Hv2zzxSgvS5MFtk%3D', coverImages2='[DJXImage{url='https://p9-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-image.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=79ZTGJbUM7PclM3ZPkStGYj01%2BA%3D', backupUrl='https://p6-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-image.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=4TS9Xqs9PNM4ijwzudbNAKnkHSE%3D', definition='original'}, DJXImage{url='https://p9-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-maxresize:540:10000:q80:1000000.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=oSlF3QAC0R%2BpVlXM%2FSpj8tzWcXc%3D', backupUrl='https://p6-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-maxresize:540:10000:q80:1000000.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=Yt5nJhYdmE%2FyLrl4taZwLoJtVxo%3D', definition='540'}, DJXImage{url='https://p9-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-maxresize:360:10000:q80:1000000.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=4GNO43Mc4Ct%2FYhna%2FVgyCC6wADI%3D', backupUrl='https://p6-csj-sign.byteimg.com/tos-cn-i-4g66r8cj84/650229886c2b4c44a0caf4342ccbe33e~tplv-4g66r8cj84-maxresize:360:10000:q80:1000000.image?rk3s=363bf5d8&x-expires=1736923788&x-signature=TKJ%2FUqFGA6YUxDeMFupuUDoQ0R8%3D', definition='360'}]', status=0, total=100, index=1, type='悬疑', typeId=4, desc='西兰市近日发生3起女性奸杀的恶性连环杀人事件,近日的夜晚也因此而笼罩着诡异的氛围,一名长相靓丽的女人正走在偏僻的小道上,背后尾随着一位看起来人畜无害的纯情弟弟……', scriptName='', scriptAuthor='', createTime=1713952815', actionTime=0', unlockIndex=0', episodeStatuses=null', icpNumber=}
LogUtil.d(TAG, "request success, $it")
it.index = 1
callback.invoke(it)
}
}
})
}
}
\ No newline at end of file
...@@ -30,6 +30,7 @@ public class VedioBean implements Serializable { ...@@ -30,6 +30,7 @@ public class VedioBean implements Serializable {
private String recommendUrl;// 推荐视频地址 private String recommendUrl;// 推荐视频地址
private int recommendIndex;// 推荐视频第几集 private int recommendIndex;// 推荐视频第几集
private long seeUpdateTime;// 时间戳 private long seeUpdateTime;// 时间戳
private long groupId;//
private boolean checked;// 选中 private boolean checked;// 选中
private boolean isRecommendVedio;// 是否推荐剧 private boolean isRecommendVedio;// 是否推荐剧
private int tipMaxIndex;// 倒计时弹框 private int tipMaxIndex;// 倒计时弹框
...@@ -259,6 +260,15 @@ public class VedioBean implements Serializable { ...@@ -259,6 +260,15 @@ public class VedioBean implements Serializable {
} }
public void setRecommendVedio(boolean recommendVedio) { public void setRecommendVedio(boolean recommendVedio) {
isRecommendVedio = recommendVedio; isRecommendVedio = recommendVedio;
} }
public long getGroupId() {
return groupId;
}
public void setGroupId(long groupId) {
this.groupId = groupId;
}
} }
package com.duben.roseplaylet.mvp.presenters
import com.duben.roseplaylet.MintsApplication
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.common.DeviceInfo
import com.duben.roseplaylet.manager.AppHttpManager
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.*
import com.duben.roseplaylet.mvp.views.HomeView
import com.duben.roseplaylet.utils.AppPreferencesManager
import com.duben.roseplaylet.utils.DeviceUuidFactory
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.mvp.views.FirstView
import com.google.gson.JsonObject
import java.util.HashMap
class FirstPresenter : BasePresenter<FirstView>() {
/**
* 游客登录
*/
fun userLogin() {
val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
}
else -> {
view.showToast(message)
}
}
}
})
}
/**
* 提交设备信息
*
* @param context
*/
fun saveTerminalInfo() {
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
vo["mac"] = mac
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = MintsApplication.OAID
vo["os"] = if (deviceInfo.isHarmonyOS()) "android-HarmonyOS" else "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> {
}
}
}
})
}
}
\ No newline at end of file
package com.duben.roseplaylet.mvp.views
interface FirstView : BaseView {
}
...@@ -17,10 +17,7 @@ import com.duben.roseplaylet.R ...@@ -17,10 +17,7 @@ import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.ui.activitys.base.BaseActivity import com.duben.roseplaylet.ui.activitys.base.BaseActivity
import com.duben.roseplaylet.ui.fragment.MainFragment import com.duben.roseplaylet.ui.fragment.*
import com.duben.roseplaylet.ui.fragment.MyFragment
import com.duben.roseplaylet.ui.fragment.RecommendFragment
import com.duben.roseplaylet.ui.fragment.VipEnjoyFragment
import com.duben.roseplaylet.ui.widgets.DialogListener import com.duben.roseplaylet.ui.widgets.DialogListener
import com.duben.roseplaylet.ui.widgets.PhoneDialog import com.duben.roseplaylet.ui.widgets.PhoneDialog
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
...@@ -42,7 +39,7 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -42,7 +39,7 @@ class MainActivity : BaseActivity(), View.OnClickListener {
private var mShowBlack = false private var mShowBlack = false
// 底部标签切换的Fragment // 底部标签切换的Fragment
private var mainFragment: Fragment? = null private var firstFragment: Fragment? = null
private var recommendFragment: Fragment? = null private var recommendFragment: Fragment? = null
private var myFragment: Fragment? = null private var myFragment: Fragment? = null
private var vipEnjoyFragment: Fragment? = null private var vipEnjoyFragment: Fragment? = null
...@@ -75,16 +72,16 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -75,16 +72,16 @@ class MainActivity : BaseActivity(), View.OnClickListener {
} }
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_ONE AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_ONE
if (mainFragment == null) { if (firstFragment == null) {
mainFragment = MainFragment() firstFragment = FirstFragment()
} }
if (!mainFragment!!.isAdded) { if (!firstFragment!!.isAdded) {
// 提交事务 // 提交事务
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.add(R.id.content_layout, mainFragment!!).commitAllowingStateLoss() .add(R.id.content_layout, firstFragment!!).commitAllowingStateLoss()
// 记录当前Fragment // 记录当前Fragment
currentFragment = mainFragment currentFragment = firstFragment
} }
if (tabIvLoan != null) { if (tabIvLoan != null) {
tabIvLoan!!.isSelected = true tabIvLoan!!.isSelected = true
...@@ -158,10 +155,10 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -158,10 +155,10 @@ class MainActivity : BaseActivity(), View.OnClickListener {
*/ */
fun clickTab1Layout() { fun clickTab1Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_ONE AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_ONE
if (mainFragment == null) { if (firstFragment == null) {
mainFragment = MainFragment() firstFragment = FirstFragment()
} }
addOrShowFragment(supportFragmentManager.beginTransaction(), mainFragment!!) addOrShowFragment(supportFragmentManager.beginTransaction(), firstFragment!!)
tabIvLoan!!.isSelected = true tabIvLoan!!.isSelected = true
tabIvRecommend!!.isSelected = false tabIvRecommend!!.isSelected = false
// tabIvEnjoy!!.isSelected = false // tabIvEnjoy!!.isSelected = false
......
package com.duben.roseplaylet.ui.adapter
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.duben.roseplaylet.mvp.model.HotStyleTypesBean
import com.duben.roseplaylet.ui.fragment.CsjMovieFragment
import com.duben.roseplaylet.ui.fragment.MovieFragment
class CsjVideoPageAdapter(
private val data: List<HotStyleTypesBean>,
fragment: Fragment
) :
FragmentStateAdapter(fragment) {
private val fragments = mutableMapOf<Int, Fragment>()
override fun getItemId(position: Int): Long {
return data[position].torder.toLong()
}
override fun getItemCount() = data.size
override fun createFragment(position: Int): Fragment {
val newFragment = CsjMovieFragment.newInstance(data[position].type,position)
fragments[position] = newFragment
return newFragment
}
override fun containsItem(itemId: Long): Boolean {
data.forEach {
if (it.torder.toLong() == itemId) {
return true
}
}
return false
}
fun getFragments(): MutableMap<Int, Fragment> {
return fragments
}
}
\ No newline at end of file
package com.duben.roseplaylet.ui.fragment
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.duben.library.utils.json.JsonUtil
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.CsjDJXSdkManager
import com.duben.roseplaylet.manager.LocalVedioManager
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.model.HotStyleTypesBean
import com.duben.roseplaylet.ui.adapter.CsjVideoPageAdapter
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.roseplaylet.utils.LogUtil
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_csjvedio.*
import java.lang.reflect.Field
import java.util.*
import kotlin.concurrent.schedule
/**
* 描述:首页
* 作者:孟崔广
* 时间:2023/6/29 11:30
*/
class CsjVedioFragment : LazyLoadBaseFragment(), View.OnClickListener, OnRefreshListener {
companion object {
fun newInstance(): Fragment {
val args = Bundle()
val fragment = CsjVedioFragment()
fragment.arguments = args
return fragment
}
}
var mSelectTabIndex = -1
private val tabsData = mutableListOf<HotStyleTypesBean>()
private var vpAdapter: CsjVideoPageAdapter? = null
private var alipayTime = 0
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_csjvedio
override fun initViewsAndEvents() {
}
override fun onFragmentFirstVisible() {
initVp()
initListener()
loadData()
}
override fun onDestroy() {
super.onDestroy()
}
override fun onFragmentResume() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
if (AppConfig.exitLoginMainRefresh) {
AppConfig.exitLoginMainRefresh = false
loadData()
}
}
}
override fun onFragmentPause() {
}
private fun initListener() {
srlMainPage.setOnRefreshListener(this)
iv_main_watching_close.setOnClickListener(this)
tv_main_watching_goto.setOnClickListener(this)
}
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) {
R.id.iv_main_watching_close -> {
LocalVedioManager.closeCacheVedio()
ll_main_watching_root.visibility = View.GONE
}
R.id.tv_main_watching_goto -> {
val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) {
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), cacheVedio)
}
}
}
}
private fun loadData() {
Timer().schedule(200) {
requireActivity().runOnUiThread {
if (!TextUtils.isEmpty(userManager?.userID)) {
CsjDJXSdkManager.requestDramaCategoryList(object : CsjDJXSdkManager.CsjdramaCategoryListListener {
override fun dramaCategoryListSuccess(list: MutableList<HotStyleTypesBean>) {
tabsData.clear()
tabsData.addAll(list)
LogUtil.d("mcg--->"+JsonUtil.toJson(list))
if (tabsData.isNotEmpty()) {
mSelectTabIndex = 0
vpAdapter?.run {
notifyDataSetChanged()
Handler(Looper.getMainLooper()).postDelayed({
if (getFragments().isNotEmpty()) {
val fragment = getFragments()[mSelectTabIndex]
if (fragment != null) {
(fragment as CsjMovieFragment).onRefresh()
}
}
}, 200)
}
}
}
override fun dramaCategoryListFail() {
}
})
}
}
}
}
private fun initVp() {
vpAdapter = CsjVideoPageAdapter(tabsData, this)
vp2.adapter = vpAdapter
vp2.desensitization()
TabLayoutMediator(tablayout, vp2) { tab, position ->
// 初始化Tab
tab.id = position
if (tabsData.size > 0) {
tab.customView = getTabView(tabsData[position].type)
}
}.attach()
tablayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
updateTab(tab, true)
mSelectTabIndex = tab!!.id
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
updateTab(tab, false)
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
vp2.offscreenPageLimit = 100
}
private fun updateTab(tab: TabLayout.Tab?, isSelected: Boolean) {
tab?.customView?.let {
val text = it.findViewById<TextView>(R.id.item_tv)
if (isSelected) {
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.red))
} else {
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_8D8F90))
}
}
}
private fun getTabView(text: String): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_video_tab, null)
view.findViewById<TextView>(R.id.item_tv).text = text
return view
}
override fun onRefresh(refreshLayout: RefreshLayout) {
vpAdapter?.run {
if (getFragments().isNotEmpty()) {
val fragment = getFragments()[mSelectTabIndex]
if (fragment != null) {
(fragment as CsjMovieFragment).onRefresh()
refreshLayout.finishRefresh()
}
}
}
}
override fun onFragmentResume(firstResume: Boolean) {
super.onFragmentResume(firstResume)
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onResume()
}
override fun onPause() {
super.onPause()
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onPause()
}
fun ViewPager2.desensitization() {
//动态设置ViewPager2 灵敏度
try {
val recyclerViewField: Field = ViewPager2::class.java.getDeclaredField("mRecyclerView")
recyclerViewField.isAccessible = true
val recyclerView = recyclerViewField.get(this) as RecyclerView
val touchSlopField: Field = RecyclerView::class.java.getDeclaredField("mTouchSlop")
touchSlopField.isAccessible = true
val touchSlop = touchSlopField.get(recyclerView) as Int
touchSlopField.set(recyclerView, touchSlop * 3) //6 is empirical value
} catch (ignore: java.lang.Exception) {
}
}
}
\ No newline at end of file
package com.duben.roseplaylet.ui.fragment
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.duben.roseplaylet.R
import com.duben.roseplaylet.common.AppConfig
import com.duben.roseplaylet.common.Constant
import com.duben.roseplaylet.manager.UserManager
import com.duben.roseplaylet.mvp.presenters.FirstPresenter
import com.duben.roseplaylet.mvp.views.FirstView
import com.duben.roseplaylet.ui.adapter.RecommendPageAdapter
import com.duben.roseplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import kotlinx.android.synthetic.main.fragment_first.*
/**
* 短剧首页
*
* 孟崔广
*/
class FirstFragment : LazyLoadBaseFragment(), FirstView {
private var mSelectTabIndex = 0
private val tabsData = mutableListOf<String>()
private val fragments = mutableListOf<Fragment>()
private var vpAdapter: RecommendPageAdapter? = null
private val firstPresenter by lazy { FirstPresenter() }
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_first
override fun initViewsAndEvents() {
firstPresenter.attachView(this)
initVp2()
}
override fun onFragmentFirstVisible() {
}
override fun onFragmentResume() {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
if (TextUtils.isEmpty(userManager?.userID)) {
firstPresenter.userLogin()
}
}
}
override fun onDestroy() {
super.onDestroy()
firstPresenter.detachView()
}
private fun initVp2() {
tabsData.add("推 荐")
tabsData.add("VIP专享")
fragments.clear()
fragments.add(CsjVedioFragment.newInstance())
fragments.add(MainFragment.newInstance())
vpAdapter = RecommendPageAdapter(fragments, this)
vp2_recommend.adapter = vpAdapter
TabLayoutMediator(tab_recommend, vp2_recommend) { tab, position ->
tab.id = position
tab.customView = getTabView(position)
}.attach()
tab_recommend.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
mSelectTabIndex = tab!!.id
updateTab(tab, true, mSelectTabIndex)
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
updateTab(tab, false, mSelectTabIndex)
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
tab_recommend.getTabAt(0)?.select()
vp2_recommend.setCurrentItem(0, false)
vp2_recommend.offscreenPageLimit = 1
vp2_recommend.isUserInputEnabled = false
}
private fun getTabView(position: Int): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_recommend_tab, null)
view.findViewById<TextView>(R.id.item_tv).text = tabsData[position]
if (position == 0) {
view.findViewById<View>(R.id.item_line).background =
ContextCompat.getDrawable(requireContext(), R.drawable.shape_line_corner_red)
}
return view
}
private fun updateTab(tab: TabLayout.Tab?, isSelected: Boolean, position: Int) {
tab?.customView?.let {
val text = it.findViewById<TextView>(R.id.item_tv)
val line = it.findViewById<View>(R.id.item_line)
if (isSelected) {
line.visibility=View.VISIBLE
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.black))
} else {
text.setTextColor(
ContextCompat.getColor(
requireContext(),
R.color.black
)
)
line.visibility=View.INVISIBLE
}
line.background =
ContextCompat.getDrawable(requireContext(), R.drawable.shape_line_corner_red)
}
}
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import android.view.LayoutInflater ...@@ -8,6 +8,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2 import androidx.viewpager2.widget.ViewPager2
...@@ -50,9 +51,15 @@ import kotlin.concurrent.schedule ...@@ -50,9 +51,15 @@ import kotlin.concurrent.schedule
class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnRefreshListener { class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnRefreshListener {
companion object { companion object {
var mSelectTabIndex = -1
}
fun newInstance(): Fragment {
val args = Bundle()
val fragment = MainFragment()
fragment.arguments = args
return fragment
}
}
var mSelectTabIndex = -1
private val tabsData = mutableListOf<HotStyleTypesBean>() private val tabsData = mutableListOf<HotStyleTypesBean>()
private val bannerList = mutableListOf<BannerBean>() private val bannerList = mutableListOf<BannerBean>()
private val topList = mutableListOf<VedioBean>() private val topList = mutableListOf<VedioBean>()
...@@ -343,19 +350,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -343,19 +350,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
} }
override fun getSoltVedioSuc(data: IndexList?) { override fun getSoltVedioSuc(data: IndexList?) {
val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, true) // val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, true)
if (data != null && data.vedioMsg != null && firstVedio) { // if (data != null && data.vedioMsg != null && firstVedio) {
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false) // AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false)
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), data.vedioMsg) // LocalVedioManager.startVedioDetailActivityForType(requireActivity(), data.vedioMsg)
} else { // } else {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) { // if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// homePresenter.getRecommendVedio() //// homePresenter.getRecommendVedio()
// ////
val bundle = Bundle() // val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_MAIN, true) // bundle.putBoolean(VipActivity.IS_MAIN, true)
readyGo(VipActivity::class.java, bundle) // readyGo(VipActivity::class.java, bundle)
} // }
} // }
} }
override fun getRecommendVedioSuc(data: RecoBean?) { override fun getRecommendVedioSuc(data: RecoBean?) {
......
package com.duben.roseplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.Window
import android.view.WindowManager
import com.duben.roseplaylet.R
/**
* create by hanweiwei on 10/6/23
*/
class UnlockDialog(context: Context) : Dialog(context, R.style.dialog) {
private val btnAd by lazy { findViewById<View>(R.id.btn_unlock_by_ad) }
private var adListener: View.OnClickListener? = null
private var closeListener: View.OnClickListener? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window?.requestFeature(Window.FEATURE_NO_TITLE)
setContentView(R.layout.dialog_unlock)
setCanceledOnTouchOutside(false)
findViewById<View>(R.id.iv_unlock_close)?.setOnClickListener {
dismiss()
closeListener?.onClick(it)
}
btnAd.setOnClickListener {
dismiss()
adListener?.onClick(it)
}
}
fun setListener(ad: View.OnClickListener?, close: View.OnClickListener?): UnlockDialog {
adListener = ad
closeListener = close
return this
}
override fun show() {
super.show()
window?.let {
it.decorView.setPadding(0, 0, 0, 0)
it.setGravity(Gravity.CENTER)
it.attributes?.apply {
this.width = WindowManager.LayoutParams.MATCH_PARENT
this.height = WindowManager.LayoutParams.WRAP_CONTENT
window?.attributes = this
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<FrameLayout
android:id="@+id/fl_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_write"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingTop="24dp"
android:paddingRight="12dp"
android:paddingBottom="24dp">
<ImageView
android:id="@+id/iv_unlock_close"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_gravity="end"
android:scaleType="centerInside"
android:src="@mipmap/ic_close"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="22dp"
android:text="精彩剧情等你来解锁"
android:textColor="#E7601F"
android:textSize="20sp"
tools:ignore="HardcodedText" />
<RelativeLayout
android:id="@+id/btn_unlock_by_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:background="@drawable/shape_vip_btn"
android:gravity="center"
android:paddingLeft="24dp"
android:paddingTop="10dp"
android:paddingRight="24dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_centerVertical="true"
android:scaleType="centerInside"
android:src="@mipmap/icon_settings_about"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="38dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="看广告解锁"
android:textColor="#161823"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:alpha="0.5"
android:text="看完即可解锁1集剧集"
android:textColor="#161823"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:scaleType="centerInside"
android:src="@drawable/ksad_arrow_left"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srlMainPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_pic_list"
android:layout_width="match_parent"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:minHeight="800dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:overScrollMode="never" />
</FrameLayout>
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="#f0f2f5" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
\ No newline at end of file
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f2f5">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_main"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srlMainPage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:srlAccentColor="@color/black">
<com.scwang.smartrefresh.header.MaterialHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_behavior=".ui.widgets.AppBarLayoutBehavior">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout"
android:layout_width="wrap_content"
android:layout_height="38dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:paddingTop="-10dp"
app:tabBackground="@null"
app:tabIndicatorHeight="0dp"
app:tabMaxWidth="200dp"
app:tabMinWidth="20dp"
app:tabMode="scrollable"
app:tabPaddingEnd="6dp"
app:tabPaddingStart="6dp"
app:tabRippleColor="@null" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/ll_main_watching_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ImageView
android:id="@+id/iv_main_watching_pic"
android:layout_width="60dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_main_watching_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:singleLine="true"
android:text="我去平行时空我去平行时空"
android:textColor="@color/white"
android:textSize="15sp" />
<TextView
android:id="@+id/tv_main_watching_text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="2dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_main_watching_text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="@color/graya"
android:textSize="10sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="110dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_main_watching_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="6dp"
android:src="@mipmap/ic_quit_white" />
<TextView
android:id="@+id/tv_main_watching_goto"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:background="@drawable/shape_red"
android:gravity="center"
android:paddingTop="8dp"
android:paddingBottom="10dp"
android:text="继续观看"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_recommend"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="left"
app:tabBackground="@null"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"
app:tabRippleColor="@null" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2_recommend"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
</LinearLayout>
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/color_8D8F90" android:textColor="@color/color_8D8F90"
android:textStyle="bold" android:textStyle="bold"
android:gravity="center_horizontal"
android:textSize="16sp" /> android:textSize="16sp" />
<View <View
android:id="@+id/item_line" android:id="@+id/item_line"
android:layout_width="20dp" android:layout_width="match_parent"
android:layout_height="2dp" android:layout_height="2dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp" /> android:layout_marginTop="6dp" />
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
本公司有权对用户使用自动续费服务相关行为进行不定期监督,一旦发现用户涉及上述违反国家法律法规及社会公序良俗之道德保留之行为,本公司有权收回用户对自动续费服务的使用权而不对用户作出任何的赔偿。且本公司将依法向国家机关就用户之行为进行举报并保留进一步追究用户行为而导致本公司损失之权利。\n\n 本公司有权对用户使用自动续费服务相关行为进行不定期监督,一旦发现用户涉及上述违反国家法律法规及社会公序良俗之道德保留之行为,本公司有权收回用户对自动续费服务的使用权而不对用户作出任何的赔偿。且本公司将依法向国家机关就用户之行为进行举报并保留进一步追究用户行为而导致本公司损失之权利。\n\n
七、商业化禁止\n 七、商业化禁止\n
用户认可并同意:在未获得本公司正式书面公开许可之前,用户不得就其所获得之自动续费服务用于非本公司服务的其它领域,也不得直接或间接地对自动续费服务进行任何商业化(包括但不限于:转售、贩卖、等价置换等)的行为。一旦发现用户涉及上述之行为,本公司有权收回用户对自动续费服务的使用权而不对用户作出任何的赔偿,并保留进一步追究用户行为而导致本公司损失之权利。</string> 用户认可并同意:在未获得本公司正式书面公开许可之前,用户不得就其所获得之自动续费服务用于非本公司服务的其它领域,也不得直接或间接地对自动续费服务进行任何商业化(包括但不限于:转售、贩卖、等价置换等)的行为。一旦发现用户涉及上述之行为,本公司有权收回用户对自动续费服务的使用权而不对用户作出任何的赔偿,并保留进一步追究用户行为而导致本公司损失之权利。</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<!--内存页--> <!--内存页-->
......
...@@ -47,11 +47,11 @@ RELEASE_UMENG_KEY=64b8de13a1a164591b5133df ...@@ -47,11 +47,11 @@ RELEASE_UMENG_KEY=64b8de13a1a164591b5133df
RELEASE_TALKING_DATA_KEY="51E408B7C0FE404F97A4F80B0BDC3C06" RELEASE_TALKING_DATA_KEY="51E408B7C0FE404F97A4F80B0BDC3C06"
GROMORE_APP_ID="5566627" GROMORE_APP_ID="5458827"
GROMORE_SPLASH_CODE="102967449" GROMORE_SPLASH_CODE="103327151"
GROMORE_VIDEO_CODE="102968309" GROMORE_VIDEO_CODE="103327050"
GROMORE_EXPRESS_CODE="102967730" GROMORE_EXPRESS_CODE="103326968"
GROMORE_MY_EXPRESS_CODE="102967730" GROMORE_MY_EXPRESS_CODE="103326968"
GROMORE_MAIN_EXPRESS_CODE="102967730" GROMORE_MAIN_EXPRESS_CODE="103326968"
GROMORE_DRAW_CODE="aa" GROMORE_DRAW_CODE="aa"
GROMORE_BANNER_CODE="102967255" GROMORE_BANNER_CODE="102967255"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment