Commit 7c1bd235 authored by mengcuiguang2's avatar mengcuiguang2

删除穿山甲短剧sdk

parent 1f094cd7
......@@ -210,15 +210,15 @@ dependencies {
// umeng 接入
// 穿山甲短剧
implementation("com.pangle.cn:pangrowth-sdk:3.9.0.2") {
exclude group: 'com.pangle.cn', module: 'pangrowth-game-sdk'
exclude group: 'com.pangle.cn', module: 'pangrowth-novel-sdk'
exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-sdk'
exclude group: 'com.pangle.cn', module: 'partner-luckycat-api-sdk'
exclude group: 'com.pangle.cn', module: 'pangrowth-reward-sdk'
exclude group: 'com.pangle.cn', module: 'partner-live-sdk'
exclude group: 'com.tencent.mm.opensdk', module: 'wechat-sdk-android'
}
// implementation("com.pangle.cn:pangrowth-sdk:3.9.0.2") {
// exclude group: 'com.pangle.cn', module: 'pangrowth-game-sdk'
// exclude group: 'com.pangle.cn', module: 'pangrowth-novel-sdk'
// exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-sdk'
// exclude group: 'com.pangle.cn', module: 'partner-luckycat-api-sdk'
// exclude group: 'com.pangle.cn', module: 'pangrowth-reward-sdk'
// exclude group: 'com.pangle.cn', module: 'partner-live-sdk'
// exclude group: 'com.tencent.mm.opensdk', module: 'wechat-sdk-android'
// }
// 穿山甲聚合 接入【穿山甲、快手】
implementation "com.pangle.cn:mediation-sdk:6.1.0.4"
......
......@@ -169,11 +169,6 @@
android:exported="false"
android:theme="@style/TransparentTheme" />
<activity
android:name=".video.csj.DramaApiDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.WatchRecordActivity"
android:exported="false"
......@@ -196,13 +191,6 @@
android:exported="true" />
<!-- 短剧SDK -->
<provider
android:name="com.bytedance.sdk.dp.act.DPProvider"
android:authorities="${applicationId}.BDDPProvider"
android:exported="false" />
<!-- 自有下载 -->
<provider
android:name="androidx.core.content.FileProvider"
......
{
"init": {
"site_id": "5533187",
"app_id": "601108",
"partner": "pangle_601108",
"secure_key": "8447a94765c7f22e9fe2e8ad84b992c7",
"secure_key_d": "3a57b978ebdd87a9f68677740f908282"
},
"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": "957422056",
"news_draw_native_ad_code_id": "957422061",
"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": "957422065",
"news_outer_draw_native_ad_code_id": "957422052",
"news_interstitial_code_id": ""
},
"small_video": {
"draw_ad_code_id": "957422058",
"draw_native_ad_code_id": "957422060",
"grid_ad_code_id": "957422063",
"grid_draw_ad_code_id": "957422068",
"grid_draw_native_ad_code_id": "957422053",
"video_card_ad_code_id": "957422050",
"video_card_draw_ad_code_id": "957422067",
"video_card_draw_native_ad_code_id": "957422049",
"interstitial_ad_code_id": "",
"interstitial_note_ad_code_id": "957422066",
"staggered_grid_ad_code_id": "957422064",
"staggered_grid_draw_ad_code_id": "957422058",
"staggered_grid_draw_native_ad_code_id": "957422060",
"draw_interstitial_ad_code_id": "957422059",
"draw_fullscreen_interstitial_ad_code_id": "957422054",
"draw_banner_code_id": "957422055",
"drama_rewarded_ad_code_id": "957422062",
"drama_rewarded_ad_code_id_02": "957422051",
"drama_draw_ad_code_id": "957422057"
},
"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
}
\ No newline at end of file
......@@ -4,9 +4,6 @@ import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import com.bytedance.sdk.dp.DPDrama
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.IDPWidgetFactory
import com.duben.skitworld.ad.express.ExpressManager
import com.duben.library.utils.json.JsonUtil
import com.duben.skitworld.common.AppConfig
......@@ -14,7 +11,6 @@ import com.duben.skitworld.common.Constant
import com.duben.skitworld.mvp.model.VedioBean
import com.duben.skitworld.utils.AppPreferencesManager
import com.duben.skitworld.utils.ToastUtil
import com.duben.skitworld.video.csj.DramaApiDetailActivity
import com.duben.skitworld.video.tx.newrecommend.NewTxVideoActivity
import com.duben.skitworld.video.tx.TxVideoActivity
......@@ -109,7 +105,7 @@ object LocalVedioManager {
bundle.putBoolean(Constant.VEDIO_THIRD, isThirdId)
readyGo(activity, TxVideoActivity::class.java, bundle)
} else if (data?.createType == 2) {
requestDrama(activity, data)
// 穿山甲
} else {
//推荐短剧
val bundle = Bundle()
......@@ -122,37 +118,6 @@ object LocalVedioManager {
}
}
// 请求穿山甲数据
private fun requestDrama(activity: Activity, data: VedioBean?) {
if (DPSdk.isStartSuccess() && data != null) {
DPSdk.factory().requestDrama(
arrayListOf(data.thirdId.toLong()), object : IDPWidgetFactory.DramaCallback {
override fun onError(p0: Int, p1: String?) {
ToastUtil.show(activity, "网络错误!")
}
override fun onSuccess(
dataList: MutableList<out DPDrama>?,
info: MutableMap<String, Any>?
) {
dataList?.takeIf { it.isNotEmpty() }?.first()?.let {
DramaApiDetailActivity.outerDrama = it
//穿山甲短剧
val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data))
readyGo(activity, DramaApiDetailActivity::class.java, bundle)
}
}
}
)
} else {
ToastUtil.show(activity, "网络错误!")
}
}
fun readyGo(activity: Activity, clazz: Class<*>, bundle: Bundle) {
val intent = Intent(activity, clazz)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
......
......@@ -8,9 +8,6 @@ import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import com.bytedance.hume.readapk.HumeSDK
import com.bytedance.sdk.dp.DPDrama
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.IDPWidgetFactory
import com.duben.skitworld.BuildConfig
import com.duben.skitworld.MintsApplication
import com.duben.skitworld.R
......@@ -96,36 +93,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
tvAboutasPolicy.setOnClickListener(this)
findViewById<TextView>(R.id.tv_about_address).setOnLongClickListener {
if (BuildConfig.DEBUG) {
if (DPSdk.isStartSuccess()) {
DPSdk.factory().requestAllDrama(
1,
Int.MAX_VALUE,
true,
object : IDPWidgetFactory.DramaCallback {
override fun onError(code: Int, msg: String?) {
Log.d("AboutusActivity", "request failed, code = $code, msg = $msg")
Toast.makeText(this@AboutusActivity, "请求失败", Toast.LENGTH_SHORT)
.show()
}
override fun onSuccess(
dataList: MutableList<out DPDrama>?,
info: MutableMap<String, Any>?
) {
Toast.makeText(this@AboutusActivity, "请求成功", Toast.LENGTH_SHORT)
.show()
val json = JsonUtil.toJson(dataList)
Log.d("AboutusActivity", "request success, drama = " + json)
Log.d("AboutusActivity", "request success, dataList size = " + dataList!!.size)
TrackManager.getInstance().commitCsjShotInfo(json)
}
})
} else {
Toast.makeText(this@AboutusActivity, "sdk还未初始化", Toast.LENGTH_SHORT).show()
}
}
return@setOnLongClickListener true
......
......@@ -23,7 +23,6 @@ import com.duben.skitworld.ui.fragment.RecommendFragment
import com.duben.skitworld.ui.fragment.VipEnjoyFragment
import com.duben.skitworld.ui.widgets.DialogListener
import com.duben.skitworld.ui.widgets.PhoneDialog
import com.duben.skitworld.video.csj.DPHolderManager
import kotlinx.android.synthetic.main.activity_main.*
/**
......@@ -56,7 +55,6 @@ class MainActivity : BaseActivity(), View.OnClickListener {
}
override fun initViewsAndEvents() {
DPHolderManager.initDpSdk(MintsApplication.getContext());
audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
......
......@@ -14,7 +14,6 @@ import com.duben.skitworld.manager.UserManager
import com.duben.skitworld.ui.activitys.MainActivity
import com.duben.skitworld.ui.adapter.RecommendPageAdapter
import com.duben.skitworld.ui.fragment.base.BaseFragment
import com.duben.skitworld.video.csj.DramaTabFragment
import com.duben.skitworld.video.tx.TxVideoFragment
import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.fragment_recommend.*
......@@ -49,13 +48,16 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
tabsData.add("推荐")
fragments.clear()
if (mCurrentNewFlag) {
fragments.add(FollowVideoFragment.newInstance())
fragments.add(TxVideoFragment.newInstance())
} else {
fragments.add(FollowVideoFragment.newInstance())
fragments.add(DramaTabFragment())
}
fragments.add(FollowVideoFragment.newInstance())
fragments.add(TxVideoFragment.newInstance())
// if (mCurrentNewFlag) {
// fragments.add(FollowVideoFragment.newInstance())
// fragments.add(TxVideoFragment.newInstance())
// } else {
// fragments.add(FollowVideoFragment.newInstance())
// fragments.add(DramaTabFragment())
// }
vpAdapter = RecommendPageAdapter(fragments, this)
vp2_recommend.adapter = vpAdapter
......
package com.duben.skitworld.video.csj
import android.content.Context
import android.util.Log
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.DPSdkConfig
/**
* 穿山甲短剧SDK
*/
object DPHolderManager {
const val TAG = "DPHolderManager"
var isDPStarted = false
fun initDpSdk(context: Context) {
//1. 初始化,最好放到application.onCreate()执行
val configBuilder = DPSdkConfig.Builder().debug(true)
DPSdk.init(context, "SDK_Setting_5538933.json", configBuilder.build())
startDpSdk()
}
fun startDpSdk() {
DPSdk.start { isSuccess, message ->
//请确保使用Sdk时Sdk已经成功启动
//isSuccess=true表示启动成功
//启动失败,可以再次调用启动接口(建议最多不要超过3次)
isDPStarted = isSuccess
Log.e(TAG, "start result=$isSuccess, msg=$message")
}
}
}
\ No newline at end of file
package com.duben.skitworld.video.csj
/**
* author : ChenWenJie
* email : 1181620038@qq.com
* date : 2020/9/22
* desc : 监听接口
*/
interface OnRecyViewListener {
/*初始化完成*/
fun onInitComplete()
/*释放的监听*/
fun onPageRelease(isNext: Boolean, position: Int)
/*选中的监听以及判断是否滑动到底部*/
fun onPageSelected(position: Int, isBottom: Boolean)
}
\ No newline at end of file
package com.duben.skitworld.video.csj
import android.content.Context
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.PagerSnapHelper
import androidx.recyclerview.widget.RecyclerView
/**
* author : ChenWenJie
* email : 1181620038@qq.com
* date : 2020/9/22
* desc : 定义管理器,一item一屏 监听滑动状态
*/
class RecyViewLayoutManager : LinearLayoutManager {
private var mPagerSnapHelper: PagerSnapHelper? = null
private var mOnRecycleViewListener: OnRecyViewListener? = null
private var mRecyclerView: RecyclerView? = null
private var mDrift = 0//位移,用来判断移动方向
private val mChildAttachStateChangeListener: RecyclerView.OnChildAttachStateChangeListener =
object : RecyclerView.OnChildAttachStateChangeListener {
override fun onChildViewDetachedFromWindow(view: View) {
if (mDrift >= 0) {
if (mOnRecycleViewListener != null) {
mOnRecycleViewListener!!.onPageRelease(true, getPosition(view))
}
} else {
if (mOnRecycleViewListener != null) {
mOnRecycleViewListener!!.onPageRelease(false, getPosition(view))
}
}
}
override fun onChildViewAttachedToWindow(view: View) {
if (mOnRecycleViewListener != null && childCount === 1) {
mOnRecycleViewListener!!.onInitComplete()
}
}
}
constructor(context: Context?, orientation: Int) : super(
context,
orientation,
false
) {
init()
}
constructor(
context: Context?,
orientation: Int,
reverseLayout: Boolean
) : super(context, orientation, reverseLayout) {
init()
}
private fun init() {
mPagerSnapHelper = PagerSnapHelper()
}
override fun onAttachedToWindow(view: RecyclerView?) {
super.onAttachedToWindow(view)
mPagerSnapHelper?.attachToRecyclerView(view)
mRecyclerView = view
mRecyclerView?.addOnChildAttachStateChangeListener(mChildAttachStateChangeListener)
}
override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {
super.onLayoutChildren(recycler, state)
//
}
/**
* 滑动状态的改变
* 缓慢拖拽-> SCROLL_STATE_DRAGGING
* 快速滚动-> SCROLL_STATE_SETTLING
* 空闲状态-> SCROLL_STATE_IDLE
*
* @param state
*/
override fun onScrollStateChanged(state: Int) {
when (state) {
RecyclerView.SCROLL_STATE_IDLE -> {
val viewIdle: View = mPagerSnapHelper!!.findSnapView(this)!!
val positionIdle: Int = getPosition(viewIdle)
if (mOnRecycleViewListener != null && getChildCount() === 1) {
mOnRecycleViewListener!!.onPageSelected(
positionIdle,
positionIdle == getItemCount() - 1
)
}
}
RecyclerView.SCROLL_STATE_DRAGGING -> {
val viewDrag: View? = mPagerSnapHelper!!.findSnapView(this)!!
val positionDrag: Int = getPosition(viewDrag!!)
}
RecyclerView.SCROLL_STATE_SETTLING -> {
val viewSettling: View = mPagerSnapHelper!!.findSnapView(this)!!
val positionSettling: Int = getPosition(viewSettling)
}
}
}
/**
* 监听竖直方向的相对偏移量
*
* @param dy
* @param recycler
* @param state
* @return
*/
override fun scrollVerticallyBy(
dy: Int,
recycler: RecyclerView.Recycler?,
state: RecyclerView.State?
): Int {
mDrift = dy
return super.scrollVerticallyBy(dy, recycler, state)
}
/**
* 监听水平方向的相对偏移量
*
* @param dx
* @param recycler
* @param state
* @return
*/
override fun scrollHorizontallyBy(
dx: Int,
recycler: RecyclerView.Recycler?,
state: RecyclerView.State?
): Int {
mDrift = dx
return super.scrollHorizontallyBy(dx, recycler, state)
}
/**
* 设置监听
*
* @param listener
*/
fun setOnViewPagerListener(listener: OnRecyViewListener?) {
mOnRecycleViewListener = listener
}
companion object {
private const val TAG = "ViewPagerLayoutManager"
}
}
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/fl_container"
android:keepScreenOn="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment