Commit 284e3ca2 authored by mengcuiguang's avatar mengcuiguang

test

parent fb3732b2
......@@ -2,6 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'android-aspectjx'
apply plugin: 'com.sensorsdata.analytics.android'
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion
......@@ -58,6 +64,19 @@ android {
}
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
aspectjx {
exclude 'versions.9'
}
buildFeatures {
dataBinding true
}
buildTypes {
debug {
......@@ -190,7 +209,7 @@ dependencies {
// 三方接入
// leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
implementation 'cn.jiguang.sdk:jpush:3.6.6'
implementation 'cn.jiguang.sdk:jcore:2.3.8'
......@@ -280,10 +299,54 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-scalars:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.alibaba:fastjson:1.2.11'
// 激励视频RTA
implementation(name: 'taskwake1.0', ext: 'aar')
// 听读
implementation files('libs/Reader17kSDK-release1.1.3.aar')
implementation files('libs/readerlib-release1.1.aar')
implementation files('libs/filter-lib-release1.1.aar')
compileOnly "com.squareup.inject:assisted-inject-annotations-dagger2:$rootProject.assistedInjectVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
kapt "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
kapt "com.google.dagger:hilt-android-compiler:$rootProject.hiltVersion"
kapt "androidx.hilt:hilt-compiler:$rootProject.hiltViewModelVersion"
kapt "com.squareup.inject:assisted-inject-processor-dagger2:$rootProject.assistedInjectVersion"
implementation "androidx.core:core-ktx:$rootProject.ktxVersion"
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentVersion"
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$rootProject.navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$rootProject.navigationVersion"
implementation "androidx.paging:paging-runtime:$rootProject.pagingVersion"
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
implementation "androidx.room:room-ktx:$rootProject.roomVersion"
implementation "androidx.viewpager2:viewpager2:$rootProject.viewPagerVersion"
implementation "androidx.work:work-runtime-ktx:$rootProject.workVersion"
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutinesVersion"
implementation "com.google.dagger:hilt-android:$rootProject.hiltVersion"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltViewModelVersion"
implementation "com.scwang.smart:refresh-header-material:$rootProject.refresh_version" //谷歌刷新头
implementation 'com.github.pdog18:dimension-extensions:1.0'
implementation 'com.github.zhpanvip:BannerViewPager:3.2.0'
api "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
api "androidx.navigation:navigation-ui-ktx:$navigationVersion"
api "androidx.navigation:navigation-dynamic-features-fragment:$navigationVersion"
implementation 'com.github.warkiz.widget:indicatorseekbar:1.2.9'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'skin.support:skin-support:4.0.5' // skin-support
implementation 'skin.support:skin-support-appcompat:4.0.5' // skin-support 基础控件支持
implementation 'skin.support:skin-support-design:4.0.5' // skin-support-design material design 控件支持[可选]
implementation 'skin.support:skin-support-cardview:4.0.5' // skin-support-cardview CardView 控件支持[可选]
implementation 'skin.support:skin-support-constraint-layout:4.0.5' // skin-support-constraint-layout ConstraintLayout 控件支持[可选]
implementation "androidx.datastore:datastore-preferences:1.0.0-alpha02"
implementation 'com.github.F1ReKing:StatusLayout:1.2.1'
kapt "com.alibaba:arouter-compiler:$arouter_compiler_version" //注意版本号
implementation "com.alibaba:arouter-api:$arouter_api_version"
implementation 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:4.4.3'
api 'org.aspectj:aspectjrt:1.9.5'
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......
......@@ -668,3 +668,113 @@
public *;
}
# ======================= 蘑菇星球 END ================
# ===================== 听读 START ================
-keep class com.chineseall.reader17ksdk.**{*;}
-keep class com.chineseall.reader.utils.**{*;}
-keep class com.chineseall.reader.lib.reader.**{*;}
#arouter
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements
com.alibaba.android.arouter.facade.template.ISyringe{*;}
# If you use the byType method to obtain Service, add the
-keep interface * implements
com.alibaba.android.arouter.facade.template.IProvider
#百度语音
-keep class com.baidu.tts.**{*;}
-keep class com.baidu.speechsynthesizer.**{*;}
#eventBus
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
-keep class org.greenrobot.eventbug.**{*;}
-keepclassmembers class * extends
org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
#rxjava
-dontwarn rx.**
-keep class rx.** { *; }
#okhttp3
-dontwarn com.squareup.okhttp3.**
-keep class com.squareup.okhttp3.** { *;}
-keep class okhttp3.** { *;}
-keep class okio.** { *;}
-dontwarn sun.security.**
-keep class sun.security.** { *;}
-dontwarn okio.**
-dontwarn okhttp3.**
#retrofit2
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-dontwarn org.robovm.**
-keep class org.robovm.** { *; }
#glide
-keep public class * implements
com.bumptech.glide.module.GlideModule
-keep public enum
com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *; }
-keep class com.bumptech.glide.** { *; }
#gson
-keep class com.google.gson.** {*;}
#-keep class com.google.**{*;}
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
-keep class com.google.gson.examples.android.model.** { *; }
-keep class com.google.** {
<fields>;
<methods>; }
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[]
serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-dontwarn com.google.gson.**
#umeng
-dontwarn com.umeng.**
-keep class com.umeng.**{*;}
-keep class u.aly.**{*;}
-keep class com.google.**{*;}
#filter
-keep class com.baiiu.filter.**{*;}
#dragger
-keep class dagger.** { *; }
#statuslayout
-keep class com.f1reking.**{*;}
#dp
-keep class com.pdog.dimension.**{*;}
#seekbar
-keep class com.warkiz.widget.**{*;}
#banner
-keep class com.zhpan.bannerview.**{*;}
-keep class com.zhpan.indicator.**{*;}
#refresh
-keep class com.scwang.smart.refresh.**{*;}
#skin
-keep class skin.support.**{*;}
#神策
-dontwarn com.sensorsdata.analytics.android.sdk.** -keep class com.sensorsdata.analytics.android.sdk.** { *;
}
-dontwarn com.sensorsdata.analytics.android.**
-keep class com.sensorsdata.analytics.android.** {
*;
}
# 使用可视化埋点需添加
-keep class **.R$* {
<fields>; }
# ======================= 听读 END ================
\ No newline at end of file
......@@ -41,6 +41,7 @@ import com.ximalaya.ting.android.opensdk.util.BaseUtil;
import java.util.concurrent.Executors;
import dagger.hilt.android.HiltAndroidApp;
import rx.Scheduler;
import rx.schedulers.Schedulers;
......@@ -49,6 +50,7 @@ import rx.schedulers.Schedulers;
* 作者:孟崔广
* 时间:2020/10/09 11:40
*/
@HiltAndroidApp
public class MintsApplication extends MultiDexApplication {
private static MintsApplication mContext;
......
package com.mints.goodmoney.manager;
import android.app.Application;
import android.app.Dialog;
import android.content.DialogInterface;
import android.view.View;
import androidx.appcompat.app.AlertDialog;
import com.chineseall.reader.lib.reader.callbacks.OnAdViewReceiver;
import com.chineseall.reader17ksdk.ChineseAllReaderApplication;
import com.chineseall.reader17ksdk.callbacks.AdProvider;
import com.chineseall.reader17ksdk.callbacks.OnReadCallBack;
import com.chineseall.reader17ksdk.utils.ActivityStackManager;
import com.chineseall.reader17ksdk.utils.DensityUtil;
import com.chineseall.reader17ksdk.utils.NetworkUtil;
import com.chineseall.reader17ksdk.utils.ToastUtil;
import com.chineseall.reader17ksdk.utils.book.ScreenUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
public class ReaderManager {
public static void init(Application applicationContext) {
ChineseAllReaderApplication.Companion.install(applicationContext, "1209", "asdf!@", "6", "0", new AdProvider() {
@Override
public void onAdDialogPositiveClick(@Nullable Dialog dialog, @NotNull Function0<Unit> function0) {
if (NetworkUtil.isNetworkAvailable(applicationContext) && !NetworkUtil.INSTANCE.isWifiConnected(
applicationContext
)
) {
// 网络可用&&wifi没有连接 kotlin 写法
// AlertDialog.Builder(ActivityStackManager.getInstance().getTopActivity())
// .setTitle("温馨提示")
// .setMessage("当前处于移动网络,播放视频会消耗流量,确定播放?")
// .setPositiveButton("观看视频") { d, _ ->
// d.dismiss()
// ad.showVideo(ActivityStackManager.getInstance().getTopActivity()) {
// block()
// }
// }
// .setNegativeButton("取消") { d, _ ->
// d.dismiss()
// }.create().show()
// return
new AlertDialog.Builder(ActivityStackManager.getInstance().getTopActivity())
.setTitle("温馨提示")
.setMessage("当前处于移动网络,播放视频会消耗流量,确定播放?")
.setPositiveButton("观看视频", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// ad.showVideo(ActivityStackManager.getInstance().getTopActivity(), new ToutiaoAD.OnVideoCloseCallBack() {
// @Override
// public void onClose() {
// function0.invoke();
// }
// });
}
}).setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).create().show();
return;
}
}
@Override
public void getReaderScreenAd(@NotNull View view, @NotNull OnAdViewReceiver receiver,
@Nullable Dialog dialog) {
// ad.loadAD(applicationContext, receiver, 320, 260, new ToutiaoAD.OnClickListener() {
// @Override
// public void onClick() {
// dialog.dismiss();
// }
// });
}
@Override
public void getReaderPageAd(@NotNull OnAdViewReceiver receiver) {
// ad.loadAD(applicationContext, receiver, DensityUtil.px2dip(applicationContext, ScreenUtils.getScreenWidth(applicationContext) - DensityUtil.dip2px(applicationContext, 30f)), DensityUtil.px2dip(applicationContext, 854f), null);
}
@Override
public void getReaderDialogAd(@NotNull View view, @NotNull OnAdViewReceiver receiver, @Nullable Dialog dialog) {
// ad.loadVideoAd(ActivityStackManager.getInstance().getTopActivity(), receiver);
}
});
ChineseAllReaderApplication.Companion.setOnReadCallBack(new OnReadCallBack() {
/**
* "time" : 阅读总时长
* "bookName" : 书名
* "chapterName" : 当前章节名
* "pageInChapter" : 当前章节内阅读页码
* "chapterTotalPages" : 当前章节总页数
*/
@Override
public void onReceive(@NotNull Map<String, ?> map) {
Object time = map.get("time");
ToastUtil.toast(time + "");
}
}, 30 * 1000);//间隔30秒 回调一次 间隔任意设置
}
}
//package com.mints.goodmoney.manager;
//
//import android.app.Activity;
//import android.content.Context;
//import android.view.View;
//import android.widget.Toast;
//
//import com.bytedance.sdk.openadsdk.AdSlot;
//import com.bytedance.sdk.openadsdk.BuildConfig;
//import com.bytedance.sdk.openadsdk.TTAdConfig;
//import com.bytedance.sdk.openadsdk.TTAdConstant;
//import com.bytedance.sdk.openadsdk.TTAdNative;
//import com.bytedance.sdk.openadsdk.TTAdSdk;
//import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
//import com.bytedance.sdk.openadsdk.TTFeedAd;
//import com.bytedance.sdk.openadsdk.TTImage;
//import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
//import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
//import com.chineseall.reader.lib.reader.callbacks.OnAdViewReceiver;
//import com.chineseall.reader17ksdk.ChineseAllReaderApplication;
//import com.chineseall.reader17ksdk.aop.AspectTest;
//import com.chineseall.reader17ksdk.utils.LogUtils;
//import com.chineseall.reader17ksdk.utils.book.ScreenUtils;
//
//import java.util.List;
//
//
///**
// * Created by yangleo on 2017/12/11.
// */
//
//public class ToutiaoAD {
//
// private static final String tag = "ToutiaoAD";
//
// /*
// 开屏和信息流都用此
// */
// //开屏广告加载超时时间,建议大于200
// private static final int AD_TIME_OUT = 3000;
// private TTAdNative mTTAdNative;
// private Context context;
//
// private TTFeedAd feedAd; //信息流回调类
// private TTRewardVideoAd mttRewardVideoAd;
// private View mView;
//
//// public String getChannel() {
//// return adParamers.channel;
//// }
//
// public String getIcon() {
// if (feedAd == null) {
// return null;
// }
// TTImage ttImage = feedAd.getIcon();
// if (ttImage != null && ttImage.getImageUrl() != null) {
// return ttImage.getImageUrl();
// }
// return null;
// }
//
// public String getImage() {
// if (feedAd == null) {
// return null;
// }
// List<TTImage> list = feedAd.getImageList();
// if (list != null && list.size() > 0) {
// TTImage ttImage = list.get(0);
// if (ttImage != null && ttImage.getImageUrl() != null) {
// return ttImage.getImageUrl();
// }
// }
// return null;
// }
//
// public String getTitle() {
// if (feedAd == null) {
// return null;
// }
// return feedAd.getTitle();
// }
//
// public String getDesc() {
// if (feedAd == null) {
// return null;
// }
// return feedAd.getDescription();
// }
//
// public String getUrl() {
// return null;
// }
//
// public boolean isApp() {
// return false;
// }
//
// public View getView() {
// return mView;
// }
//
// public List<String> getImageList() {
// return null;
// }
//
//// public int getBannerIndex() {
//// return adParamers.banner_index;
//// }
//
//
// // @Override
// public void loadAD(final Context context, OnAdViewReceiver receiver, int width, int height, OnClickListener listener) {
// this.context = context;
//
// LogUtils.d(tag, "load ad");
//
// if (mTTAdNative == null) {
// mTTAdNative = TTAdSdk.getAdManager().createAdNative(context);
// }
//// if (ADConfig.TYPE_NATIVE.equals(adParamers.type)){
// //信息流
//// initNativeAD();
//// }else if(ADConfig.TYPE_SPLASH.equals(adParamers.type)){
//// 开屏
//// initSplashAD();
//// }else if(ADConfig.TYPE_INTERSTITIAL.equals(adParamers.type)){
// //插屏广告
//// initInteractionAD((Activity) context);
//// }else if (ADConfig.TYPE_VIDEO.equals(adParamers.type)){
//// initVedioAD(context);
//// }else if (ADConfig.TYPE_FEED.equals(adParamers.type)){
// initFeedAD(receiver, width, height, listener);
//// }
//
// }
//
// public void loadVideoAd(Context context, OnAdViewReceiver receiver) {
// this.context = context;
//
// if (mTTAdNative == null) {
// mTTAdNative = TTAdSdk.getAdManager().createAdNative(context);
// }
// initVedioAD(context, receiver);
// }
//
// private void initFeedAD(OnAdViewReceiver receiver, int width, int height, OnClickListener clickListener) {
//
// // DensityUtil.px2dip(context, ScreenUtils.getScreenWidth(context) - DensityUtil.dip2px(context, 30)), DensityUtil.px2dip(context, 854)
// //设置广告参数
// AdSlot adSlot = new AdSlot.Builder()
// .setCodeId("945685076") //广告位id
// .setSupportDeepLink(true)
// .setAdCount(1) //请求广告数量为1到3条
// .setExpressViewAcceptedSize(width, height) //必填:期望个性化模板广告view的size,单位dp
// .setImageAcceptedSize(400, 150) //这个参数设置即可,不影响个性化模板广告的size
// .build();
// mTTAdNative.loadNativeExpressAd(adSlot, new TTAdNative.NativeExpressAdListener() {
// @Override
// public void onError(int code, String message) {
// LogUtils.d(tag, "code: " + code + ", " + message);
// receiver.onReceive(false, null);
//// TToast.show(NativeExpressActivity.this, "load error : " + code + ", " + message);
//// getAdParamers().parent.removeAllViews();
// }
//
// @Override
// public void onNativeExpressAdLoad(List<TTNativeExpressAd> ads) {
// if (ads == null || ads.size() == 0) {
// return;
// }
// LogUtils.d(tag, "onNativeExpressAdLoad : " + ads.size());
// TTNativeExpressAd mTTAd = ads.get(0);
// bindAdListener(mTTAd, receiver, clickListener);
// mTTAd.render();//调用render开始渲染广告
// }
// });
// }
//
// //绑定广告行为
// private void bindAdListener(TTNativeExpressAd ad, OnAdViewReceiver receiver, OnClickListener clickListener) {
// ad.setExpressInteractionListener(new TTNativeExpressAd.ExpressAdInteractionListener() {
// @Override
// public void onAdClicked(View view, int type) {
// LogUtils.d(tag, "onAdClicked : " + type);
// LogUtils.d("onAdClicked");
// if (clickListener != null) {
// clickListener.onClick();
// }
// }
//
// @Override
// public void onAdShow(View view, int type) {
// LogUtils.d(tag, "onAdShow : " + type);
// LogUtils.d("onAdShow");
// }
//
// @Override
// public void onRenderFail(View view, String msg, int code) {
// LogUtils.d(tag, "onRenderFail : " + msg + ", " + code);
// receiver.onReceive(false, view);
// }
//
// @Override
// public void onRenderSuccess(View view, float width, float height) {
// LogUtils.d(tag, "onRenderSuccess : " + view.getClass().getName());
// //返回view的宽高 单位 dp
// //在渲染成功回调时展示广告,提升体验
//// getAdParamers().parent.removeAllViews();
//// getAdParamers().parent.addView(view);
// mView = view;
// if (mView != null && !AspectTest.views.contains(view.getClass().getName())) {
// AspectTest.views.add(view.getClass().getName());
// }
// receiver.onReceive(true, view);
//// adParamers.listener.onADLoaded(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
// }
// });
// //dislike设置
//// bindDislike(ad, false);
// if (ad.getInteractionType() != TTAdConstant.INTERACTION_TYPE_DOWNLOAD) {
// return;
// }
// //可选,下载监听设置
// ad.setDownloadListener(new TTAppDownloadListener() {
// @Override
// public void onIdle() {
// LogUtils.d(tag, "onIdle : ");
//// TToast.show(NativeExpressActivity.this, "点击开始下载", Toast.LENGTH_LONG);
// }
//
// @Override
// public void onDownloadActive(long totalBytes, long currBytes, String fileName, String appName) {
// LogUtils.d(tag, "onDownloadActive : ");
//// if (!mHasShowDownloadActive) {
//// mHasShowDownloadActive = true;
//// TToast.show(NativeExpressActivity.this, "下载中,点击暂停", Toast.LENGTH_LONG);
//// }
// }
//
// @Override
// public void onDownloadPaused(long totalBytes, long currBytes, String fileName, String appName) {
// LogUtils.d(tag, "onDownloadPaused : ");
//// TToast.show(NativeExpressActivity.this, "下载暂停,点击继续", Toast.LENGTH_LONG);
// }
//
// @Override
// public void onDownloadFailed(long totalBytes, long currBytes, String fileName, String appName) {
// LogUtils.d(tag, "onDownloadFailed : ");
//// TToast.show(NativeExpressActivity.this, "下载失败,点击重新下载", Toast.LENGTH_LONG);
// }
//
// @Override
// public void onInstalled(String fileName, String appName) {
// LogUtils.d(tag, "onInstalled : ");
//// TToast.show(NativeExpressActivity.this, "安装完成,点击图片打开", Toast.LENGTH_LONG);
// }
//
// @Override
// public void onDownloadFinished(long totalBytes, String fileName, String appName) {
// LogUtils.d(tag, "onDownloadFinished : ");
//// TToast.show(NativeExpressActivity.this, "点击安装", Toast.LENGTH_LONG);
// }
// });
// }
//
// private void initVedioAD(final Context context, OnAdViewReceiver receiver) {
//// SharedPreferencesUtil.getInstance().putBoolean(StringConstants.VIDEO_TASK_FINISH, false);
//
// AdSlot adSlot = new AdSlot.Builder()
// .setCodeId("945710075")
// .setSupportDeepLink(true)
// .setAdCount(1)
// .setImageAcceptedSize(ScreenUtils.getScreenWidth(ChineseAllReaderApplication.globalContext) / 4, ScreenUtils.getScreenHeight(ChineseAllReaderApplication.globalContext) / 4)
// .setRewardName("金币") //奖励的名称
// .setRewardAmount(3) //奖励的数量
// //必传参数,表来标识应用侧唯一用户;若非服务器回调模式或不需sdk透传
// //可设置为空字符串
// .setUserID("")
// .setOrientation(TTAdConstant.VERTICAL) //设置期望视频播放的方向,为TTAdConstant.HORIZONTAL或TTAdConstant.VERTICAL
// .setMediaExtra("media_extra") //用户透传的信息,可不传
// .build();
// mTTAdNative.loadRewardVideoAd(adSlot, new TTAdNative.RewardVideoAdListener() {
// @Override
// public void onError(int code, String message) {
// LogUtils.i("ToutiaoAd", message);
//// adParamers.listener.onAdFailed("error");
// receiver.onReceive(false, null);
//
// }
//
// //视频广告加载后的视频文件资源缓存到本地的回调
// @Override
// public void onRewardVideoCached() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd video cached");
// }
//
// //视频广告素材加载到,如title,视频url等,不包括视频文件
// @Override
// public void onRewardVideoAdLoad(TTRewardVideoAd ad) {
//// Log.i("ToutiaoAd","rewardVideoAd loaded");
// mttRewardVideoAd = ad;
// receiver.onReceive(true, null);
// //mttRewardVideoAd.setShowDownLoadBar(false);
// }
// });
// }
//
// public void showVideo(Context context, OnVideoCloseCallBack callBack) {
// if (mttRewardVideoAd != null) {
// mttRewardVideoAd.setRewardAdInteractionListener(new TTRewardVideoAd.RewardAdInteractionListener() {
//
// @Override
// public void onAdShow() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd onAdShow");
//// adParamers.listener.onADLoaded(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
// }
//
// @Override
// public void onAdVideoBarClick() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd onAdVideoBarClick");
//// adParamers.listener.onAdClick();
// }
//
// @Override
// public void onAdClose() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd onAdClose");
// if (callBack != null) {
// callBack.onClose();
// }
//// adParamers.listener.onAdDismiss();
//// EventBus.getDefault().post(new ADCloseEvent(SharedPreferencesUtil.getInstance().getInt(StringConstants.LOOK_VEDIO_TYPE, LOOK_VEDIO_AD_TYPE.NORMAL)));
//
// }
//
// @Override
// public void onVideoComplete() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd complete");
//// Toast.makeText(context,"恭喜您,观看完毕!",Toast.LENGTH_SHORT).show();
// }
//
// @Override
// public void onVideoError() {
// LogUtils.i("ToutiaoAd", "rewardVideoAd onVideoError");
//// if (com.burst.ad_toutiao_lib.BuildConfig.DEBUG){
// Toast.makeText(context, "视频播放错误", Toast.LENGTH_SHORT).show();
//// }
// }
//
// @Override
// public void onRewardVerify(boolean rewardVerify, int rewardAmount, String rewardName) {
// LogUtils.i("ToutiaoAd", "verify:" + rewardVerify + " amount:" + rewardAmount +
// " name:" + rewardName);
// }
//
// @Override
// public void onSkippedVideo() {
//
// }
// });
// mttRewardVideoAd.setDownloadListener(new TTAppDownloadListener() {
// @Override
// public void onIdle() {
//
// }
//
// @Override
// public void onDownloadActive(long totalBytes, long currBytes, String fileName, String appName) {
//
// }
//
// @Override
// public void onDownloadPaused(long totalBytes, long currBytes, String fileName, String appName) {
//
// }
//
// @Override
// public void onDownloadFailed(long totalBytes, long currBytes, String fileName, String appName) {
//
// }
//
// @Override
// public void onDownloadFinished(long totalBytes, String fileName, String appName) {
//
// }
//
// @Override
// public void onInstalled(String fileName, String appName) {
//
// }
// });
// mttRewardVideoAd.showRewardVideoAd((Activity) context);
// }
// }
//
// public interface OnVideoCloseCallBack {
// void onClose();
// }
//
// public interface OnClickListener {
// void onClick();
// }
//
//// private void initInteractionAD(final Activity context) {
//// //插屏广告请求类型数据
//// AdSlot adSlot = new AdSlot.Builder()
//// .setCodeId(adParamers.key)
//// .setSupportDeepLink(true)
//// .setImageAcceptedSize(600, 600)
//// .build();
//// //调用插屏广告异步请求接口
//// mTTAdNative.loadInteractionAd(adSlot, new TTAdNative.InteractionAdListener() {
//// @Override
//// public void onError(int i, String s) {
////
//// }
////
//// @Override
//// public void onInteractionAdLoad(TTInteractionAd ttInteractionAd) {
//// ttInteractionAd.setAdInteractionListener(new TTInteractionAd.AdInteractionListener() {
//// @Override
//// public void onAdClicked() {
//// adParamers.listener.onAdClick();
//// }
////
//// @Override
//// public void onAdShow() {
//// adParamers.listener.onADLoaded(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
//// }
////
//// @Override
//// public void onAdDismiss() {
////
//// }
//// });
//// //弹出插屏广告
//// ttInteractionAd.showInteractionAd(context);
//// }
//// });
//// }
////
//// private void initSplashAD() {
//// //开屏广告参数
//// AdSlot adSlot = new AdSlot.Builder()
//// .setCodeId(adParamers.key)
//// .setSupportDeepLink(true)
//// .setImageAcceptedSize(ScreenUtils.getScreenWidth(), ScreenUtils.getScreenHeight())
//// .build();
//// mTTAdNative.loadSplashAd(adSlot, new TTAdNative.SplashAdListener() {
//// @Override
//// public void onError(int code, String message) {
//// //开屏广告请求失败
//// adParamers.listener.onAdFailed(message);
//// }
////
//// @Override
//// public void onTimeout() {
//// //开屏广告请求超时
//// adParamers.listener.onAdFailed("请求超时了");
//// }
////
//// @Override
//// public void onSplashAdLoad(TTSplashAd ttSplashAd) {
////
//// //开屏广告请求成功了
//// if(ttSplashAd == null){
//// return;
//// }
////
//// adParamers.listener.onADLoaded(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
////
//// //获取SplashView
//// View view = ttSplashAd.getSplashView();
//// adParamers.parent.removeAllViews();
//// //把SplashView 添加到ViewGroup中
//// adParamers.parent.addView(view);
////
//// //设置不显示SDK自带的跳过和倒计时
//// ttSplashAd.setNotAllowSdkCountdown();
////
//// ttSplashAd.setSplashInteractionListener(new TTSplashAd.AdInteractionListener() {
//// @Override
//// public void onAdClicked(View view, int i) {
//// //广告点击了
//// adParamers.listener.onAdClick();
//// }
////
//// @Override
//// public void onAdShow(View view, int i) {
//// //广告显示了
////// adParamers.listener.onADLoaded(ToutiaoAD.this);
//// }
////
//// @Override
//// public void onAdSkip() {
//// //广告跳过
//// adParamers.listener.onAdDismiss();
//// }
////
//// @Override
//// public void onAdTimeOver() {
//// //开屏广告倒计时结束
//// adParamers.listener.onAdDismiss();
//// }
//// });
//// }
//// },AD_TIME_OUT);
//// }
//
//// private void initNativeAD() {
//// //feed广告请求类型参数
//// AdSlot adSlot = new AdSlot.Builder()
//// .setCodeId(adParamers.key)
//// .setSupportDeepLink(true)
//// .setImageAcceptedSize(640, 320)
//// .setAdCount(1)
//// .build();
//// mTTAdNative.loadFeedAd(adSlot, new TTAdNative.FeedAdListener() {
//// @Override
//// public void onError(int code, String message) {
//// adParamers.listener.onAdFailed(message);
//// }
////
//// @Override
//// public void onFeedAdLoad(List<TTFeedAd> ads) {
//// if(ads != null && ads.size() > 0){
//// feedAd = ads.get(0);
//// adParamers.listener.onADLoaded(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
//// }else{
//// adParamers.listener.onAdFailed("没有广告");
//// }
//// }
//// });
//// }
//
// // @Override
// public boolean onExposured(View view) {
//// if (ADConfig.TYPE_NATIVE.equals(adParamers.type)){
// //
//// if(feedAd != null){
//// feedAd.registerViewForInteraction(adParamers.parent, adParamers.clickViewList, null, new TTNativeAd.AdInteractionListener() {
//// @Override
//// public void onAdClicked(View view, TTNativeAd ttNativeAd) {
////// adParamers.listener.onAdClick();
//// }
////
//// @Override
//// public void onAdCreativeClick(View view, TTNativeAd ttNativeAd) {
////
//// }
////
//// @Override
//// public void onAdShow(TTNativeAd ttNativeAd) {
//// if(ttNativeAd != null){
//// //广告显示了
////// adParamers.listener.onAdShow(com.rice.gluepudding.ad.impl.ToutiaoAD.this);
//// }
//// }
//// });
////
//// }
//// }
// return false;
// }
//
// // @Override
// public boolean onClicked(View view) {
// return false;
// }
//}
buildscript {
ext.kotlin_version = '1.3.72'
ext {
// Sdk and tools
compileSdkVersion = 29
minSdkVersion = 21
targetSdkVersion = 29
// App dependencies
appCompatVersion = '1.1.0'
assistedInjectVersion = '0.5.2'
constraintLayoutVersion = '2.0.0-beta3'
coreTestingVersion = '2.0.0'
coroutinesVersion = "1.3.0-M2"
espressoVersion = '3.1.1'
fragmentVersion = '1.1.0-alpha09'
glideVersion = '4.10.0'
gradleVersion = '4.0.1'
gsonVersion = '2.8.2'
hiltVersion = '2.28.3-alpha'
hiltViewModelVersion = '1.0.0-alpha02'
junitVersion = '4.12'
kotlinVersion = '1.4.10'
ktlintVersion = '0.38.1'
ktxVersion = '1.0.2'
lifecycleVersion = '2.2.0'
materialVersion = '1.2.0'
navigationVersion = '2.3.1'
okhttpLoggingVersion = '4.7.2'
pagingVersion = '3.0.0-alpha09'
recyclerViewVersion = '1.2.0-alpha04'
retrofitVersion = '2.9.0'
roomVersion = '2.3.0-alpha01'
runnerVersion = '1.0.1'
truthVersion = '0.42'
testExtJunit = '1.1.0'
uiAutomatorVersion = '2.2.0'
viewPagerVersion = '1.0.0'
workVersion = '2.1.0'
kotlin_version = '1.4.10'
arouter_compiler_version = '1.5.1'
arouter_api_version = '1.5.1'
refresh_version = "2.0.1"
}
repositories {
google()
jcenter()
......@@ -18,6 +61,12 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 听读
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.1"
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'
}
}
......
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