Commit ab481650 authored by jyx's avatar jyx

添加穿山甲短剧 SDK

parent 7e8f055b
......@@ -133,7 +133,6 @@ android {
dirs 'libs'
}
}
}
MobSDK {
spEdition "fp"
......@@ -255,6 +254,16 @@ dependencies {
implementation 'com.github.yyued:SVGAPlayer-Android:2.1.4'
// 穿山甲
implementation ("com.pangle.cn:pangrowth-sdk:3.7.0.1") {
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'
}
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
......
......@@ -13,6 +13,11 @@
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<!-- 穿山甲 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:name=".MintsApplication"
android:allowBackup="false"
......@@ -185,8 +190,8 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.VedioActivity"
android:exported="false"
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.ManageOrderActivity"
......@@ -201,6 +206,15 @@
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".vedio.DramaHomeActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".vedio.DrawDramaActivity"
android:exported="false"
android:screenOrientation="portrait" />
<service
android:name=".ui.service.UpdateService"
android:exported="true" />
......@@ -240,6 +254,11 @@
android:resource="@xml/pangle_file_paths" />
</provider>
<provider
android:name="com.bytedance.sdk.dp.act.DPProvider"
android:authorities="${applicationId}.BDDPProvider"
android:exported="false" />
<provider
android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
android:authorities="${applicationId}.TTMultiProvider"
......
{
"init": {
"site_id": "5175152",
"app_id": "193842",
"partner": "pangle_193842",
"secure_key": "11146c60bf023251701462c31a44a28b"
},
"feed": {
"news_list_ad_code_id": "946175237",
"news_first_ad_code_id": "946175238",
"news_second_ad_code_id": "946175242",
"video_first_ad_code_id": "",
"video_second_ad_code_id": "946175251",
"related_ad_code_id": "946175239",
"news_draw_ad_code_id": "946175243",
"news_draw_native_ad_code_id": "946175244",
"news_interstitial_code_id": "947027583"
},
"small_video": {
"draw_ad_code_id": "946175245",
"draw_native_ad_code_id": "946175248",
"grid_ad_code_id": "946175241",
"grid_draw_ad_code_id": "946175246",
"grid_draw_native_ad_code_id": "946175250",
"video_card_ad_code_id": "946175247",
"video_card_draw_ad_code_id": "946175240",
"video_card_draw_native_ad_code_id": "946175249",
"interstitial_note_ad_code_id": "946506704",
"draw_fullscreen_interstitial_ad_code_id":"947490273",
"draw_interstitial_ad_code_id":"947490116",
"staggered_grid_ad_code_id": "946506705",
"staggered_grid_draw_ad_code_id": "946175245",
"staggered_grid_draw_native_ad_code_id": "946175248",
"draw_banner_code_id": "947490413",
"drama_rewarded_ad_code_id": "951008975",
"drama_rewarded_ad_code_id_02": "951011822",
"drama_draw_ad_code_id": "952225157"
},
"novel": {
"banner_ad_code_id": "946508521",
"exciting_ad_code_id": "946176105",
"interstitial_code_id": "946508522",
"mid_ad_code_id": "946176107",
"pre_ad_code_id": "946176106",
"status": 1
},
"live": {
"live_card_ad_code_id": "946192110",
"live_preview_draw_ad_code_id": "947474066",
"live_preview_draw_native_ad_code_id": "947474068"
}
}
......@@ -17,6 +17,7 @@ import com.mints.wisdomclean.net.LoanService;
import com.mints.wisdomclean.utils.AppPreferencesManager;
import com.mints.wisdomclean.utils.MateUtils;
import com.mints.wisdomclean.utils.ForegroundOrBackground;
import com.mints.wisdomclean.vedio.DPHolderManager;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
......
......@@ -17,10 +17,14 @@ import com.mints.wisdomclean.ui.activitys.*
import com.mints.wisdomclean.ui.fragment.base.BaseFragment
import com.mints.wisdomclean.utils.TimeRender
import com.mints.library.utils.nodoubleclick.AntiShake
import com.mints.wisdomclean.MintsApplication
import com.mints.wisdomclean.ui.widgets.DialogListener
import com.mints.wisdomclean.ui.widgets.DialogUtils
import com.mints.wisdomclean.utils.SpanUtils
import com.mints.wisdomclean.utils.UcropUtils
import com.mints.wisdomclean.vedio.DPHolderManager
import com.mints.wisdomclean.vedio.DramaHomeActivity
import com.mints.wisdomclean.vedio.DrawDramaActivity
import kotlinx.android.synthetic.main.fragment_main_my.*
/**
......@@ -49,6 +53,8 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
.create()
initListener()
DPHolderManager.initDpSdk(MintsApplication.getContext())
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -95,7 +101,10 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
}
}
R.id.iv_my_set -> {
readyGo(SettingsActivity::class.java)
// readyGo(SettingsActivity::class.java)
// readyGo(DramaHomeActivity::class.java)
readyGo(DrawDramaActivity::class.java)
}
R.id.ll_feedback, R.id.ll_contactus2, R.id.ll_contactus -> {
// 联系客服
......
package com.mints.wisdomclean.vedio
import android.app.Application
import android.content.Context
import android.util.Log
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.DPSdkConfig
/**
* @author Assen
* @date 2023/6/21
* @desc
*/
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_5175152.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.mints.wisdomclean.vedio
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.bytedance.sdk.dp.*
import com.mints.wisdomclean.R
/**
* Created by limingqi on 2023/1/28
*/
class DramaHomeActivity : AppCompatActivity() {
companion object {
private const val TAG = "DramaHomeActivity"
}
private var dpWidget: IDPWidget? = null
private var isInited = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.drama_home_frag_wrapper)
if (DPSdk.isStartSuccess()) {
init()
}
}
private fun init() {
if (isInited) {
return
}
initWidget()
dpWidget?.let { widget ->
supportFragmentManager.beginTransaction().replace(R.id.fl_container, widget.fragment)
.commit()
isInited = true
}
}
private fun initWidget() {
dpWidget = DPSdk.factory().createDramaHome(
DPWidgetDramaHomeParams.obtain()
.listener(object : IDPDramaHomeListener() {
override fun onItemClick(drama: DPDrama?, map: MutableMap<String, Any>?) {
super.onItemClick(drama, map)
drama ?: return
map ?: return
Log.d(TAG, "onItemClick Drama = $drama, CommonParams = $map")
}
})
)
}
}
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
\ No newline at end of file
<?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/draw_drama_frame"
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