Commit f4929c61 authored by jyx's avatar jyx

添加GroMore信息流及AppLog

parent 65372e0a
......@@ -6,6 +6,7 @@ apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'android-aspectjx'
apply plugin: 'com.sensorsdata.analytics.android'
apply plugin: 'com.bytedance.std.tracker'
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
......@@ -38,7 +39,8 @@ android {
UMENG_KEY : RELEASE_UMENG_KEY,
SHARE_KEY : RELEASE_SHARESDK_KEY,
SHARE_SECRET : RELEASE_SHARESDK_SECRET,
APPLICATION_ID : applicationId]
APPLICATION_ID : applicationId,
APPLOG_SCHEME : "rangersapplog.98d71e505549780b".toLowerCase()]
}
......@@ -371,4 +373,6 @@ dependencies {
// 快手
implementation(name: 'kssdk-ad-3.3.9', ext: 'aar')
// implementation(name: 'kssdk-all--3.3.16-publishRelease-9ffe2b94e', ext: 'aar')
// applog
implementation 'com.bytedance.applog:RangersAppLog-All-cn:5.2.6'
}
......@@ -141,6 +141,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activitys.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
......@@ -251,10 +252,13 @@
<activity
android:name=".call.detail.DetailApplyActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.XiaomanActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.ShaiziActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".ui.activitys.XiaomanActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.ShaiziActivity"
android:screenOrientation="portrait" />
<service
android:name=".service.UpdateService"
android:exported="true" />
......
......@@ -12,6 +12,7 @@ import androidx.multidex.MultiDexApplication;
import com.hjq.toast.ToastUtils;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.CsjAppLogManager;
import com.mints.goodmoney.manager.CsjGroMoreManager;
import com.mints.goodmoney.manager.KsManager;
import com.mints.goodmoney.manager.LiebaoManager;
......@@ -129,7 +130,10 @@ public class MintsApplication extends MultiDexApplication {
TtCsjAdManager.init(this);
// GroMore
CsjGroMoreManager.INSTANCE.init();
CsjGroMoreManager.INSTANCE.init(this);
// AppLog
CsjAppLogManager.INSTANCE.init(this);
// 快手
KsManager.INSTANCE.initKs(this);
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ad.express
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.bytedance.msdk.api.nativeAd.TTNativeAd
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.WeightBean
......@@ -14,7 +15,7 @@ import java.util.*
/**
* 预加载信息流管理类
*/
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener {
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener, GMADLoadSuccessListener {
private val TAG = PreLoadExpressManager::class.java.simpleName
......@@ -28,18 +29,21 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
private var csjWeight = 0
private var ylhWeight = 0
private var ksWeight = 0
private var gmWeight = 0
init {
mAdFrameLayout = FrameLayout(MintsApplication.getContext())
YlhPreLoadExpressManager.setListener(this)
TTPreLoadExpressManager.getInstance().setListener(this)
KsPreLoadExpressManager.setListener(this)
GroMoreExpressManager.instance.setListener(this)
}
fun init(csjWeight: Int, ylhWeight: Int, ksWeight: Int) {
fun init(csjWeight: Int, ylhWeight: Int, ksWeight: Int, gmWeight: Int) {
this.csjWeight = csjWeight
this.ylhWeight = ylhWeight
this.ksWeight = ksWeight
this.gmWeight = gmWeight
}
fun loadADFrameLayout() {
......@@ -61,6 +65,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout)
Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout()
Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup)
Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout()
else -> {
TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout)
}
......@@ -76,19 +81,24 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// 若没有视频完成数,不加入权重计算范围内
if (csjWeight > 0) {
weightList.add(WeightBean(csjWeight, Constant.CSJ_EXPRESS_AD))
weight = weight + csjWeight
weight += csjWeight
LogUtil.d(TAG, "EXPRESS权重值:csjWeight:$csjWeight")
}
if (ylhWeight > 0) {
weightList.add(WeightBean(ylhWeight, Constant.YLH_EXPRESS_AD))
weight = weight + ylhWeight
weight += ylhWeight
LogUtil.d(TAG, "EXPRESS权重值:ylhWeight:$ylhWeight")
}
if (ksWeight > 0) {
weightList.add(WeightBean(ksWeight, Constant.KS_EXPRESS_AD))
weight = weight + ksWeight
weight += ksWeight
LogUtil.d(TAG, "EXPRESS权重值:ksWeight:$ksWeight")
}
if (gmWeight > 0) {
weightList.add(WeightBean(gmWeight, Constant.GM_EXPRESS_AD))
weight += gmWeight
LogUtil.d(TAG, "EXPRESS权重值:gmWeight:$gmWeight")
}
// 权重随机
if (weightList.size > 0 && weight > 0) {
......@@ -142,6 +152,13 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
mAdFrameLayout?.addView(view)
}
override fun onGMAdLoadSuc(ttNativeAd: TTNativeAd?) {
// if (currentIndex == 3) {
// mAdFrameLayout?.addView(view)
// }
mAdFrameLayout?.addView(ttNativeAd?.expressView)
}
}
interface TTADLoadSuccessListener {
......@@ -155,3 +172,7 @@ interface YLHADLoadSuccessListener {
interface KSADLoadSuccessListener {
fun onKSAdLoadSuc(ksNativeAd: View?)
}
interface GMADLoadSuccessListener {
fun onGMAdLoadSuc(ttNativeAd: TTNativeAd?)
}
\ No newline at end of file
......@@ -188,6 +188,7 @@ object Constant {
const val CSJ_EXPRESS_AD = "CSJ_EXPRESS_AD"
const val YLH_EXPRESS_AD = "YLH_EXPRESS_AD"
const val KS_EXPRESS_AD = "KS_EXPRESS_AD"
const val GM_EXPRESS_AD = "GM_EXPRESS_AD"
// 游戏类型
const val EVENT_TYPE_CLICK = "CLICK"
......
package com.mints.goodmoney.manager
import android.app.Application
import com.bytedance.applog.AppLog
import com.bytedance.applog.InitConfig
import com.bytedance.applog.util.UriConstants
import com.mints.goodmoney.utils.LogUtil
private val TAG = CsjAppLogManager::class.java.simpleName
object CsjAppLogManager {
fun init(application: Application) {
/* 初始化开始 */
val config = InitConfig("your_appid", "your_channel") // appid和渠道,appid如不清楚请联系对接同学
//上报域名只支持中国
config.setUriConfig(UriConstants.DEFAULT)
// 是否在控制台输出日志,可用于观察用户行为日志上报情况
config.setLogger { msg, t -> LogUtil.d(TAG, "$msg -> $t") }
config.setAutoStart(true)
AppLog.init(application, config)
/* 初始化结束 */
/* 自定义 “用户公共属性”(可选,初始化后调用, key相同会覆盖)
关于自定义 “用户公共属性” 请注意:1. 上报机制是随着每一次日志发送进行提交,默认的日志发送频率是1分钟,所以如果在一分钟内连续修改自定义用户公共属性,,按照日志发送前的最后一次修改为准, 2. 不推荐高频次修改,如每秒修改一次 */
//Map<String,Object> headerMap = new HashMap<String, Object>();
//headerMap.put("your_custom_key","your_custom_value");
//AppLog.setHeaderInfo((HashMap<String, Object>)headerMap);
//移除公共属性
//AppLog.removeHeaderInfo("your_custom_key");
}
}
\ No newline at end of file
......@@ -5,8 +5,10 @@ import com.mints.goodmoney.MintsApplication
object CsjGroMoreManager {
fun init(){
TTGroMoreAdManagerHolder.init(MintsApplication.getContext())
const val AD_UNIT_ID = "946167770"
fun init(application: MintsApplication) {
TTGroMoreAdManagerHolder.init(application)
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ public class FlowAdRulesBean implements Serializable {
private int YLH;
private int KS;
private int CSJ;
private int GROMORE;
public int getYLH() {
return YLH;
......@@ -22,4 +23,8 @@ public class FlowAdRulesBean implements Serializable {
public int getCSJ() {
return CSJ;
}
public int getGROMORE() {
return GROMORE;
}
}
......@@ -11,6 +11,7 @@ import android.view.KeyEvent
import android.view.View
import androidx.core.content.ContextCompat
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
......@@ -391,6 +392,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
try {
PreLoadExpressManager.loadADFrameLayout()
// GroMoreExpressManager.instance.loadADFrameLayout()
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager
......@@ -50,6 +51,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
svWalk?.destoryAnim()
flSubsidykAd?.removeAllViews()
GroMoreExpressManager.instance.loadADFrameLayout()
foodSubsidyPresenter.detachView()
}
......@@ -100,7 +104,8 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flSubsidykAd != null) {
flSubsidykAd.removeAllViews()
flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
// flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flSubsidykAd.addView(GroMoreExpressManager.instance.getADFrameLayout())
}
}
} catch (e: Exception) {
......
......@@ -5,6 +5,7 @@ import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
......@@ -53,6 +54,9 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
override fun onDestroy() {
super.onDestroy()
GroMoreExpressManager.instance.loadADFrameLayout()
flMorningClockAd?.removeAllViews()
morningClockPresenter.detachView()
}
......@@ -182,11 +186,10 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
*/
private fun initExpress() {
try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flMorningClockAd != null) {
flMorningClockAd.removeAllViews()
flMorningClockAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
// flMorningClockAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flMorningClockAd.addView(GroMoreExpressManager.instance.getADFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager
......@@ -44,6 +45,8 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
override fun onDestroy() {
super.onDestroy()
GroMoreExpressManager.instance.loadADFrameLayout()
svWalk?.destoryAnim()
flWalkAd?.removeAllViews()
walkPresenter.detachView()
......@@ -110,7 +113,8 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flWalkAd != null) {
flWalkAd.removeAllViews()
flWalkAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
// flWalkAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flWalkAd.addView(GroMoreExpressManager.instance.getADFrameLayout())
}
}
} catch (e: Exception) {
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager
......@@ -47,6 +48,8 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
override fun onDestroy() {
super.onDestroy()
GroMoreExpressManager.instance.loadADFrameLayout()
// 取消水滴动画
wvWater?.destoryAnim()
wvWater?.closeWaterViewTime()
......@@ -111,11 +114,10 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
*/
private fun initExpress() {
try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flWaterAd != null) {
flWaterAd.removeAllViews()
flWaterAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
// flWaterAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flWaterAd.addView(GroMoreExpressManager.instance.getADFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -16,6 +16,7 @@ import com.daimajia.androidanimations.library.YoYo
import com.daimajia.androidanimations.library.YoYo.YoYoString
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import com.mints.goodmoney.ad.video.VideoAdingManager
......@@ -64,7 +65,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private var bindWxDialog: BindWxDialog? = null
private var userMsgBean: UserTaskMsgBean? = null
private lateinit var baseResponse: BaseResponse<UserTaskMsgBean>
// private lateinit var baseResponse: BaseResponse<UserTaskMsgBean>
// 视频相关
private var rewardDoubleCoin = 0 // 大金币
......@@ -98,6 +99,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
videoAdingManager = VideoAdingManager.getInstance(activity)
// 奖励页预加载 信息流广告
PreLoadExpressManager.loadADFrameLayout()
// GroMoreExpressManager.instance.loadADFrameLayout()
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
......@@ -647,7 +649,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
private fun initExpress(flowAdRules: FlowAdRulesBean) {
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks)
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks, flowAdRules.gromore)
}
/**
......
......@@ -381,7 +381,7 @@ class MyFragment : BaseFragment(),
* 跳转到微信搜索页面
*/
private fun getWechatApi() {
LogUtil.d("getWeChatApi","点击事件响应了。。。。。。。。。。。。。。。。。。。")
LogUtil.d("getWeChatApi", "点击事件响应了。。。。。。。。。。。。。。。。。。。")
try {
val intent = Intent(Intent.ACTION_MAIN)
val cmp = ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI")
......@@ -1330,7 +1330,7 @@ class MyFragment : BaseFragment(),
}
private fun initExpress(flowAdRules: FlowAdRulesBean) {
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks)
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks, flowAdRules.gromore)
}
/**
......
package com.mints.goodmoney.utils;
import com.bytedance.msdk.api.BaiduExtraOptions;
import com.bytedance.msdk.api.GDTExtraOption;
import com.bytedance.msdk.api.TTVideoOption;
public class VideoOptionUtil {
public static TTVideoOption getTTVideoOption() {
//广点通(GDT)单独使用配置
GDTExtraOption gdtExtraOption = new GDTExtraOption.Builder()
.setGDTAutoPlayMuted(true)//自动播放是否静音,默认true
.setGDTDetailPageMuted(false)//详情页是否静音,默认值为false,即有声播放;
.setGDTEnableDetailPage(true)//是否能跳转详情页,默认true
.setGDTEnableUserControl(false)//是否能控制是否暂停与播放,默认false
.setGDTMaxVideoDuration(0)//视频最大长度,单位:秒 此设置会影响广告填充,请谨慎设置
.setGDTMinVideoDuration(0)//视频最小长度,单位:秒 此设置会影响广告填充,请谨慎设置
// VideoOption.AutoPlayPolicy.WIFI表示只在WiFi下自动播放;
// VideoOption.AutoPlayPolicy.ALWAYS表示始终自动播放,不区分当前网络;
// VideoOption.AutoPlayPolicy.NEVER表示始终都不自动播放,不区分当前网络,但在WiFi时会预下载视频资源;
// 默认为始终自动播放;模板渲染视频、插屏2.0视频、自渲染2.0视频都可使用
.setAutoPlayPolicy(GDTExtraOption.AutoPlayPolicy.WIFI)//自动播放策略--
.setDownAPPConfirmPolicy(GDTExtraOption.DownAPPConfirmPolicy.TYPE_DEFAULT)//指定点击 APP 广告后是否展示二次确认,可选项包括 Default(wifi 不展示,非wifi 展示),NoConfirm(所有情况不展示)
.setBrowserType(GDTExtraOption.BrowserType.TYPE_DEFAULT)//指定普链广告点击后用于展示落地页的浏览器类型,可选项包括:InnerBrowser(APP 内置浏览器),Sys(系统浏览器),Default(默认),SDK 按照默认逻辑选择
.build();
//针对百度SDK信息流设置
BaiduExtraOptions baiduExtraOptions = new BaiduExtraOptions.Builder()
.setGDTExtraOption(BaiduExtraOptions.DOWNLOAD_APP_CONFIRM_ALWAYS)
.setCacheVideoOnlyWifi(true).build();
//视频声音控制
TTVideoOption videoOption = new TTVideoOption.Builder()
.setMuted(false) //所有类型生效,GDT除外
.setAdmobAppVolume(1f)//admob 声音配置,与setMuted配合使用
.setGDTExtraOption(gdtExtraOption)//GDT 单独
.setBaiduExtraOption(baiduExtraOptions)//百度SDK配置
.build();
return videoOption;
}
public static TTVideoOption getTTVideoOption2() {
//广点通(GDT)单独使用配置
GDTExtraOption gdtExtraOption = new GDTExtraOption.Builder()
.setGDTAutoPlayMuted(true)//自动播放是否静音,默认true
.setGDTDetailPageMuted(false)//详情页是否静音,默认值为false,即有声播放;
.setGDTEnableDetailPage(true)//是否能跳转详情页,默认true
.setGDTEnableUserControl(false)//是否能控制是否暂停与播放,默认false
.setGDTMaxVideoDuration(0)//视频最大长度,单位:秒 此设置会影响广告填充,请谨慎设置
.setGDTMinVideoDuration(0)//视频最小长度,单位:秒 此设置会影响广告填充,请谨慎设置
.setFeedExpressType(GDTExtraOption.FeedExpressType.FEED_EXPRESS_TYPE_2)//确定使用GDT FEED 模板渲染2.0功能;需要向广点通商务申请2.0权限
// VideoOption.AutoPlayPolicy.WIFI表示只在WiFi下自动播放;
// VideoOption.AutoPlayPolicy.ALWAYS表示始终自动播放,不区分当前网络;
// VideoOption.AutoPlayPolicy.NEVER表示始终都不自动播放,不区分当前网络,但在WiFi时会预下载视频资源;
// 默认为始终自动播放;模板渲染视频、插屏2.0视频、自渲染2.0视频都可使用
.setAutoPlayPolicy(GDTExtraOption.AutoPlayPolicy.WIFI)//自动播放策略--
.setDownAPPConfirmPolicy(GDTExtraOption.DownAPPConfirmPolicy.TYPE_DEFAULT)//指定点击 APP 广告后是否展示二次确认,可选项包括 Default(wifi 不展示,非wifi 展示),NoConfirm(所有情况不展示)
.setBrowserType(GDTExtraOption.BrowserType.TYPE_DEFAULT).build();//指定普链广告点击后用于展示落地页的浏览器类型,可选项包括:InnerBrowser(APP 内置浏览器),Sys(系统浏览器),Default(默认),SDK 按照默认逻辑选择
//针对百度SDK信息流设置
BaiduExtraOptions baiduExtraOptions = new BaiduExtraOptions.Builder()
.setGDTExtraOption(BaiduExtraOptions.DOWNLOAD_APP_CONFIRM_ALWAYS)
.setCacheVideoOnlyWifi(true).build();
//视频声音控制
TTVideoOption videoOption = new TTVideoOption.Builder()
.setMuted(false) //所有类型生效,GDT除外
.setAdmobAppVolume(1f)//admob 声音配置,与setMuted配合使用
.setGDTExtraOption(gdtExtraOption)//GDT 单独
.setBaiduExtraOption(baiduExtraOptions)//百度SDK配置
.build();
return videoOption;
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<corners android:radius="6dp" />
<stroke android:color="#3C93CD" android:width="1dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<corners android:radius="6dp" />
<stroke android:color="#f85959" android:width="1dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" >
<shape >
<stroke android:color="#7f2a90d7" />
<solid android:color="#2a90d7" />
<corners android:radius="6dp"/>
</shape>
</item>
<item >
<shape >
<stroke android:color="#2a90d7" />
<solid android:color="#2a90d7" />
<corners android:radius="6dp"/>
</shape>
</item>
</selector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ad_title_creative_btn_layout"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:visibility="gone"
android:orientation="horizontal">
<Button
android:id="@+id/btn_listitem_stop"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/btn_bg_blue"
android:textColor="#3C93CD"
android:text="暂停下载"
android:visibility="gone" />
<Button
android:id="@+id/btn_listitem_remove"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:background="@drawable/btn_bg_red"
android:textColor="#f85959"
android:text="删除下载"
android:visibility="gone" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText">
<!-- icon+广告源+关闭按钮 layout -->
<include
android:id="@+id/icon_source_layout"
layout="@layout/listitem_ad_icon_source_layout"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:paddingEnd="10dp"
android:paddingRight="10dp" />
<TextView
android:id="@+id/tv_listitem_ad_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/icon_source_layout"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1"
android:maxLines="2"
android:singleLine="false"
android:text="劳力士服务中心,清洗保养,更换配件,9秒费用查询"
android:textColor="@android:color/black"
android:textSize="18sp" />
<!-- -->
<LinearLayout
android:id="@+id/layout_image_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_listitem_ad_desc"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_listitem_image1"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/iv_listitem_image2"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/iv_listitem_image3"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:scaleType="centerCrop" />
</LinearLayout>
<!-- title+creativeBtn layout -->
<include
android:id="@+id/ad_title_creative_btn_layout"
layout="@layout/listitem_ad_title_creative_btn_layout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/layout_image_group"
android:layout_marginLeft="10dp"
android:layout_marginTop="4dp"
android:layout_marginRight="10dp" />
<!--==== 测试下载状态控制功能 begin ========-->
<include
layout="@layout/listitem_ad_download_btn_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ad_title_creative_btn_layout"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:orientation="horizontal" />
<!--==== 测试下载状态控制功能 end ========-->
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText">
<include
android:id="@+id/icon_source_layout"
layout="@layout/listitem_ad_icon_source_layout" />
<TextView
android:id="@+id/tv_listitem_ad_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/icon_source_layout"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1"
android:maxLines="2"
android:singleLine="false"
android:text="劳力士服务中心,清洗保养,更换配件,9秒费用查询"
android:textColor="@android:color/black"
android:textSize="18sp" />
<ImageView
android:id="@+id/iv_listitem_image"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@id/tv_listitem_ad_desc"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/tt_ad_cover_btn_begin_bg"
android:scaleType="centerCrop" />
<!-- title+creativeBtn layout -->
<include
android:id="@+id/ad_title_creative_btn_layout"
layout="@layout/listitem_ad_title_creative_btn_layout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/iv_listitem_image"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText">
<include
android:id="@+id/icon_source_layout"
layout="@layout/listitem_ad_icon_source_layout" />
<TextView
android:id="@+id/tv_listitem_ad_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/icon_source_layout"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1"
android:maxLines="2"
android:singleLine="false"
android:text="劳力士服务中心,清洗保养,更换配件,9秒费用查询"
android:textColor="@android:color/black"
android:textSize="18sp" />
<com.bytedance.msdk.api.format.TTMediaView
android:id="@+id/iv_listitem_video"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@id/tv_listitem_ad_desc"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@android:color/background_dark"
android:scaleType="centerCrop" />
<!-- title+creativeBtn layout -->
<include
android:id="@+id/ad_title_creative_btn_layout"
layout="@layout/listitem_ad_title_creative_btn_layout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/iv_listitem_video"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/iv_listitem_express"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" />
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText">
<RelativeLayout
android:id="@+id/ad_contentPanel"
android:layout_width="match_parent"
android:layout_height="85dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp">
<ImageView
android:id="@+id/iv_listitem_image"
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="@drawable/tt_ad_cover_btn_begin_bg"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/iv_listitem_image"
android:layout_toLeftOf="@+id/iv_listitem_image"
android:orientation="vertical">
<TextView
android:id="@+id/tv_listitem_ad_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lineSpacingMultiplier="1.1"
android:maxLines="2"
android:text="80后的回忆!经典三国完美复刻,安卓用户的福利"
android:textColor="@android:color/black"
android:textSize="18sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="3dp"
android:paddingEnd="10dp"
android:paddingRight="10dp">
<ImageView
android:id="@+id/iv_listitem_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:src="@drawable/tt_mute" />
<TextView
android:id="@+id/tv_listitem_ad_source"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/iv_listitem_dislike"
android:layout_toLeftOf="@+id/iv_listitem_dislike"
android:layout_toEndOf="@+id/iv_listitem_icon"
android:layout_toRightOf="@+id/iv_listitem_icon"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="着陆无双"
android:textColor="#70000000"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_listitem_dislike"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:clickable="true"
android:focusable="true" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<!-- title+creativeBtn layout -->
<include
android:id="@+id/ad_title_creative_btn_layout"
layout="@layout/listitem_ad_title_creative_btn_layout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/ad_contentPanel"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
......@@ -7,6 +7,14 @@
android:layout_marginBottom="2dp"
android:background="#F4F5F7">
<RelativeLayout
android:id="@+id/tt_ad_logo"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:visibility="gone" />
<TextView
android:id="@+id/tv_listitem_ad_title"
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText">
<ImageView
android:id="@+id/iv_listitem_image"
android:layout_width="135dp"
android:layout_height="240dp"
android:layout_centerHorizontal="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_listitem_image"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_listitem_ad_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center"
android:singleLine="false"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/iv_listitem_icon"
android:layout_width="30dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp" />
<LinearLayout
android:id="@+id/tv_source_desc_layout"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_below="@id/layout_image_group"
android:layout_centerVertical="true"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_toEndOf="@id/iv_listitem_icon"
android:layout_toRightOf="@id/iv_listitem_icon"
android:orientation="vertical"
tools:ignore="NotSibling">
<TextView
android:id="@+id/tv_listitem_ad_desc"
android:layout_width="80dp"
android:layout_height="20dp"
android:ellipsize="end"
android:singleLine="true"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_listitem_ad_source"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:ellipsize="end"
android:singleLine="true"
android:textSize="8sp" />
</LinearLayout>
</RelativeLayout>
<Button
android:id="@+id/btn_listitem_creative"
android:layout_width="135dp"
android:layout_height="40dp"
android:textSize="9sp" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_listitem_dislike"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:clickable="true"
android:src="@mipmap/dislike_icon" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
......@@ -67,6 +67,9 @@ buildscript {
classpath "com.google.dagger:hilt-android-gradle-plugin:2.28.3-alpha"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
classpath 'com.sensorsdata.analytics.android:android-gradle-plugin2:3.3.1'
// 穿山甲APPlog
classpath 'com.bytedance.applog:RangersAppLog-All-plugin:5.2.6'
}
}
......
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