Commit 3b5714d4 authored by mengcuiguang's avatar mengcuiguang

添加广告

parent fe65fd29
......@@ -61,6 +61,12 @@ android {
buildConfigField "boolean", "LOG_DEBUG", "true"
buildConfigField "String", "AppKeyPre", "\"abcd\""
buildConfigField "String", "MainIp", DEBUG_URL
buildConfigField "String", "GROMORE_APP_ID", GROMORE_APP_ID
buildConfigField "String", "IN_COMMON_FULL_CODE", IN_COMMON_FULL_CODE
buildConfigField "String", "IN_COMMON_NEW_INTERSTITIAL_CODE", IN_COMMON_NEW_INTERSTITIAL_CODE
buildConfigField "String", "IN_MONEY_VIDEO_AD_CODE", IN_MONEY_VIDEO_AD_CODE
buildConfigField "String", "IN_MONEY_EXPRESS_AD_CODE", IN_MONEY_EXPRESS_AD_CODE
buildConfigField "String", "IN_MONEY_SPLASH_AD_CODE", IN_MONEY_SPLASH_AD_CODE
buildConfigField "String", "RELEASE_TALKING_DATA_KEY", RELEASE_TALKING_DATA_KEY
//混淆
......@@ -77,6 +83,12 @@ android {
buildConfigField "boolean", "LOG_DEBUG", "false"
buildConfigField "String", "AppKeyPre", "\"abcd\""
buildConfigField "String", "MainIp", RELEASE_URL
buildConfigField "String", "GROMORE_APP_ID", GROMORE_APP_ID
buildConfigField "String", "IN_COMMON_FULL_CODE", IN_COMMON_FULL_CODE
buildConfigField "String", "IN_COMMON_NEW_INTERSTITIAL_CODE", IN_COMMON_NEW_INTERSTITIAL_CODE
buildConfigField "String", "IN_MONEY_VIDEO_AD_CODE", IN_MONEY_VIDEO_AD_CODE
buildConfigField "String", "IN_MONEY_EXPRESS_AD_CODE", IN_MONEY_EXPRESS_AD_CODE
buildConfigField "String", "IN_MONEY_SPLASH_AD_CODE", IN_MONEY_SPLASH_AD_CODE
buildConfigField "String", "RELEASE_TALKING_DATA_KEY", RELEASE_TALKING_DATA_KEY
//混淆
......@@ -235,6 +247,45 @@ dependencies {
implementation(name: 'umeng-apm-armeabi-v1.2.0', ext: 'aar')
// 穿山甲 GroMore
//GroMore_sdk
implementation(name: 'mediation_ad_sdk_3.9.0.2', ext: 'aar') //groMore adapter
//GroMore_sdk adapter
implementation(name: 'gdt_adapter_4.500.1370.0', ext: 'aar') //gdt adapter
implementation(name: 'ks_adapter_3.3.34.0', ext: 'aar') //ks adapter
implementation(name: 'mintegral_adapter_16.3.27.0', ext: 'aar') //mintegral adapter
implementation(name: 'sigmob_adapter_4.8.2.1', ext: 'aar') //sigmob adapter
implementation(name: 'pangle_adapter_5.0.0.4.0', ext: 'aar') //穿山甲 adapter
implementation(name: 'baiduMobAds_adapter_9.251.0', ext: 'aar') //百度 adapter
//Baidu
implementation(name: 'Baidu_MobAds_SDK_v9.251', ext: 'aar')
//pangle
implementation(name: 'open_ad_sdk_5.0.0.4', ext: 'aar')
//GDT
implementation(name: 'GDTSDK.unionNormal.4.500.1370', ext: 'aar')
//ks 快手
implementation(name: 'kssdk-ad-3.3.34', ext: 'aar')
//sigmob
implementation(name: 'windAd-4.8.2', ext: 'aar')
implementation(name: 'windAd-common-1.4.0', ext: 'aar')
//mintegral
implementation("com.mbridge.msdk.support:videojs:16.3.27")
implementation("com.mbridge.msdk.support:mbjscommon:16.3.27")
implementation("com.mbridge.msdk.support:playercommon:16.3.27")
implementation("com.mbridge.msdk.support:reward:16.3.27")
implementation("com.mbridge.msdk.support:videocommon:16.3.27")
implementation("com.mbridge.msdk.support:chinasame:16.3.27")
implementation("com.mbridge.msdk.support:interstitialvideo:16.3.27")
implementation("com.mbridge.msdk.support:mbnative:16.3.27")
implementation("com.mbridge.msdk.support:nativeex:16.3.27")
implementation("com.mbridge.msdk.support:mbnativeadvanced:16.3.27")
implementation("com.mbridge.msdk.support:interstitial:16.3.27")
implementation("com.mbridge.msdk.support:mbbanner:16.3.27")
implementation("com.mbridge.msdk.support:mbsplash:16.3.27")
implementation("com.mbridge.msdk.support:mbbid:16.3.27")
implementation("com.mbridge.msdk.support:newinterstitial:16.3.27")
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
......
......@@ -314,42 +314,7 @@
#=======================Mob END===========================
# ===================== umeng START ================
-keep class com.umeng.** {*;}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep public class com.mints.bcurd.R$*{
public static final int *;
}
-keep class com.uc.crashsdk.** { *; }
-keep interface com.uc.crashsdk.** { *; }
-keep class com.efs.** { *; }
-keep interface com.efs.** { *; }
# ======================= umeng END ================
#=======================TalkingDataSTART===========================
-dontwarn com.tendcloud.tenddata.**
-keep class com.tendcloud.** {*;}
-keep public class com.tendcloud.tenddata.** { public protected *;}
-keepclassmembers class com.tendcloud.tenddata.**{
public void *(***);
}
-keep class com.talkingdata.sdk.TalkingDataSDK {public *;}
-keep class com.apptalkingdata.** {*;}
#=======================TalkingDataEND===========================
# ======================= 穿山甲 GroMore START ================
# ======================= 穿山甲 GroMore START ================
## pangle 穿山甲原有的
-keepclassmembers class * {
*** getContext(...);
......@@ -374,7 +339,6 @@
*** getIdentifier(...);
}
-keep class com.bytedance.pangle.** {*;}
-keep class com.bytedance.sdk.openadsdk.** { *; }
-keep class com.bytedance.frameworks.** { *; }
......@@ -401,6 +365,23 @@
protected <fields>;
}
# baidu sdk 不接入baidu sdk可以不引入
-ignorewarnings
-dontwarn com.baidu.mobads.sdk.api.**
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class com.baidu.mobads.** { *; }
-keep class com.style.widget.** {*;}
-keep class com.component.** {*;}
-keep class com.baidu.ad.magic.flute.** {*;}
-keep class com.baidu.mobstat.forbes.** {*;}
#ks 快手 不接入ks sdk可以不引入
-keep class org.chromium.** {*;}
......@@ -412,6 +393,11 @@
-dontwarn com.ksad.**
-dontwarn aegon.chrome.**
# Admob 不接入admob sdk可以不引入
-keep class com.google.android.gms.ads.MobileAds {
public *;
}
#sigmob 不接入sigmob sdk可以不引入
-dontwarn android.support.v4.**
-keep class android.support.v4.** { *; }
......@@ -421,6 +407,33 @@
-keep class sun.misc.Unsafe { *; }
-dontwarn com.sigmob.**
-keep class com.sigmob.**.**{*;}
-keep interface com.sigmob.**.**{*;}
-keep class com.czhj.**{*;}
-keep interface com.czhj.**{*;}
#oaid 不同的版本混淆代码不太一致,你注意你接入的oaid版本 ,不接入oaid可以不添加
-dontwarn com.bun.**
-keep class com.bun.** {*;}
-keep class a.**{*;}
-keep class XI.CA.XI.**{*;}
-keep class XI.K0.XI.**{*;}
-keep class XI.XI.K0.**{*;}
-keep class XI.vs.K0.**{*;}
-keep class XI.xo.XI.XI.**{*;}
-keep class com.asus.msa.SupplementaryDID.**{*;}
-keep class com.asus.msa.sdid.**{*;}
-keep class com.huawei.hms.ads.identifier.**{*;}
-keep class com.samsung.android.deviceidservice.**{*;}
-keep class com.zui.opendeviceidlibrary.**{*;}
-keep class org.json.**{*;}
-keep public class com.netease.nis.sdkwrapper.Utils {public <methods>;}
#klevin 游可赢
-keep class com.tencent.tgpa.lite.**{*;}
-keep class com.ihoc.mgpa.deviceid.**{*;}
-keep class com.tencent.klevin.**{*;}
#Mintegral 不接入Mintegral sdk,可以不引入
-keepattributes Signature
......@@ -430,20 +443,4 @@
-keep class android.support.v4.** { *; }
-dontwarn com.mbridge.**
-keep class **.R$* { public static final int mbridge*; }
# baidu sdk 不接入baidu sdk可以不引入
-ignorewarnings
-dontwarn com.baidu.mobads.sdk.api.**
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class com.baidu.mobads.** { *; }
-keep class com.style.widget.** {*;}
-keep class com.component.** {*;}
-keep class com.baidu.ad.magic.flute.** {*;}
-keep class com.baidu.mobstat.forbes.** {*;}
# ======================= 穿山甲 GroMore END ================
This diff is collapsed.
......@@ -87,7 +87,7 @@ public class MintsApplication extends MultiDexApplication {
.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) return;
// 穿山甲增长参谋
AppLogManager.INSTANCE.init(this);
// AppLogManager.INSTANCE.init(this);
UmengManager.INSTANCE.initUm(this,
MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
......@@ -95,7 +95,7 @@ public class MintsApplication extends MultiDexApplication {
TalkingDataManager.INSTANCE.init(this);
// bugly
CrashReport.initCrashReport(this, "2dfe1817ec", BuildConfig.DEBUG);
CrashReport.initCrashReport(this, "e70be3c9f1", BuildConfig.DEBUG);
// ShareSdk
ShareSdkManager.INSTANCE.submitPolicyGrantResult();
......@@ -152,7 +152,7 @@ public class MintsApplication extends MultiDexApplication {
public LoanService getLoanService() {
if (loanService == null) {
loanService = LoanService.Factory.create(this);
loanService = LoanService.Factory.create();
}
return loanService;
}
......
package com.mints.bcurd.ad
import android.app.Activity
import com.mints.bcurd.ad.AdManager
import com.mints.bcurd.ad.express.ExpressManager
import com.mints.bcurd.common.Constant
/**
* 描述:广告管理
* 作者:孟崔广
* 时间:2021/08/10 10:51
*/
object AdHelper {
const val AD_NO_SHOWTIME_OUT = 50 // 广告请示成功但在规定时间内未展示
const val AD_REQUEST_TIME_OUT = 1 // 广告预加载时长超时
/**
* 预加载应用内广告
*/
fun preInAd(activity: Activity?) {
// 预加载信息流
ExpressManager.loadExpress(Constant.CARRIER_SPLASH)
activity?.let {
AdManager.instance.splashPreLoadAll(activity)
}
}
}
\ No newline at end of file
package com.mints.bcurd.ad
interface WifiAdStatusListener {
fun adSuccess()
fun adFail()
fun adClose()
}
\ No newline at end of file
package com.mints.bcurd.ad.express
import android.widget.FrameLayout
/**
*
* @des 信息流回调
*/
interface ExpressAdCallback {
fun loadSuccess(adView: FrameLayout?)
fun renderSuccess(adView: FrameLayout?): Boolean
fun loadFail()
}
\ No newline at end of file
package com.mints.bcurd.ad.express
import android.widget.FrameLayout
/**
* 加载应用内-信息流
*/
object ExpressManager {
/**
* 加载应用内网赚信息流
*/
fun loadExpress(carrier: String) {
InMoneyExpress.instance.loadADFrameLayout(carrier)
}
/**
* 获取应用内网赚信息流
*/
fun getExpressAd(callback: ExpressAdCallback, carrier: String = "", type: String? = "") {
InMoneyExpress.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
callback.loadSuccess(adView)
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
return callback.renderSuccess(adView)
}
override fun loadFail() {
callback.loadFail()
}
}, carrier, type)
}
}
\ No newline at end of file
package com.mints.bcurd.common
import com.mints.bcurd.BuildConfig
object Constant {
/**
* 首次弹出权限声明
......@@ -21,6 +19,11 @@ object Constant {
*/
const val ACTION_EXIT_APP = "package.exit"
/**
* app名称
*/
const val WENSHU_APP_NAME = "豆丁相机"
/**
* app应用首页 0-主页 1-赚赚 2-我
*/
......@@ -33,29 +36,9 @@ object Constant {
var PRIVACY_URL = "http://mints-web.mints-id.com/agreements/bcurd/syzc.html"//隐私协议
var MEMBERS_URL = "http://mints-web.mints-id.com/agreements/bcurd/gmxy.html"//会员付费服务协议
/**
* 拍照读取图片CODE
*/
const val REQUEST_CODE_TAKE_PICTURE = 0x00000011
/**
* 相册读取图片CODE
*/
const val REQUEST_CODE_PHOTO_ALBUM = 0x00000012
const val IMG_URL = "IMG_URL"
const val STYLE_TYPE = "STYLE_TYPE" // 特效类型
const val STYLE_TYPE_IMAGE_COLOR = "image_color" // 黑白图片上色
const val STYLE_TYPE_IMAGE_CLARITY = "image_clarity" // 图像清晰度增强
const val STYLE_TYPE_BODY_SEG = "bodySeg" // 人像分割
const val STYLE_TYPE_CHANGE_TO_YOUNG = "changeToYoung" // 变年轻
const val STYLE_TYPE_CHANGE_TO_OLD = "changeToOld" // 变老
const val STYLE_TYPE_MULTI_IMG = "multiImg" // 多人合照
const val STYLE_TYPE_ID_PHOTO = "idPhoto" // 证件照
// pagesize
const val PAGE_SIZE = 10
const val IMAGE_PATH = "image_path"
const val IMAGE_TYPE = "image_type"
// 载体
const val CARRIER_SPLASH = "SPLASH" // 开屏
}
\ No newline at end of file
......@@ -15,17 +15,17 @@ import com.mints.bcurd.utils.MateUtils
object AppLogManager {
// ***这个id是增长参谋的appid,不是gormore的appid
private const val APP_LOG_ID="450431"
private const val APP_LOG_ID=""
fun init(application: Application) {
val config = InitConfig(APP_LOG_ID, MateUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") + HumeSDK.getChannel(MintsApplication.getContext()))
//上报地址
config.setUriConfig(UriConstants.DEFAULT)
// 加密开关,SDK 5.5.1 及以上版本支持,false 为关闭加密,上线前建议设置为 true
AppLog.setEncryptAndCompress(true)
config.isLogEnable = true
config.setAutoStart(true)
config.isAutoTrackEnabled = true
AppLog.init(application, config)
// val config = InitConfig(APP_LOG_ID, MateUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") + HumeSDK.getChannel(MintsApplication.getContext()))
// //上报地址
// config.setUriConfig(UriConstants.DEFAULT)
// // 加密开关,SDK 5.5.1 及以上版本支持,false 为关闭加密,上线前建议设置为 true
// AppLog.setEncryptAndCompress(true)
// config.isLogEnable = true
// config.setAutoStart(true)
// config.isAutoTrackEnabled = true
// AppLog.init(application, config)
}
}
\ No newline at end of file
package com.mints.bcurd.manager
import android.app.Application
import com.mints.bcurd.BuildConfig
/**
* 穿山甲GroMore
*/
object CsjGroMoreManager {
//-------------------------广告位 start-----------------------------
var IN_COMMON_FULL_CODE = BuildConfig.IN_COMMON_FULL_CODE // 应用内 网赚 新插屏(全屏)
var IN_COMMON_NEW_INTERSTITIAL_CODE =
BuildConfig.IN_COMMON_NEW_INTERSTITIAL_CODE // 应用内 网赚 新插屏(半屏)
var IN_MONEY_SPLASH_CODE = BuildConfig.IN_MONEY_SPLASH_AD_CODE // 应用内 网赚 开屏
var IN_MONEY_VIDEO_AD_CODE = BuildConfig.IN_MONEY_VIDEO_AD_CODE // 应用内 网赚 激励视频
var IN_MONEY_EXPRESS_AD_CODE = BuildConfig.IN_MONEY_EXPRESS_AD_CODE // 应用内 网赚 信息流
//-------------------------广告位 end-----------------------------
/**
* gromore初始化
*/
fun init(application: Application) {
TTGroMoreAdManagerHolder.init(application)
}
}
\ No newline at end of file
package com.mints.bcurd.manager;
import android.content.Context;
import android.provider.Settings;
import com.bytedance.hume.readapk.HumeSDK;
import com.bytedance.msdk.api.v2.GMAdConfig;
import com.bytedance.msdk.api.v2.GMAdConstant;
import com.bytedance.msdk.api.v2.GMConfigUserInfoForSegment;
import com.bytedance.msdk.api.v2.GMMediationAdSdk;
import com.bytedance.msdk.api.v2.GMPangleOption;
import com.bytedance.msdk.api.v2.GMPrivacyConfig;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.mbridge.msdk.MBridgeConstans;
import com.mints.bcurd.BuildConfig;
import com.mints.bcurd.MintsApplication;
import com.mints.bcurd.common.Constant;
import com.mints.bcurd.utils.DeviceUuidFactory;
import java.util.HashMap;
import java.util.Map;
/**
* 穿山甲广告
*/
public class TTGroMoreAdManagerHolder {
public static final String TT_AD_NAME = Constant.WENSHU_APP_NAME;
private static boolean sInit;
public static com.bytedance.sdk.openadsdk.TTAdManager get() {
if (!sInit) {
throw new RuntimeException("TTAdSdk is not init, please check.");
}
return TTAdSdk.getAdManager();
}
public static void init(Context context) {
doInit(context);
}
//step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
private static void doInit(Context context) {
if (!sInit) {
MBridgeConstans.DEBUG = true;
GMMediationAdSdk.initialize(context, buildV2Config(context));
sInit = true;
}
}
public static String getVersion() {
return TTAdSdk.getAdManager().getSDKVersion();
}
public static GMAdConfig buildV2Config(Context context) {
GMConfigUserInfoForSegment userInfo = new GMConfigUserInfoForSegment();
// if (!TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
// userInfo.setUserId(UserManager.getInstance().getUserID());
// }
userInfo.setUserId(new DeviceUuidFactory().getDeviceUuid().toString());
// userInfo.setChannel(CommonUtils.INSTANCE.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME"));
userInfo.setSubChannel(HumeSDK.getChannel(MintsApplication.getContext()));
Map<String, String> customInfos = new HashMap<>();
userInfo.setCustomInfos(customInfos);
return new GMAdConfig.Builder()
.setAppId(BuildConfig.GROMORE_APP_ID)
.setAppName(TT_AD_NAME)
.setDebug(BuildConfig.DEBUG)//默认false,测试阶段打开,可以通过日志排查问题
.setPublisherDid(getAndroidId(context))
.setOpenAdnTest(BuildConfig.DEBUG)//开启第三方ADN测试时需要设置为true,会每次重新拉去最新配置,release 包情况下必须关闭.默认false
.setConfigUserInfoForSegment(userInfo)
.setPangleOption(new GMPangleOption.Builder()
.setIsPaid(false)
.setTitleBarTheme(GMAdConstant.TITLE_BAR_THEME_DARK)
.setAllowShowNotify(true)
.setAllowShowPageWhenScreenLock(false)
.setDirectDownloadNetworkType(GMAdConstant.NETWORK_STATE_WIFI, GMAdConstant.NETWORK_STATE_3G)
.setIsUseTextureView(false)
.setNeedClearTaskReset()
.setKeywords("")
.build())
.setPrivacyConfig(new GMPrivacyConfig() {
// 重写相应的函数,设置需要设置的权限开关,不重写的将采用默认值
// 例如,重写isCanUsePhoneState函数返回true,表示允许使用ReadPhoneState权限。
@Override
public boolean isCanUsePhoneState() {
return true;
}
})
.build();
}
public static String getAndroidId(Context context) {
String androidId = null;
try {
androidId = Settings.System.getString(context.getContentResolver(), Settings.System.ANDROID_ID);
} catch (Exception e) {
e.printStackTrace();
}
return androidId;
}
}
package com.mints.bcurd.mvp.model
import java.io.Serializable
/**
*
* @author jyx
* @date 2021/4/22
* @des
*/
data class DealImageBean(
val innerUrl: String,
val outUrl: String,
val type: String
) : Serializable
\ No newline at end of file
package com.mints.bcurd.mvp.presenters
import com.google.gson.Gson
import com.mints.bcurd.manager.AppHttpManager
import com.mints.bcurd.mvp.model.BaseResponse
import com.mints.bcurd.mvp.model.IDPhotoBean
import com.mints.bcurd.mvp.views.ChangeIDView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import java.util.*
class ChangeIDPresenter : BasePresenter<ChangeIDView>() {
fun createIDPhoto(url: String, type: String, color: String) {
view.showLoading("加载中...")
val vo = HashMap<String, Any>()
vo["imgUrl"] = url
vo["specID"] = type
vo["bkColor"] = color
AppHttpManager.getInstance(loanApplication)
.call(loanService.createIDPhoto(vo),
object : BaseSubscriber<BaseResponse<IDPhotoBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
view.createIDPhotoFail()
}
override fun onNext(baseResponse: BaseResponse<IDPhotoBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
view.createIDPhotoSuc(baseResponse.data)
}
else -> {
view.showToast(baseResponse.message)
view.createIDPhotoFail()
}
}
}
})
}
fun completeCreateIDPhoto(idPhotoBean: IDPhotoBean) {
val toJson = Gson().toJson(idPhotoBean)
val body: RequestBody = RequestBody.create("application/json; charset=utf-8".toMediaTypeOrNull(), toJson)
AppHttpManager.getInstance(loanApplication)
.call(loanService.completeCreateIDPhoto(body),
object : BaseSubscriber<BaseResponse<IDPhotoBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
view.completeCreateIDPhotoFail()
}
override fun onNext(baseResponse: BaseResponse<IDPhotoBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
view.completeCreateIDPhotoSuc()
}
else -> {
view.showToast(baseResponse.message)
view.completeCreateIDPhotoFail()
}
}
}
})
}
}
\ No newline at end of file
......@@ -132,42 +132,4 @@ class HomePresenter : BasePresenter<HomeView>() {
})
}
fun createIDPhoto(url: String, type: String, color: String) {
val vo = HashMap<String, Any>()
vo["imgUrl"] = url
vo["specID"] = type
vo["bkColor"] = color
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.createIDPhoto(vo),
object : BaseSubscriber<BaseResponse<IDPhotoBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<IDPhotoBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
view.createIDPhotoSuc(baseResponse.data)
}
600 -> {
view.createIDPhotoFail(baseResponse.data.errList)
}
else -> {
view.showToast(baseResponse.message)
}
}
}
})
}
}
\ No newline at end of file
package com.mints.bcurd.mvp.presenters
import com.mints.bcurd.manager.AppHttpManager
import com.mints.bcurd.mvp.model.BaseResponse
import com.mints.bcurd.mvp.model.DealImageBean
import com.mints.bcurd.mvp.views.MainView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class MainPresenter : BasePresenter<MainView>() {
fun dealImage(type: String, imgUrl: String) {
this.dealImage(type, -1, imgUrl)
}
fun dealImage(type: String, age: Int, imgUrl: String) {
val vo = hashMapOf<String, Any>()
vo["type"] = type
if (age != -1) {
vo["age"] = age
}
vo["imgUrl"] = imgUrl
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.dealImage(vo),
object : BaseSubscriber<BaseResponse<DealImageBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
view.getdealImageFail()
}
override fun onNext(baseResponse: BaseResponse<DealImageBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getdealImageSuc(baseResponse.data)
else -> {
view.showToast(message)
view.getdealImageFail()
}
}
}
})
}
}
\ No newline at end of file
package com.mints.bcurd.mvp.presenters
import com.mints.bcurd.manager.AppHttpManager
import com.mints.bcurd.mvp.model.BaseResponse
import com.mints.bcurd.mvp.model.DealImageBean
import com.mints.bcurd.mvp.views.PreStyleView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class PreStylePresenter : BasePresenter<PreStyleView>() {
fun dealImage(type: String, imgUrl: String) {
this.dealImage(type, -1, imgUrl)
}
fun dealImage(type: String, age: Int, imgUrl: String) {
val vo = hashMapOf<String, Any>()
vo["type"] = type
if (age != -1) {
vo["age"] = age
}
vo["imgUrl"] = imgUrl
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.dealImage(vo),
object : BaseSubscriber<BaseResponse<DealImageBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
view.getdealImageFail()
}
override fun onNext(baseResponse: BaseResponse<DealImageBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getdealImageSuc(baseResponse.data)
else -> {
view.showToast(message)
view.getdealImageFail()
}
}
}
})
}
}
\ No newline at end of file
package com.mints.bcurd.mvp.presenters
import com.google.gson.JsonObject
import com.mints.bcurd.manager.AppHttpManager
import com.mints.bcurd.mvp.model.BaseResponse
import com.mints.bcurd.mvp.model.DealImageBean
import com.mints.bcurd.mvp.model.HotStyleListBean
import com.mints.bcurd.mvp.views.PreStyleView
import com.mints.bcurd.mvp.views.SampleStyleView
import com.mints.bcurd.mvp.views.UnlockStyleView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class SampleStylePresenter : BasePresenter<SampleStyleView>() {
fun aiLockMsg(type: String) {
}
}
\ No newline at end of file
package com.mints.bcurd.mvp.presenters
import com.mints.bcurd.manager.AppHttpManager
import com.mints.bcurd.mvp.model.BaseResponse
import com.mints.bcurd.mvp.model.HotStyleListBean
import com.mints.bcurd.mvp.views.UnlockStyleView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class UnlockStylePresenter : BasePresenter<UnlockStyleView>() {
fun getHomePageImageList(page: Int, pageCount: Int) {
val vo = hashMapOf<String, Any>()
vo["page"] = page
vo["size"] = pageCount
AppHttpManager.getInstance(loanApplication)
.call(loanService.getHomepageImageList(vo),
object : BaseSubscriber<BaseResponse<HotStyleListBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
view.getHomePageImageListFail()
}
override fun onNext(baseResponse: BaseResponse<HotStyleListBean>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getHomePageImageListSuc(baseResponse.data)
else ->{
view.showToast(message)
view.getHomePageImageListFail()
}
}
}
})
}
}
\ No newline at end of file
package com.mints.bcurd.mvp.views
import com.mints.bcurd.mvp.model.IDPhotoBean
interface ChangeIDView : BaseView {
fun createIDPhotoSuc(idPhoto: IDPhotoBean)
fun createIDPhotoFail()
fun completeCreateIDPhotoSuc()
fun completeCreateIDPhotoFail()
}
\ No newline at end of file
package com.mints.bcurd.mvp.views;
import com.mints.bcurd.mvp.model.DealImageBean;
public interface MainView extends BaseView {
void getdealImageSuc(DealImageBean data);
void getdealImageFail();
}
package com.mints.bcurd.mvp.views
import com.mints.bcurd.mvp.model.DealImageBean
interface PreStyleView : BaseView {
fun getdealImageSuc(data: DealImageBean)
fun getdealImageFail()
}
package com.mints.bcurd.mvp.views
interface SampleStyleView : BaseView {
fun aiLockMsgSuc(data: Boolean)
fun aiLockMsgFail()
}
package com.mints.bcurd.mvp.views
import com.mints.bcurd.mvp.model.HotStyleListBean
interface UnlockStyleView : BaseView {
fun getHomePageImageListSuc(data: HotStyleListBean)
fun getHomePageImageListFail()
}
package com.mints.bcurd.net;
import android.content.Context;
import android.text.TextUtils;
import com.google.gson.JsonObject;
import com.mints.bcurd.BuildConfig;
import com.mints.bcurd.mvp.model.BaseResponse;
import com.mints.bcurd.mvp.model.DealImageBean;
import com.mints.bcurd.mvp.model.OrderRecordBean;
import com.mints.bcurd.mvp.model.HotStyleListBean;
import com.mints.bcurd.mvp.model.IDPhotoBean;
import com.mints.bcurd.mvp.model.RiskBean;
import com.mints.bcurd.mvp.model.OrderRecordBean;
import com.mints.bcurd.mvp.model.UserBean;
import com.mints.bcurd.mvp.model.Version;
import com.mints.bcurd.mvp.model.VipBean;
......@@ -22,7 +18,6 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
......@@ -92,16 +87,6 @@ public interface LoanService {
@POST("api/ai/homepageImagePageList")
Observable<BaseResponse<HotStyleListBean>> getHomepageImageList(@Body Map<String, Object> vo);
/**
* 首页抠图接口
* <p>
* image_color:黑白图片上色, image_clarity:图像清晰度增强, bodySeg:人像分割, changeAge:年龄变化)
*
* @return
*/
@POST("api/ai/dealImage")
Observable<BaseResponse<DealImageBean>> dealImage(@Body Map<String, Object> vo);
/**
* 查询vip产品
*/
......@@ -124,22 +109,6 @@ public interface LoanService {
@POST("api/vip/queryVipOrder")
Observable<BaseResponse<Object>> queryVipOrder(@Body Map<String, Object> vo);
/**
* 制作证件照接口
*
* @return
*/
@POST("api/ai/createIDPhoto")
Observable<BaseResponse<IDPhotoBean>> createIDPhoto(@Body Map<String, Object> vo);
/**
* 确认接口
*
* @return
*/
@POST("api/ai/completeCreateIDPhoto")
Observable<BaseResponse<IDPhotoBean>> completeCreateIDPhoto(@Body RequestBody body);
/**
* 订单记录
*
......@@ -168,10 +137,8 @@ public interface LoanService {
* 默认http工厂
*/
class Factory {
public static LoanService create(Context context) {
public static LoanService create() {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.retryOnConnectionFailure(true);
builder.connectTimeout(20, TimeUnit.SECONDS);
builder.readTimeout(20, TimeUnit.SECONDS);
......
package com.mints.bcurd.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.*
import android.widget.LinearLayout
import android.widget.TextView
import com.mints.bcurd.R
class PhotoDialog(context: Context) : Dialog(context, R.style.dialog) {
private val llDialogCamera: LinearLayout
private val llDialogAlbum: LinearLayout
private val tvDialogCancel: TextView
private var mOnChangePhotoListener: OnChangePhotoListener? = null
init {
setContentView(R.layout.dialog_photo)
// 设置window属性
window?.let {
val lp = it.attributes
lp.gravity = Gravity.BOTTOM
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
it.attributes = lp
}
// 设置外部不可关闭
// setCancelable(false)
// setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
llDialogCamera = findViewById<View>(R.id.llDialogCamera) as LinearLayout
llDialogAlbum = findViewById<View>(R.id.llDialogAlbum) as LinearLayout
tvDialogCancel = findViewById<View>(R.id.tvDialogCancel) as TextView
llDialogCamera.setOnClickListener {
mOnChangePhotoListener?.onChangePhoto(0)
}
llDialogAlbum.setOnClickListener {
mOnChangePhotoListener?.onChangePhoto(1)
}
tvDialogCancel.setOnClickListener {
dismiss()
}
}
fun setOnChangePhotoListener(onChangePhotoListener: OnChangePhotoListener): PhotoDialog {
this.mOnChangePhotoListener = onChangePhotoListener
return this
}
interface OnChangePhotoListener {
fun onChangePhoto(status: Int)
}
}
\ No newline at end of file
package com.mints.bcurd.utils;
import android.app.Activity;
import androidx.fragment.app.Fragment;
import java.util.Stack;
/**
* Created by goldze on 2017/6/15.
* activity堆栈式管理
*/
public class AppManager {
private static Stack<Activity> activityStack;
private static Stack<Fragment> fragmentStack;
private static AppManager instance;
private AppManager() {
}
/**
* 单例模式
*
* @return AppManager
*/
public static AppManager getAppManager() {
if (instance == null) {
instance = new AppManager();
}
return instance;
}
public static Stack<Activity> getActivityStack() {
return activityStack;
}
public static Stack<Fragment> getFragmentStack() {
return fragmentStack;
}
/**
* 添加Activity到堆栈
*/
public void addActivity(Activity activity) {
if (activityStack == null) {
activityStack = new Stack<Activity>();
}
activityStack.add(activity);
}
/**
* 移除指定的Activity
*/
public void removeActivity(Activity activity) {
if (activity != null) {
activityStack.remove(activity);
}
}
/**
* 是否有activity
*/
public boolean isActivity() {
if (activityStack != null) {
return !activityStack.isEmpty();
}
return false;
}
/**
* 获取当前Activity(堆栈中最后一个压入的)不安全,栈空会抛异常
*/
/*@Deprecated
public Activity currentActivity() {
Activity activity = activityStack.lastElement();
return activity;
}*/
/***
* 获取当前Activity(堆栈中最后一个压入的)安全,栈空返回null
*/
public Activity getCurrentActivity(){
if(activityStack == null){
return null;
}
if(activityStack.size() == 0){
return null;
}
return activityStack.peek();
}
/**
* 结束当前Activity(堆栈中最后一个压入的)
*/
public void finishActivity() {
Activity activity = activityStack.lastElement();
finishActivity(activity);
}
/**
* 结束指定的Activity
*/
public void finishActivity(Activity activity) {
if (activity != null) {
if (!activity.isFinishing()) {
activity.finish();
}
}
}
/**
* 结束指定类名的Activity
*/
public void finishActivity(Class<?> cls) {
for (Activity activity : activityStack) {
if (activity.getClass().equals(cls)) {
finishActivity(activity);
break;
}
}
}
/**
* 结束所有Activity
*/
public void finishAllActivity() {
for (int i = 0, size = activityStack.size(); i < size; i++) {
if (null != activityStack.get(i)) {
finishActivity(activityStack.get(i));
}
}
activityStack.clear();
}
/**
* 获取指定的Activity
*
* @author kymjs
*/
public Activity getActivity(Class<?> cls) {
if (activityStack != null)
for (Activity activity : activityStack) {
if (activity.getClass().equals(cls)) {
return activity;
}
}
return null;
}
/**
* 添加Fragment到堆栈
*/
public void addFragment(Fragment fragment) {
if (fragmentStack == null) {
fragmentStack = new Stack<Fragment>();
}
fragmentStack.add(fragment);
}
/**
* 移除指定的Fragment
*/
public void removeFragment(Fragment fragment) {
if (fragment != null) {
fragmentStack.remove(fragment);
}
}
/**
* 是否有Fragment
*/
public boolean isFragment() {
if (fragmentStack != null) {
return !fragmentStack.isEmpty();
}
return false;
}
/**
* 获取当前Activity(堆栈中最后一个压入的)
*/
public Fragment currentFragment() {
if (fragmentStack != null) {
Fragment fragment = fragmentStack.lastElement();
return fragment;
}
return null;
}
/**
* 退出应用程序
*/
public void appExit() {
try {
finishAllActivity();
// 杀死该应用进程
// android.os.Process.killProcess(android.os.Process.myPid());
// 调用 System.exit(n) 实际上等效于调用:
// Runtime.getRuntime().exit(n)
// finish()是Activity的类方法,仅仅针对Activity,当调用finish()时,只是将活动推向后台,并没有立即释放内存,活动的资源并没有被清理;当调用System.exit(0)时,退出当前Activity并释放资源(内存),但是该方法不可以结束整个App如有多个Activty或者有其他组件service等不会结束。
// 其实android的机制决定了用户无法完全退出应用,当你的application最长时间没有被用过的时候,android自身会决定将application关闭了。
//System.exit(0);
} catch (Exception e) {
activityStack.clear();
e.printStackTrace();
}
}
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return instance;
}
public static Activity getTopActivity() {
public static Activity getApp_activity() {
return app_activity.get();
}
......@@ -62,6 +62,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
AppManager.getAppManager().addActivity(activity);
}
@Override
......@@ -81,6 +82,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
public void onActivityDestroyed(Activity activity) {
try {
AppManager.getAppManager().removeActivity(activity);
String simpleName = activity.getClass().getSimpleName();
if (TextUtils.equals(simpleName, "MainActivity")) {
if (vup != null) {
......
......@@ -270,4 +270,17 @@ object TimeRender {
)
}
/**
* 是否超过outMin分钟
*
* @param adPreLoadTime 广告预加载时间
* @return true-超过outMin分钟
*/
fun isOverspedMin(adPreLoadTime: Long, outMin: Int): Boolean {
val time = (System.currentTimeMillis() - adPreLoadTime) / (1000 * 60)
// LogUtil.d("PreCsjGroMoreVideoAdManager","adPreLoadTime="+adPreLoadTime+"time="+time);
return if (time > outMin && adPreLoadTime > 0) {
true
} else false
}
}
\ No newline at end of file
package com.mints.bcurd.utils;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.WindowManager;
/**
* @author jyx
* @date 2021/8/23
* @des
*/
public class UiUtils {
private static UiUtils utils;
//这里设计稿参考宽高
private static final float STANDARD_WIDTH = 1080;
private static final float STANDARD_HEIGHT = 1920;
private static final float DEFAULT_EXPRESS_STEP = 30;
private static final float DEFAULT_EXPRESS_STEP_2 = 60;
private static final float DEFAULT_EXPRESS_STEP_3 = 40;
//这里是屏幕显示的宽高
private int mDisplayWidth;
private int mDisplayHeight;
private float mDensity;
private UiUtils(Context context) {
//获取屏幕的宽高
try {
if (mDisplayWidth == 0 || mDisplayHeight == 0) {
WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
if (manager != null) {
DisplayMetrics displayMetrics = new DisplayMetrics();
manager.getDefaultDisplay().getMetrics(displayMetrics);
mDensity = displayMetrics.density;
if (displayMetrics.widthPixels > displayMetrics.heightPixels) {
//横屏
mDisplayWidth = displayMetrics.heightPixels;
mDisplayHeight = displayMetrics.widthPixels;
} else {
mDisplayWidth = displayMetrics.widthPixels;
// mDisplayHeight = displayMetrics.heightPixels - getStatusBarHeight(context);//屏幕减去状态栏的高度
mDisplayHeight = displayMetrics.heightPixels;
}
}
}
}catch (Exception e){
e.printStackTrace();
}
}
//获取状态栏的高度
public int getStatusBarHeight(Context context) {
int resID = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resID > 0) {
return context.getResources().getDimensionPixelSize(resID);
}
return 0;
}
public static UiUtils getInstance(Context context) {
if (utils == null) {
utils = new UiUtils(context.getApplicationContext());
}
return utils;
}
//获取水平方向上的缩放比例
public float getHorizontalScale() {
return mDisplayWidth / STANDARD_WIDTH;
}
//获取垂直方向上的缩放比例
public float getVerticalScale() {
return mDisplayHeight / STANDARD_HEIGHT;
}
/**
* mDisplayWidth:1080 mDisplayHeight:1848
* @return
*/
public int getScreenWidth() {
return mDisplayWidth;
}
public int getScreenHeight() {
return mDisplayHeight;
}
public int getSimpleAdExpressWidth() {
return (int) (mDisplayWidth / mDensity);
}
public int getAdExpressWidth() {
return (int) (mDisplayWidth / mDensity - DEFAULT_EXPRESS_STEP);
}
public int getAdExpressWidth2() {
return (int) (mDisplayWidth / mDensity - DEFAULT_EXPRESS_STEP_2);
}
public int getAdExpressWidth3() {
return (int) (mDisplayWidth / mDensity - DEFAULT_EXPRESS_STEP_3);
}
public int getAdExpressHeight() {
return (int) (mDisplayWidth / mDensity - DEFAULT_EXPRESS_STEP_2 - DEFAULT_EXPRESS_STEP);
}
public int dp2px(int dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
Resources.getSystem().getDisplayMetrics());
}
public int sp2px(int sp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
Resources.getSystem().getDisplayMetrics());
}
public static int[] getScreenDpSize(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;// 屏幕宽度(像素)
int height = dm.heightPixels; // 屏幕高度(像素)
float density = dm.density;//屏幕密度(0.75 / 1.0 / 1.5)
int densityDpi = dm.densityDpi;//屏幕密度dpi(120 / 160 / 240)
//屏幕宽度算法:屏幕宽度(像素)/屏幕密度
int screenWidth = (int) (width / density);//屏幕宽度(dp)
int screenHeight = (int) (height / density);//屏幕高度(dp)
return new int[]{screenWidth, screenHeight};
}
public static int getScreenWidthDp(Context context) {
return getScreenDpSize(context)[0];
}
public static int getScreenHeightDp(Context context) {
return getScreenDpSize(context)[1];
}
}
<?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:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:textColor="#3C93CD"
android:text="暂停下载"
android:visibility="gone" />
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
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"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/icon_source_layout"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp">
<ImageView
android:id="@+id/iv_listitem_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:src="@drawable/ksad_interstitial_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_toEndOf="@+id/iv_listitem_icon"
android:layout_toLeftOf="@+id/iv_listitem_dislike"
android:layout_toRightOf="@+id/iv_listitem_icon"
android:layout_toStartOf="@+id/iv_listitem_dislike"
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_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginRight="0dp"
android:clickable="true"
android:focusable="true" />
</RelativeLayout>
\ 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_appdownloader_action_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"
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_appdownloader_action_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/ksad_interstitial_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
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ad_title_creative_btn_layout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_below="@+id/iv_listitem_image"
android:layout_marginBottom="2dp"
android:background="#F4F5F7">
<TextView
android:id="@+id/tv_listitem_ad_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btn_listitem_creative"
android:layout_toStartOf="@+id/btn_listitem_creative"
android:gravity="center_vertical"
android:singleLine="true"
android:text="计策略,才真三国!"
android:textSize="18sp" />
<Button
android:id="@+id/btn_listitem_creative"
android:layout_width="68dp"
android:layout_height="28dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:layout_marginLeft="3dp"
android:layout_marginRight="8dp"
android:layout_marginStart="3dp"
android:gravity="center"
android:text="立即下载"
android:textColor="@color/black"
android:textSize="14sp" />
</RelativeLayout>
\ 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:id="@+id/tt_ad_logo"
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: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" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!--为了适配所有路径可以设置 path = "." -->
<external-path
name="tt_external_root"
path="." />
<external-path
name="tt_external_download"
path="Download" />
<external-files-path
name="tt_external_files_download"
path="Download" />
<files-path
name="tt_internal_file_download"
path="Download" />
<cache-path
name="tt_internal_cache_download"
path="Download" />
</paths>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name="external_files"
path="." />
</paths>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<!-- 抓包时开启 -->
<!-- <base-config cleartextTrafficPermitted="true">-->
<!-- <trust-anchors>-->
<!-- <certificates src="user" />-->
<!-- <certificates src="system" />-->
<!-- </trust-anchors>-->
<!-- </base-config>-->
</network-security-config>
\ No newline at end of file
......@@ -7,7 +7,16 @@
<files-path
name="files"
path="." />
 
<cache-path
name="cache"
path="." />
<!-- 优量汇 这个下载路径也不可以修改,必须为GDTDOWNLOAD -->
<external-cache-path
name="gdt_sdk_download_path1"
path="com_qq_e_download" />
<cache-path
name="gdt_sdk_download_path2"
path="com_qq_e_download" />
</paths>
......@@ -15,6 +15,15 @@ buildscript {
maven {
url 'https://artifact.bytedance.com/repository/Volcengine/'
}
//GroMore SDK依赖
maven {
url "https://artifact.bytedance.com/repository/pangle"
}
//mintegral sdk依赖 引入mintegral sdk需要添加此maven
maven {
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_support/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
......@@ -39,6 +48,15 @@ allprojects {
maven {
url 'https://artifact.bytedance.com/repository/Volcengine/'
}
//GroMore SDK依赖
maven {
url "https://artifact.bytedance.com/repository/pangle"
}
//mintegral sdk依赖 引入mintegral sdk需要添加此maven
maven {
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_support/"
}
}
}
......
......@@ -43,3 +43,16 @@ RELEASE_UMENG_KEY=63a58b23d64e6861390594cf
#TalkingData
RELEASE_TALKING_DATA_KEY="D51BF06E868B4FD4BB275B989DB417C7"
#Gromore
GROMORE_APP_ID="5336123"
# ??? ?? ???(??)
IN_COMMON_FULL_CODE = ""
# ??? ?? ???(??)
IN_COMMON_NEW_INTERSTITIAL_CODE = "102144325"
# ??? ?? ????
IN_MONEY_VIDEO_AD_CODE = "102144903"
# ??? ?? ???
IN_MONEY_EXPRESS_AD_CODE = "102144231"
# ??
IN_MONEY_SPLASH_AD_CODE = "102165872"
\ 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