| | |
| | | android:launchMode="singleTop" /> |
| | | |
| | | |
| | | <!--百度内容联盟 --> |
| | | <activity |
| | | android:name="com.baidu.mobads.AppActivity" |
| | | android:configChanges="keyboard|keyboardHidden|orientation" |
| | | android:theme="@android:style/Theme.Translucent.NoTitleBar" /> |
| | | |
| | | |
| | | <service android:name="com.yeshi.appupdate.service.DownLoadFileService"></service> |
| | | <service android:name="com.weikou.beibeivideo.service.DownLoadFileService" /> |
| | |
| | | "site_id": "5095354", |
| | | "app_id": "300965", |
| | | "partner": "pangle_300965", |
| | | "secure_key": "5af9b5efe0d87dbaaa0972fcca3b951a" |
| | | "secure_key": "5af9b5efe0d87dbaaa0972fcca3b951a", |
| | | "secure_key_d": "38da1945f9843f401de5587c427f2a44" |
| | | }, |
| | | "feed": { |
| | | "news_list_ad_code_id": "947236258", |
| | |
| | | "banner_ad_code_id": "947236558", |
| | | "end_ad_code_id": "947236544" |
| | | }, |
| | | "live": null |
| | | "live": null, |
| | | "license_config": null |
| | | } |
| | |
| | | apply plugin: 'android' |
| | | apply plugin: 'com.huawei.agconnect' |
| | | apply from: 'https://sf3-fe-tos.pglstatp-toutiao.com/obj/pangle-empower/android/pangrowth_media/plugin_config.gradle' |
| | | //apply from: 'https://sf3-fe-tos.pglstatp-toutiao.com/obj/pangle-empower/android/pangrowth_media/plugin_config.gradle' |
| | | |
| | | configurations.all { |
| | | exclude group: "com.bytedance.boringssl.so", module: 'boringssl-so' |
| | |
| | | |
| | | |
| | | implementation 'androidx.recyclerview:recyclerview:1.0.0' |
| | | implementation project(path: ':library-BaiduCPU') |
| | | // implementation project(path: ':library-BaiduCPU') |
| | | implementation project(path: ':library-DownloadProvider') |
| | | implementation project(path: ':library-GDTSDK') |
| | | implementation project(path: ':library-SocialSdk') |
| | |
| | | // //完整版引入 |
| | | // implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.1.5-release-jitpack' |
| | | |
| | | implementation 'com.shuyu:GSYVideoPlayer:7.1.8' |
| | | implementation 'com.shuyu:GSYVideoPlayer:8.1.2' |
| | | |
| | | //权限请求 |
| | | implementation 'com.github.jokermonn:permissions4m:2.1.2-lib' |
| | | annotationProcessor 'com.github.jokermonn:permissions4m:2.1.2-lib' |
| | | // implementation project(path: ':library-EventBus') |
| | | implementation project(path: ':library-VideoPlayer') |
| | | implementation project(path: ':library-common') |
| | |
| | | implementation project(path: ':library-gallery') |
| | | annotationProcessor 'com.github.jokermonn:permissions4m:2.1.2-processor' |
| | | //微信SDK |
| | | api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' |
| | | api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.8.0' |
| | | // api 'com.tencent.mm.opensdk:wechat-sdk-android:+' |
| | | |
| | | //加载动画库 |
| | | implementation 'com.github.ybq:Android-SpinKit:1.4.0' |
| | | |
| | | implementation 'com.qhutch.elevationimageview:elevationimageview:2.4' |
| | | |
| | | //穿山甲 |
| | | //========穿山甲========= |
| | | //为保证兼容性 建议使用广告SDK版本 |
| | | implementation "com.pangle.cn:mediation-sdk:5.7.0.9" |
| | | implementation('com.pangle.cn:pangrowth-sdk:3.9.0.2') { |
| | | exclude group: 'com.pangle.cn', module: 'partner-live-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-novel-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-game-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-reward-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'partner-luckycat-api-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-api' |
| | | // implementation "com.pangle.cn:mediation-sdk:5.7.0.9" |
| | | // implementation('com.pangle.cn:pangrowth-sdk:3.9.0.2') { |
| | | // exclude group: 'com.pangle.cn', module: 'partner-live-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-novel-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-game-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-reward-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'partner-luckycat-api-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-api' |
| | | // } |
| | | // implementation('com.volcengine:apm_insight_crash:1.4.2') |
| | | // implementation('com.volcengine:apm_insight_sdk:1.0.3') |
| | | // 5.6.1.5 |
| | | // implementation 'com.pangle.cn:ads-sdk-pro:6.3.1.7' |
| | | implementation 'com.pangle.cn:mediation-sdk:6.3.1.7' |
| | | implementation("com.pangle.cn:pangrowth-dpsdk:5.1.1.0") { |
| | | exclude group: 'com.pangle.cn', module: 'adclog' |
| | | } |
| | | // implementation('com.bytedance.applog:RangersAppLog-Lite-cn:6.6.2') |
| | | implementation('com.volcengine:apm_insight_crash:1.4.2') |
| | | implementation('com.volcengine:apm_insight_sdk:1.0.3') |
| | | implementation 'com.pangle.cn:pangrowth-djx-sdk:1.1.8.0' |
| | | implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:6.15.3' |
| | | |
| | | |
| | | //indicator |
| | | implementation 'com.github.hackware1993:MagicIndicator:1.7.0' |
| | | // 华为广告 |
| | | implementation 'com.huawei.hms:ads-lite:13.4.68.300' |
| | | |
| | | |
| | | // 本地日志 |
| | | implementation 'com.apkfuns.logutils:library:1.7.5' |
| | | implementation 'com.apkfuns.log2file:log2file:1.3.1' |
| | | |
| | | implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.10" |
| | | } |
| | | android { |
| | | signingConfigs { |
| | |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 143 |
| | | versionName "3.10.25" |
| | | versionCode 148 |
| | | versionName "3.10.30" |
| | | multiDexEnabled = true |
| | | minSdkVersion 19 |
| | | minSdkVersion 21 |
| | | targetSdkVersion 30 |
| | | ndk { |
| | | // 32与64 |
| | | // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' |
| | | |
| | | //64的 |
| | | abiFilters 'arm64-v8a', 'x86_64' |
| | | |
| | | //兼容64位与32位系统 |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a' |
| | | // abiFilters 'armeabi-v7a', 'arm64-v8a' |
| | | // abiFilters 'arm64-v8a' |
| | | } |
| | | |
New file |
| | |
| | | { |
| | | "version": 2, |
| | | "artifactType": { |
| | | "type": "APK", |
| | | "kind": "Directory" |
| | | }, |
| | | "applicationId": "com.doudou.ysvideo", |
| | | "variantName": "processReleaseResources", |
| | | "elements": [ |
| | | { |
| | | "type": "SINGLE", |
| | | "filters": [], |
| | | "versionCode": 145, |
| | | "versionName": "3.10.27", |
| | | "outputFile": "影视大全布丸_3.10.27_release.apk" |
| | | } |
| | | ] |
| | | } |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="app_name">影视大全布丸</string> |
| | | <string name="recommend">视频</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <network-security-config> |
| | | <base-config cleartextTrafficPermitted="true"> |
| | | <trust-anchors> |
| | | <certificates src="user" /> |
| | | <certificates src="system" /> |
| | | </trust-anchors> |
| | | </base-config> |
| | | </network-security-config> |
| | |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.shuyu.gsyvideoplayer.GSYVideoManager; |
| | | import com.shuyu.gsyvideoplayer.utils.Debuger; |
| | | import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | |
| | | } |
| | | |
| | | private void initPlayer() { |
| | | |
| | | // 打开调试模式 |
| | | Debuger.enable(); |
| | | videoPlayer.getBackButton().setVisibility(View.INVISIBLE); |
| | | videoPlayer.getBackButton().setImageResource(R.drawable.icon_player_back); |
| | | |
| | |
| | | import android.content.SharedPreferences; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.os.Environment; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.telephony.TelephonyManager; |
| | | import android.util.Log; |
| | | import android.webkit.WebView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; |
| | | import com.bytedance.applog.AppLog; |
| | | import com.bytedance.applog.InitConfig; |
| | | import com.bytedance.applog.util.UriConstants; |
| | | import com.apkfuns.log2file.LogFileEngineFactory; |
| | | import com.apkfuns.logutils.LogUtils; |
| | | import com.bytedance.sdk.djx.DJXSdk; |
| | | import com.bytedance.sdk.djx.DJXSdkConfig; |
| | | import com.bytedance.sdk.djx.model.DJXError; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPSdkConfig; |
| | | import com.bytedance.sdk.dp.IDPPrivacyController; |
| | |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsCustomController; |
| | | import com.kwad.sdk.api.SdkConfig; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.common.AndroidManifestUtil; |
| | | import com.lcjian.library.util.common.DeviceUtil; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | |
| | | import com.umeng.commonsdk.UMConfigure; |
| | | import com.umeng.socialize.PlatformConfig; |
| | | import com.umeng.socialize.UMShareAPI; |
| | | import com.weikou.beibeivideo.entity.ad.AdPidInfo; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | | import com.weikou.beibeivideo.ui.SplashActivity; |
| | | import com.weikou.beibeivideo.ui.ad.SplashADFragment; |
| | | import com.weikou.beibeivideo.ui.ad.SplashAdActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.CrashHandler; |
| | | import com.weikou.beibeivideo.util.DebuggerUtils; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.CSJConstant; |
| | | import com.weikou.beibeivideo.util.ad.GDTConstant; |
| | | import com.weikou.beibeivideo.util.ad.GMAdManagerHolder; |
| | | import com.weikou.beibeivideo.util.ad.TTAdManagerHolder; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.yeshi.appupdate.util.PackageUtils2; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.io.StringWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | | import androidx.multidex.MultiDex; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | |
| | | public class BeibeiVideoApplication extends Application { |
| | |
| | | //兼容4.4以下版本 |
| | | protected void attachBaseContext(Context newBase) { |
| | | super.attachBaseContext(newBase); |
| | | MultiDex.install(this); |
| | | } |
| | | |
| | | private static Handler handler = new Handler() { |
| | |
| | | |
| | | application = this; |
| | | instance = this; |
| | | MultiDex.install(this); |
| | | if (UserUtil.isAgreeUserProtocol(this) || BeibeiConstant.IS_TEST) { |
| | | //如果同意了用户协议 |
| | | init(application, null); |
| | |
| | | */ |
| | | public static void init(final Application application, InitListener initListener) { |
| | | Log.i(TAG, "系统初始化"); |
| | | // 初始化广告位 |
| | | if(AndroidManifestUtil.isOppoChannel(application)){ |
| | | CSJConstant.SPLASH_AD = "889066047"; |
| | | CSJConstant.RECOMMEND_BIG_IMG_AD = "956732346"; |
| | | CSJConstant.APP_EXIT = "956732346"; |
| | | CSJConstant.VIDEO_DETAIL_PLAYER_BOTTOM= "956732346"; |
| | | CSJConstant.VIDEO_SEARCH= "956732346"; |
| | | CSJConstant.HOME_INTERSTITIALAD = "956732361"; |
| | | } |
| | | |
| | | |
| | | inited = true; |
| | | registerActivityListener(application); |
| | | //防止动态代码注入 |
| | |
| | | |
| | | initWX(application); |
| | | initX5(application); |
| | | if(BeibeiConstant.IS_TEST) { |
| | | initLog(application); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化日志,将未捕获的错误保存到日志中 |
| | | * @param application |
| | | */ |
| | | private static void initLog(Application application){ |
| | | LogUtils.getLogConfig() |
| | | .configAllowLog(true) |
| | | .configTagPrefix("taoke") |
| | | .configShowBorders(true) |
| | | .configFormatTag("%d{HH:mm:ss:SSS} %t %c{-5}"); |
| | | |
| | | LogUtils.getLog2FileConfig().configLog2FileEnable(true) |
| | | // targetSdkVersion >= 23 需要确保有写sdcard权限 |
| | | .configLog2FilePath(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Download/" + application.getPackageName() + "/logs") |
| | | .configLog2FileNameFormat("%d{yyyyMMdd}.txt") |
| | | .configLogFileEngine(new LogFileEngineFactory(application)); |
| | | |
| | | Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(application)); |
| | | |
| | | } |
| | | |
| | | private static String getProcessName(Context context) { |
| | |
| | | if (initListener != null) |
| | | initListener.onFinish(); |
| | | initDPSDK(context); |
| | | initDJ(context); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<String> getInstalledPackages() { |
| | | return DeviceUtil.getInstalledPackageNamesCache(appContext); |
| | | return new ArrayList<>(); //DeviceUtil.getInstalledPackageNamesCache(appContext); |
| | | } |
| | | })// 是否开启sdk 调试⽇志 可选 |
| | | .build()); |
| | |
| | | if (!AdUtil.isCanInitCSJ()) { |
| | | return; |
| | | } |
| | | |
| | | /* 初始化开始 */ |
| | | final InitConfig config = new InitConfig("5095354", AndroidManifestUtil.getChannel(application)); // appid和渠道,appid如不清楚请联系客户成功经理,注意第二个参数 channel 不能为空 |
| | | config.setUriConfig(UriConstants.DEFAULT);//上报地址 |
| | | // 加密开关,SDK 5.5.1 及以上版本支持,false 为关闭加密,上线前建议设置为 true |
| | | AppLog.setEncryptAndCompress(true); |
| | | config.setAutoStart(true); |
| | | AppLog.init(application, config); |
| | | /* 初始化结束 */ |
| | | |
| | | if (!dpSDKIninted) { |
| | | DPSdkConfig.Builder configBuilder = new DPSdkConfig.Builder() |
| | | .debug(false) |
| | |
| | | //若您需要接入直播,参考「直播接入文档」;否则可忽略此参数。 |
| | | try { |
| | | DPSdk.init(application, "SDK_Setting_5095354.json", configBuilder.build()); |
| | | DPSdk.start(new DPSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s) { |
| | | dpSDKIninted = b; |
| | | Log.i(TAG," DPSdk.start:"+b+", "+s); |
| | | } |
| | | }); |
| | | // DPSdk.start(new DPSdk.StartListener() { |
| | | // @Override |
| | | // public void onStartComplete(boolean b, String s) { |
| | | // dpSDKIninted = b; |
| | | // Log.i(TAG," DPSdk.start:"+b+", "+s); |
| | | // } |
| | | // }); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void initDJ(Application application){ |
| | | try{ |
| | | DJXSdk.init(application, "SDK_Setting_5095354.json", new DJXSdkConfig.Builder().debug(true).build()); |
| | | |
| | | DJXSdk.start(new DJXSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s, @Nullable DJXError djxError) { |
| | | Log.i(TAG, String.format("DJXSdk.init:%s,%s", b, s)); |
| | | } |
| | | }); |
| | | }catch(Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | class MyExceptionHandler implements Thread.UncaughtExceptionHandler { |
| | | private final String TAG ="MyExceptionHandler"; |
| | | private final Context context; |
| | | |
| | | public MyExceptionHandler(Context context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | @Override |
| | | public void uncaughtException(Thread t, Throwable e) { |
| | | try { |
| | | StringWriter sw = new StringWriter(); |
| | | PrintWriter pw = new PrintWriter(sw); |
| | | e.printStackTrace(pw); |
| | | pw.flush(); |
| | | sw.flush(); |
| | | LogUtils.tag(TAG).e(sw.toString()); |
| | | LogUtils.getLog2FileConfig().flushAsync(); |
| | | }catch(Throwable ee){ |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.weikou.beibeivideo.entity.ad; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | | import com.bytedance.sdk.openadsdk.CSJSplashAd; |
| | | import com.qq.e.ads.splash.SplashAD; |
| | | |
| | | public class SplashAdLoadInfo { |
| | | |
| | | private SplashAD gdtSplashAd; |
| | | private long expireTime; |
| | | private TTSplashAd csjAd; |
| | | private CSJSplashAd csjAd; |
| | | |
| | | public SplashAdLoadInfo(SplashAD gdtSplashAd, long expireTime) { |
| | | this.gdtSplashAd = gdtSplashAd; |
| | | this.expireTime = expireTime; |
| | | } |
| | | |
| | | public SplashAdLoadInfo(long expireTime, TTSplashAd csjAd) { |
| | | public SplashAdLoadInfo(long expireTime, CSJSplashAd csjAd) { |
| | | this.expireTime = expireTime; |
| | | this.csjAd = csjAd; |
| | | } |
| | |
| | | this.expireTime = expireTime; |
| | | } |
| | | |
| | | public TTSplashAd getCsjAd() { |
| | | public CSJSplashAd getCsjAd() { |
| | | return csjAd; |
| | | } |
| | | |
| | | public void setCsjAd(TTSplashAd csjAd) { |
| | | public void setCsjAd(CSJSplashAd csjAd) { |
| | | this.csjAd = csjAd; |
| | | } |
| | | } |
| | |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.ScreenUtils; |
| | | import com.lcjian.library.util.common.AndroidManifestUtil; |
| | | import com.lcjian.library.util.common.BitmapUtils; |
| | | import com.lcjian.library.util.common.DrawableUtils; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | |
| | | super.onResume(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onRestart() { |
| | | super.onRestart(); |
| | | if(UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application)) { |
| | | // 华为广告才有此配置 |
| | | |
| | | if (AdUtil.getAdType(this,AdPositionEnum.splash)== AdUtil.AD_TYPE.hw &&AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) { |
| | | toMainActivity(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void getUid() { |
| | | final SharedPreferences preferences = getSharedPreferences("user", |
| | | Context.MODE_PRIVATE); |
| | |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | | import com.bytedance.sdk.openadsdk.CSJSplashAd; |
| | | import com.huawei.hms.ads.AdParam; |
| | | import com.huawei.hms.ads.AudioFocusType; |
| | | import com.huawei.hms.ads.splash.SplashView; |
| | |
| | | if (isAdLoaded()) { |
| | | //穿山甲广告 |
| | | if (adLoadInfo.getCsjAd() != null) { |
| | | TTSplashAd ad = adLoadInfo.getCsjAd(); |
| | | CSJSplashAd ad = adLoadInfo.getCsjAd(); |
| | | View view = ad.getSplashView(); |
| | | fl_ad.removeAllViews(); |
| | | //把SplashView 添加到ViewGroup中 |
| | | fl_ad.addView(view); |
| | | |
| | | ad.setSplashInteractionListener(new TTSplashAd.AdInteractionListener() { |
| | | ad.setSplashAdListener(new CSJSplashAd.SplashAdListener() { |
| | | @Override |
| | | public void onAdClicked(View view, int type) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdShow(View view, int type) { |
| | | public void onSplashAdShow(CSJSplashAd csjSplashAd) { |
| | | lastShowTime = System.currentTimeMillis(); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdSkip() { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | public void onSplashAdClick(CSJSplashAd csjSplashAd) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdTimeOver() { |
| | | public void onSplashAdClose(CSJSplashAd csjSplashAd, int i) { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | //防止截屏攻击风险 |
| | | getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); |
| | | if(!BeibeiConstant.IS_TEST) { |
| | | getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); |
| | | } |
| | | setContentView(R.layout.act_login); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | uid = getSharedPreferences("user", Context.MODE_PRIVATE).getString( |
| | |
| | | import android.os.Bundle; |
| | | import android.provider.MediaStore; |
| | | import androidx.annotation.NonNull; |
| | | import androidx.core.content.FileProvider; |
| | | |
| | | import android.util.Base64; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.file.Files; |
| | | import java.util.Calendar; |
| | | import java.util.Map; |
| | | |
| | |
| | | public class PersonInfoActivity extends BaseActivity implements View.OnClickListener, PermissionInterface { |
| | | |
| | | private String TAG = PersonInfoActivity.class.getSimpleName(); |
| | | private String BASE_FILE_DIR = Environment.getExternalStorageDirectory().getPath() + "/Download/YSDQImg"; |
| | | |
| | | private LinearLayout ll_portrait; |
| | | private LinearLayout ll_nickName; |
| | |
| | | @Override |
| | | protected void onCreate(Bundle arg0) { |
| | | super.onCreate(arg0); |
| | | // BASE_FILE_DIR = getCacheDir().getAbsolutePath(); |
| | | setContentView(R.layout.activity_person_info); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | ll_portrait = (LinearLayout) findViewById(R.id.ll_portrait_select); |
| | |
| | | //图库 |
| | | Photo_crop crop = new Photo_crop();//初始化 图片压缩 |
| | | File f = new File(uriClipUri.getPath());//获取图片 |
| | | if (crop.compressPhto(f, false)) {//压缩并保存成功 |
| | | Uri uri = Uri.parse("file://" + "/" + android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + "avatar.png"); |
| | | if(!f.exists()){ |
| | | Log.i(TAG,"裁剪的图片不存在"); |
| | | } |
| | | String targetFilePath = BASE_FILE_DIR + "/avatar.png"; |
| | | if (crop.compressPhto(f, targetFilePath, false)) {//压缩并保存成功 |
| | | Uri uri = Uri.parse("file://" + "/" + targetFilePath); |
| | | f = new File(uri.getPath()); |
| | | imgBase64 = bitmapToBase64(f); |
| | | iv_portrait.postDelayed(new Runnable() { |
| | |
| | | * @param uri |
| | | */ |
| | | public void startPhotoZoom(Uri uri) { |
| | | File storageDir = new File(android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/"); |
| | | File storageDir = new File(BASE_FILE_DIR); |
| | | if (!storageDir.exists()) {//没有文件夹则创建 |
| | | storageDir.mkdir(); |
| | | storageDir.mkdirs(); |
| | | } |
| | | //com.android.camera.action.CROP,这个action是调用系统自带的图片裁切功能 |
| | | Intent intent = new Intent("com.android.camera.action.CROP"); |
| | |
| | | |
| | | //uritempFile为Uri类变量,实例化uritempFile |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | |
| | | File file = new File(BASE_FILE_DIR+"/"+ System.currentTimeMillis() + "_clip.jpg"); |
| | | // uriClipUri = FileProvider.getUriForFile(getApplicationContext(),getApplicationContext().getPackageName() + ".fileprovider",file); |
| | | |
| | | //如果是7.0的相册 |
| | | //设置裁剪的图片地址Uri |
| | | uriClipUri = Uri.parse("file://" + "/" + android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + System.currentTimeMillis() + "_clip.jpg"); |
| | | uriClipUri = Uri.parse("file://" + "/" + BASE_FILE_DIR + "/"+ System.currentTimeMillis() + "_clip.jpg"); |
| | | } else { |
| | | uriClipUri = Uri.parse("file://" + "/" + android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + System.currentTimeMillis() + "_clip.jpg"); |
| | | uriClipUri = Uri.parse("file://" + "/" + BASE_FILE_DIR + "/" + System.currentTimeMillis() + "_clip.jpg"); |
| | | } |
| | | //Android 对Intent中所包含数据的大小是有限制的,一般不能超过 1M,否则会使用缩略图 ,所以我们要指定输出裁剪的图片路径 |
| | | intent.putExtra(MediaStore.EXTRA_OUTPUT, uriClipUri); |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | String filePath = android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/"; |
| | | String filePath = BASE_FILE_DIR; |
| | | if (new File(filePath).exists()) { |
| | | FileUtils.deleteDirectory(filePath); |
| | | } |
| | | } |
| | | |
| | | class Photo_crop { |
| | | /** |
| | | * 获取相册图片 |
| | | * |
| | | * @param uri |
| | | */ |
| | | public Uri startPhotoZoom(Uri uri, Context mContext) { |
| | | Uri uriClipUri = null; |
| | | //com.android.camera.action.CROP,这个action是调用系统自带的图片裁切功能 |
| | | Intent intent = new Intent("com.android.camera.action.CROP"); |
| | | intent.setDataAndType(uri, "image/*");//裁剪的图片uri和图片类型 |
| | | intent.putExtra("crop", "true");//设置允许裁剪,如果不设置,就会跳过裁剪的过程,还可以设置putExtra("crop", "circle") |
| | | if (Build.MANUFACTURER.equals("HUAWEI")) { //华为特殊处理 不然会显示圆 |
| | | intent.putExtra("aspectX", 9998); |
| | | intent.putExtra("aspectY", 9999); |
| | | } else { |
| | | intent.putExtra("aspectX", 1);//裁剪框的 X 方向的比例,需要为整数 |
| | | intent.putExtra("aspectY", 1);//裁剪框的 Y 方向的比例,需要为整数 |
| | | } |
| | | intent.putExtra("outputX", 600);//返回数据的时候的X像素大小。 |
| | | intent.putExtra("outputY", 600);//返回数据的时候的Y像素大小。 |
| | | //裁剪时是否保留图片的比例,这里的比例是1:1 |
| | | intent.putExtra("scale", true); |
| | | //是否是圆形裁剪区域true,设置了也不一定有效 |
| | | intent.putExtra("circleCrop", false); |
| | | //uritempFile为Uri类变量,实例化uritempFile |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | //如果是7.0的相册 |
| | | //设置裁剪的图片地址Uri |
| | | uriClipUri = Uri.parse("file://" + "/" + android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + "clip.jpg"); |
| | | } else { |
| | | uriClipUri = Uri.parse("file://" + "/" + android.os.Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + "clip.jpg"); |
| | | } |
| | | Log.e("uriClipUri=====", "" + uriClipUri); |
| | | //Android 对Intent中所包含数据的大小是有限制的,一般不能超过 1M,否则会使用缩略图 ,所以我们要指定输出裁剪的图片路径 |
| | | intent.putExtra(MediaStore.EXTRA_OUTPUT, uriClipUri); |
| | | intent.putExtra("return-data", false);//是否将数据保留在Bitmap中返回 |
| | | intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出格式,一般设为Bitmap格式及图片类型 |
| | | intent.putExtra("noFaceDetection", false);//人脸识别功能 |
| | | ((Activity) mContext).startActivityForResult(intent, 1002);//裁剪完成的标识 |
| | | return uriClipUri; |
| | | } |
| | | |
| | | /** |
| | | * 图片压缩的方法(只是内存减少,避免oom,图片本身在disk盘体积不变) |
| | | * 显示的Bitmap占用的内存少一点,还是需要去设置加载的像素长度和宽度(变成缩略图) |
| | |
| | | * @param crop 是否剪裁圆形图片 true 是 false 否 |
| | | * @return |
| | | */ |
| | | public boolean compressPhto(File mFile, boolean crop) { |
| | | public boolean compressPhto(File mFile,String targetFilePath, boolean crop) { |
| | | // BitmapFactory这个类就提供了多个解析方法(decodeResource、decodeStream、decodeFile等)用于创建Bitmap。 |
| | | // 比如如果图片来源于网络,就可以使用decodeStream方法; |
| | | // 如果是sd卡里面的图片,就可以选择decodeFile方法; |
| | |
| | | String path = mFile.getPath(); |
| | | String absPath = mFile.getAbsolutePath(); |
| | | Bitmap bitmap = BitmapFactory.decodeFile(absPath, options); |
| | | |
| | | try { |
| | | return saveBitmap(bitmap, "avatar.png", crop);//保存成功 |
| | | if(bitmap==null){ |
| | | bitmap = BitmapFactory.decodeStream(Files.newInputStream(mFile.toPath())); |
| | | } |
| | | return saveBitmap(bitmap, targetFilePath, crop);//保存成功 |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | |
| | | * 保存文件, |
| | | * |
| | | * @param bitmap |
| | | * @param bitName 文件名 |
| | | * @param path 文件路径 |
| | | * @param crop |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | private boolean saveBitmap(Bitmap bitmap, String bitName, boolean crop) throws IOException { |
| | | private boolean saveBitmap(Bitmap bitmap, String path, boolean crop) throws IOException { |
| | | boolean save = false; |
| | | File storageDir = new File(Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/"); |
| | | File storageDir = new File(BASE_FILE_DIR); |
| | | if (!storageDir.exists()) {//没有文件夹则创建 |
| | | storageDir.mkdir(); |
| | | } |
| | | String fileName; |
| | | File file; |
| | | fileName = Environment.getExternalStorageDirectory().getPath() + "/YSDQImg/" + bitName; |
| | | fileName = path; |
| | | file = new File(fileName); |
| | | if (bitmap != null) { |
| | | if (file.exists()) { |
| | | file.delete(); |
| | | } |
| | | // 创建上级文件夹 |
| | | if(!file.getParentFile().exists()) |
| | | { |
| | | file.getParentFile().mkdirs(); |
| | | } |
| | | // 创建文件 |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileOutputStream out; |
| | | |
| | | out = new FileOutputStream(file); |
| | | // 格式为 JPEG,照相机拍出的图片为JPEG格式的,PNG格式的不能显示在相册中 |
| | | if (bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out)) { |
| | |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.bytedance.sdk.dp.DPDrama; |
| | | import com.bytedance.sdk.dp.DPDramaDetailConfig; |
| | | import com.bytedance.sdk.dp.DPWidgetDramaHomeParams; |
| | | import com.bytedance.sdk.dp.DPWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.IDPDramaListener; |
| | | import com.bytedance.sdk.dp.IDPWidget; |
| | | import com.bytedance.sdk.djx.DJXSdk; |
| | | import com.bytedance.sdk.djx.IDJXWidget; |
| | | import com.bytedance.sdk.djx.interfaces.listener.IDJXDramaListener; |
| | | import com.bytedance.sdk.djx.interfaces.listener.IDJXDramaUnlockListener; |
| | | import com.bytedance.sdk.djx.interfaces.listener.IDJXDrawListener; |
| | | import com.bytedance.sdk.djx.model.DJXDrama; |
| | | import com.bytedance.sdk.djx.model.DJXDramaDetailConfig; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockAdMode; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockInfo; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockMethod; |
| | | import com.bytedance.sdk.djx.model.DJXError; |
| | | import com.bytedance.sdk.djx.model.DJXUnlockModeType; |
| | | import com.bytedance.sdk.djx.params.DJXWidgetDrawParams; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.video.DPHolder; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import org.jetbrains.annotations.NotNull; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | */ |
| | | public class DYDramaVideoFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "DYDramaVideoFragment"; |
| | | private IDPWidget mIDPWidget; |
| | | private IDJXWidget mIDPWidget; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | private FragmentManager fragmentManager; |
| | | |
| | |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | init(); |
| | | if (DJXSdk.isStartSuccess()) { |
| | | init(); |
| | | } else { |
| | | DJXSdk.start(new DJXSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s, @Nullable DJXError djxError) { |
| | | Log.i(TAG, String.format("DJXSdk.init:%s,%s", b, s)); |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void init() { |
| | | try { |
| | | mIDPWidget = DPHolder.getInstance().buildDrawWidget(DPWidgetDrawParams.obtain() |
| | | .hideClose(true, new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | } |
| | | }) |
| | | .drawChannelType(DPWidgetDrawParams.DRAW_CHANNEL_TYPE_RECOMMEND_FOLLOW_THEATER) |
| | | .dramaDetailConfig(DPDramaDetailConfig.obtain(DPDramaDetailConfig.COMMON_DETAIL)) |
| | | .drawContentType(DPWidgetDrawParams.DRAW_CONTENT_TYPE_ONLY_DRAMA) |
| | | .dramaListener(new IDPDramaListener() { |
| | | @Override |
| | | public void onDPClose() { |
| | | super.onDPClose(); |
| | | } |
| | | DJXDramaDetailConfig detailConfig = DJXDramaDetailConfig.obtain(DJXDramaUnlockAdMode.MODE_COMMON, 5, new IDJXDramaUnlockListener() { |
| | | @Override |
| | | public void unlockFlowStart(@NotNull DJXDrama djxDrama, @NotNull UnlockCallback unlockCallback, @org.jetbrains.annotations.Nullable Map<String, ?> map) { |
| | | // constructor(dramaId: kotlin.Long, lockSet: kotlin.Int, method: com.bytedance.sdk.djx.model.DJXDramaUnlockMethod, hasMember: kotlin.Boolean = COMPILED_CODE, orderParams: kotlin.String? = COMPILED_CODE, cancelUnlock: kotlin.Boolean = COMPILED_CODE, unlockType: com.bytedance.sdk.djx.model.DJXUnlockModeType = COMPILED_CODE) { |
| | | DJXDramaUnlockInfo unlockInfo =new DJXDramaUnlockInfo(djxDrama.id, 5, DJXDramaUnlockMethod.METHOD_AD, false, null,false, DJXUnlockModeType.UNLOCKTYPE_DEFAULT); |
| | | unlockCallback.onConfirm(unlockInfo); |
| | | // listener?.unlockFlowStart(djxDrama, unlockCallback, map); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPRequestStart(@Nullable Map<String, Object> map) { |
| | | super.onDPRequestStart(map); |
| | | } |
| | | @Override |
| | | public void unlockFlowEnd(@NotNull DJXDrama djxDrama, @org.jetbrains.annotations.Nullable UnlockErrorStatus unlockErrorStatus, @org.jetbrains.annotations.Nullable Map<String, ?> map) { |
| | | |
| | | @Override |
| | | public void onDPRequestFail(int i, String s, @Nullable Map<String, Object> map) { |
| | | super.onDPRequestFail(i, s, map); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDPRequestSuccess(List<Map<String, Object>> list) { |
| | | super.onDPRequestSuccess(list); |
| | | } |
| | | @Override |
| | | public void showCustomAd(@NotNull DJXDrama djxDrama, @NotNull CustomAdCallback customAdCallback) { |
| | | |
| | | @Override |
| | | public boolean isNeedBlock(DPDrama dpDrama, int i, @Nullable Map<String, Object> map) { |
| | | return super.isNeedBlock(dpDrama, i, map); |
| | | } |
| | | }) |
| | | ); |
| | | } |
| | | }); |
| | | mIDPWidget = DJXSdk.factory().createDraw(DJXWidgetDrawParams.obtain(). |
| | | detailConfig(detailConfig). |
| | | dramaFree(5). |
| | | drawChannelType(DJXWidgetDrawParams.DRAW_CHANNEL_TYPE_RECOMMEND_THEATER). |
| | | hideClose(true, new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | } |
| | | }).listener(new IDJXDrawListener() { |
| | | @Override |
| | | public void onDJXRefreshFinish() { |
| | | super.onDJXRefreshFinish(); |
| | | } |
| | | }).dramaListener(new IDJXDramaListener() { |
| | | |
| | | |
| | | |
| | | })); |
| | | // mIDPWidget =DPHolder.getInstance().buildDramaWidget(DJXWidgetDrawParams.obtain(). |
| | | // detailConfig(DJXDramaDetailConfig.obtain(DJXDramaUnlockAdMode.MODE_COMMON,5,null)) |
| | | // .hideClose(true, new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // |
| | | // } |
| | | // }).drawChannelType(DJXWidgetDrawParams.DRAW_CHANNEL_TYPE_RECOMMEND_THEATER) |
| | | // ); |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | | fragmentManager = null; |
| | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.bytedance.sdk.djx.DJXSdk; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.DPWidgetNewsParams; |
| | |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | init(); |
| | | if(DPSdk.isStartSuccess()){ |
| | | init(); |
| | | }else { |
| | | DPSdk.start(new DPSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s) { |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void init() { |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.common.AndroidManifestUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.video.youth.entity.YouthModeChange; |
| | |
| | | feedVideos.setName("热门"); |
| | | categories.add(1, feedVideos); |
| | | //抖音短剧 |
| | | feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("dyDrama"); |
| | | feedVideos.setName("剧场"); |
| | | categories.add(1, feedVideos); |
| | | if(!AndroidManifestUtil.isHuaWeiChannel(getContext())) { |
| | | feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("dyDrama"); |
| | | feedVideos.setName("剧场"); |
| | | categories.add(1, feedVideos); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.bytedance.sdk.dp.DPDrama; |
| | | import com.bytedance.sdk.dp.DPDramaDetailConfig; |
| | | import com.bytedance.sdk.dp.DPWidgetDramaHomeParams; |
| | | import com.bytedance.sdk.dp.DPWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.IDPDramaListener; |
| | | import com.bytedance.sdk.dp.IDPWidget; |
| | | import com.bytedance.sdk.djx.IDJXWidget; |
| | | import com.bytedance.sdk.djx.interfaces.listener.IDJXDramaUnlockListener; |
| | | import com.bytedance.sdk.djx.model.DJXDrama; |
| | | import com.bytedance.sdk.djx.model.DJXDramaDetailConfig; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockAdMode; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockInfo; |
| | | import com.bytedance.sdk.djx.model.DJXDramaUnlockMethod; |
| | | import com.bytedance.sdk.djx.model.DJXUnlockModeType; |
| | | import com.bytedance.sdk.djx.params.DJXWidgetDramaHomeParams; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.video.DPHolder; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import java.util.List; |
| | | import org.jetbrains.annotations.NotNull; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | */ |
| | | public class HomeTabDramaFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "HomeTabDramaFragment"; |
| | | private IDPWidget mIDPWidget; |
| | | private IDJXWidget mIDPWidget; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | private FragmentManager fragmentManager; |
| | | |
| | |
| | | |
| | | private void init() { |
| | | try { |
| | | |
| | | DJXDramaDetailConfig detailConfig = DJXDramaDetailConfig.obtain(DJXDramaUnlockAdMode.MODE_COMMON, 5, new IDJXDramaUnlockListener() { |
| | | @Override |
| | | public void unlockFlowStart(@NotNull DJXDrama djxDrama, @NotNull UnlockCallback unlockCallback, @org.jetbrains.annotations.Nullable Map<String, ?> map) { |
| | | // constructor(dramaId: kotlin.Long, lockSet: kotlin.Int, method: com.bytedance.sdk.djx.model.DJXDramaUnlockMethod, hasMember: kotlin.Boolean = COMPILED_CODE, orderParams: kotlin.String? = COMPILED_CODE, cancelUnlock: kotlin.Boolean = COMPILED_CODE, unlockType: com.bytedance.sdk.djx.model.DJXUnlockModeType = COMPILED_CODE) { |
| | | DJXDramaUnlockInfo unlockInfo =new DJXDramaUnlockInfo(djxDrama.id, 5, DJXDramaUnlockMethod.METHOD_AD, false, null,false, DJXUnlockModeType.UNLOCKTYPE_DEFAULT); |
| | | unlockCallback.onConfirm(unlockInfo); |
| | | // listener?.unlockFlowStart(djxDrama, unlockCallback, map); |
| | | } |
| | | |
| | | @Override |
| | | public void unlockFlowEnd(@NotNull DJXDrama djxDrama, @org.jetbrains.annotations.Nullable UnlockErrorStatus unlockErrorStatus, @org.jetbrains.annotations.Nullable Map<String, ?> map) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void showCustomAd(@NotNull DJXDrama djxDrama, @NotNull CustomAdCallback customAdCallback) { |
| | | |
| | | } |
| | | }); |
| | | |
| | | mIDPWidget = DPHolder.getInstance().buildDramaHomeWidget( |
| | | DPWidgetDramaHomeParams.obtain() |
| | | DJXWidgetDramaHomeParams.obtain(detailConfig) |
| | | .showPageTitle(false) |
| | | .detailConfig(DPDramaDetailConfig.obtain(DPDramaDetailConfig.COMMON_DETAIL)) |
| | | |
| | | ); |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.widget.ListView; |
| | | import android.widget.ProgressBar; |
| | | |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsContentPage; |
| | | import com.kwad.sdk.api.KsScene; |
| | | import com.lcjian.library.util.FragmentSwitchHelper; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.ADSize; |
| | | import com.qq.e.ads.nativ.NativeExpressAD; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment; |
| | | import com.weikou.beibeivideo.ui.recommend.GuessLikeAdapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.ad.KSConstant; |
| | | import com.weikou.beibeivideo.util.video.DPEventCollectUtil; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.fragment.app.FragmentManager; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | | /** |
| | | * 主页面--快手视频 |
| | |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.FragmentSwitchHelper; |
| | |
| | | |
| | | return new Fragment[]{ |
| | | new HomeFragment(), new DrawVideoFragment(getSupportFragmentManager()), |
| | | new DYNewsFragment(getSupportFragmentManager()),new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | new DYNewsFragment(getSupportFragmentManager()), new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | |
| | | }; |
| | | } |
| | |
| | | findViewById(R.id.ll_activity_login).setOnClickListener(this); |
| | | findViewById(R.id.fl_category).setOnClickListener(this); |
| | | |
| | | if (AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) { |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.GONE); |
| | | } else { |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.VISIBLE); |
| | | } |
| | | |
| | | |
| | | initialer.run(); |
| | | |
| | |
| | | // }); |
| | | //显示广告 |
| | | showInterstitialAd(); |
| | | // 运行 |
| | | DPSdk.start(new DPSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | } else { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_novel).isChecked() || mAQuery.id(R.id.rb_nav_discover).isChecked()|| mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_novel).isChecked() || mAQuery.id(R.id.rb_nav_discover).isChecked() || mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | } else { |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | } |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked()||mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | // mAQuery.id(R.id.v_status_bar).background(Color.BLACK); |
| | | //TODO 设置状态栏为深色 |
| | | TopStatusSettings.setStatusViewAndLightColor(this); |
| | |
| | | |
| | | //显示插屏广告 |
| | | private void showInterstitialAd() { |
| | | final AdUtil.AD_TYPE adType = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | final AdUtil.AD_TYPE adType = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | if (adType == null) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | adCallback = new Runnable() { |
| | |
| | | } |
| | | |
| | | if (type == AdUtil.AD_TYPE.csj) { |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, CSJConstant.HOME_INTERSTITIALAD); |
| | | }else if(type == AdUtil.AD_TYPE.hw){ |
| | | |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, AndroidManifestUtil.isVIVOChannel(getApplicationContext()) ? CSJConstant.HOME_INTERSTITIALAD_VIVO : CSJConstant.HOME_INTERSTITIALAD); |
| | | } else if (type == AdUtil.AD_TYPE.hw) { |
| | | if (AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) { |
| | | // 华为平台的弹出广告每天只能弹出一次 |
| | | if (!AdUtil.canShowAdHuaWei(getApplicationContext(), AdPositionEnum.homeInterstitial)) { |
| | | return; |
| | | } |
| | | AdUtil.setAdHuaWeiShown(getApplicationContext(),AdPositionEnum.homeInterstitial); |
| | | AdUtil.setAdHuaWeiShown(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | } |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, HuaWeiAdConstant.HW_AD_HOME_INTERSTITIAL); |
| | | } else { |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | new ExpressAdManager( AndroidManifestUtil.isHuaWeiChannel(getContext())?AdUtil.AD_TYPE.hw: AdUtil.AD_TYPE.gdt2, getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | AdUtil.AD_TYPE adType = AndroidManifestUtil.isHuaWeiChannel(getContext())?AdUtil.AD_TYPE.hw: AdUtil.AD_TYPE.gdt2; |
| | | if(AndroidManifestUtil.isOppoChannel(getContext())){ |
| | | adType = null; |
| | | } |
| | | new ExpressAdManager(adType , getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | |
| | | } |
| | | |
| | | } else if (playUrl.getResource().getName().contains("风行")) { |
| | | if(playUrl.getPlayType() == 2){ |
| | | // 不是vivo上线 |
| | | if(!AndroidManifestUtil.isVIVOChannel(getApplicationContext())){ |
| | | playUrl.setPlayType(1); |
| | | } |
| | | } |
| | | if (playUrl.getPlayType() == 0) { |
| | | Toast.makeText(VideoDetailActivity2.this, "此节目不可播!", |
| | | Toast.LENGTH_LONG).show(); |
| | |
| | | startActivity(intent); |
| | | saveWatchHistory("风行"); |
| | | initPlayer(); |
| | | } else if (playUrl.getPlayType() == 2) {//SDK播放 |
| | | } else if (playUrl.getPlayType() == 2 && AndroidManifestUtil.isVIVOChannel(getApplicationContext())) {//SDK播放 |
| | | //播放风行视频 |
| | | //添加风行播放页 |
| | | // mFunshionPlayerFragment = new FunshionPlayerFragment(); |
| | |
| | | // } |
| | | // fl_video_play_background.setVisibility(View.GONE); |
| | | |
| | | |
| | | // 风行网页播放器 |
| | | // iv_select_play.setVisibility(View.GONE); |
| | | // iv_background.setClickable(false); |
| | | // hideImage(); |
| | | // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_video_play_container, new FunshionWebPlayerFragment("测试标题", "http://www.fun.tv/vplay/g-1018345/")).commit(); |
| | | // return; |
| | | // 风行原生播放器,用于新上架的链接 |
| | | iv_select_play.setVisibility(View.GONE); |
| | | iv_background.setClickable(false); |
| | | hideImage(); |
| | | String url = playUrl.getUrl(); |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fragment_video_play_container, new FunshionWebPlayerFragment(videoInfo.getName(), url)).commit(); |
| | | return; |
| | | } |
| | | |
| | | } else { |
| | |
| | | import com.lcjian.library.RetainViewFragment; |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.lcjian.library.util.common.AndroidManifestUtil; |
| | | import com.lcjian.library.util.common.ClipboardUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | |
| | | private void showCSJInterstitialAd() { |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(getContext()); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(CSJConstant.VIDEO_DETAIL_INTERSTITIALAD) |
| | | .setCodeId(AndroidManifestUtil.isVIVOChannel(getContext()) ? CSJConstant.VIDEO_DETAIL_INTERSTITIALAD_VIVO : CSJConstant.VIDEO_DETAIL_INTERSTITIALAD) |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 500) |
| | | .setSupportDeepLink(true) |
| | |
| | | //请求广告失败 |
| | | @Override |
| | | public void onError(int code, String message) { |
| | | Log.i(TAG,"广告返回错误:"+message); |
| | | |
| | | } |
| | | |
| | |
| | | JSONObject object = new JSONObject(config); |
| | | object = object.optJSONObject(position.getPositionName()); |
| | | if (object != null) |
| | | if (AndroidManifestUtil.isHuaWeiChannel(context)){ |
| | | if (AndroidManifestUtil.isHuaWeiChannel(context)&&false){ |
| | | return AD_TYPE.hw; |
| | | }else { |
| | | return AD_TYPE.valueOf(object.optString("type")); |
| | |
| | | return null; |
| | | } |
| | | } else { |
| | | if (AndroidManifestUtil.isHuaWeiChannel(context)) { |
| | | if (AndroidManifestUtil.isHuaWeiChannel(context)&&false) { |
| | | return AD_TYPE.hw; |
| | | } else { |
| | | return AD_TYPE.gdt; |
| | |
| | | |
| | | public static String PPTV_INTERSTITIALAD = "946078773"; |
| | | |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD = "945393854"; |
| | | |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD = "946608275"; |
| | | |
| | | |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD_VIVO = "958680153"; |
| | | //首页插屏 |
| | | public static String HOME_INTERSTITIALAD = "947410891"; |
| | | |
| | | |
| | | //首页插屏VIVO |
| | | public static String HOME_INTERSTITIALAD_VIVO = "958680147"; |
| | | //二次下载提示 |
| | | public static boolean CSJ_AD_DOWNLOAD_NOTIFY = false; |
| | | |
| | |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadVideoDetailPlayerBottomAd(final IAdLoadListener adLoadListener) { |
| | | if(sourceType==null){ |
| | | return; |
| | | } |
| | | Log.i(TAG, "loadVideoDetailPlayerBottomAd"); |
| | | //加载大图 |
| | | String pid = null; |
| | |
| | | public void loadSearchAd(int widthDP, final IAdLoadListener adLoadListener) { |
| | | //加载大图 |
| | | String pid = null; |
| | | int height = (int) (widthDP / 1.78f); |
| | | if (sourceType == AdUtil.AD_TYPE.csj) { |
| | | pid = CSJConstant.VIDEO_SEARCH; |
| | | height=0; |
| | | } else if (sourceType == AdUtil.AD_TYPE.gdt2) { |
| | | pid = BeibeiConstant.GDT_SEARCH_NATIVE; |
| | | } else if (sourceType == AdUtil.AD_TYPE.hw) { |
| | | pid = HuaWeiAdConstant.HW_AD_NATIVE_SEARCH; |
| | | } |
| | | int height = (int) (widthDP / 1.78f); |
| | | |
| | | loadAd(widthDP, height, pid, 1, adLoadListener); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | NativeAdConfiguration adConfiguration = new NativeAdConfiguration.Builder() |
| | | .setAdSize(new AdSize(width, height)) |
| | | // .setAdSize(new AdSize(width, height)) |
| | | .setMediaAspect(NativeAdConfiguration.MediaAspect.ASPECT_LANDSCAPE) |
| | | // 是否要自定义“不再显示该广告”的功能 |
| | | .setRequestCustomDislikeThisAd(true) |
| | | // 设置原生广告是否返回多张图片素材,如果请求的创意类型是原生三小图,则需要设置此方法 |
| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.Build; |
| | | import android.util.Log; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | |
| | | int w = DimenUtils.getScreenWidth(context); |
| | | int h = DimenUtils.getScreenHeight(context); |
| | | String channel = AndroidManifestUtil.getChannel(context); |
| | | String pid = "945393854"; |
| | | String pid =AndroidManifestUtil.isVIVOChannel(context)?CSJConstant.VIDEO_DETAIL_INTERSTITIALAD_VIVO : CSJConstant.VIDEO_DETAIL_INTERSTITIALAD; |
| | | if ("huawei".equalsIgnoreCase(channel)) { |
| | | pid = "948943768"; |
| | | } |
| | |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(pid) |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(w, h) |
| | | .setExpressViewAcceptedSize(200, 300) |
| | | .setOrientation(TTAdConstant.VERTICAL) |
| | | .build(); |
| | | TTAdManager ttAdManager = null; |
| | |
| | | mTTAdNative.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() { |
| | | @Override |
| | | public void onError(int code, String message) { |
| | | Log.i("loadFullScreenVideoAd","onError"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | }); |
| | | |
| | | if (ad != null && adListener != null) |
| | | if (adListener != null) |
| | | adListener.onSuccess(ad); |
| | | } |
| | | |
| | |
| | | //测试视频: testd7c5cewoj6 测试图片:testq6zq98hecj |
| | | public static final String HW_AD_SPLASH = "v0oxphnhpf";//"v0oxphnhpf"; |
| | | // 测试视频: testb4znbuh3n2 测试图片:teste9ih9j0rc3 |
| | | public static final String HW_AD_HOME_INTERSTITIAL = "testb4znbuh3n2"; |
| | | public static final String HW_AD_HOME_INTERSTITIAL = "w36jzephqw"; |
| | | // 大图文:testu7m3hc4gvm 三小图文:testr6w14o0hqz 小图文:testb65czjivt9 视频文:testy63txaom86 |
| | | public static final String HW_AD_NATIVE_EXIT_APP = "testu7m3hc4gvm";//"t108ip7c7t"; |
| | | public static final String HW_AD_NATIVE_EXIT_APP = "t108ip7c7t";//"t108ip7c7t"; |
| | | |
| | | public static final String HW_AD_NATIVE_RECOMMEND_BIG = "testy63txaom86"; |
| | | public static final String HW_AD_NATIVE_RECOMMEND_BIG = "z672r931qs"; |
| | | |
| | | public static final String HW_AD_NATIVE_PLAYER_BOTTOM = "testu7m3hc4gvm"; |
| | | public static final String HW_AD_NATIVE_PLAYER_BOTTOM = "x103b8thww"; |
| | | |
| | | public static final String HW_AD_NATIVE_SEARCH = "testy63txaom86"; |
| | | public static final String HW_AD_NATIVE_SEARCH = "h0zqnxqsjp"; |
| | | |
| | | public static final String HW_AD_NATIVE_SEARCH_RESULT = "testb65czjivt9"; |
| | | public static final String HW_AD_NATIVE_SEARCH_RESULT = "h0zqnxqsjp"; |
| | | |
| | | public static final String HW_AD_VIDEO_DETAIL_INTERSTITIAL = "testb4znbuh3n2"; |
| | | public static final String HW_AD_VIDEO_DETAIL_INTERSTITIAL = "n6w1rcu5b9"; |
| | | |
| | | // |
| | | // public static final String HW_AD_SPLASH = "j2kvcvt4p0"; |
| | | // |
| | | // public static final String HW_AD_HOME_INTERSTITIAL = "testb4znbuh3n2"; |
| | | // |
| | | // public static final String HW_AD_NATIVE_EXIT_APP = "u7m3hc4gvm"; |
| | | // |
| | | // public static final String HW_AD_NATIVE_RECOMMEND_BIG = "u7m3hc4gvm"; |
| | | // |
| | | // public static final String HW_AD_NATIVE_PLAYER_BOTTOM = "u7m3hc4gvm"; |
| | | // |
| | | // public static final String HW_AD_NATIVE_SEARCH = "u7m3hc4gvm"; |
| | | // |
| | | // public static final String HW_AD_NATIVE_SEARCH_RESULT = "u7m3hc4gvm"; |
| | | // |
| | | // public static final String HW_AD_VIDEO_DETAIL_INTERSTITIAL = "testb4znbuh3n2"; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import android.app.Activity; |
| | | import android.util.Log; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | |
| | | |
| | | public class InterstitialAdUtil { |
| | | |
| | | |
| | | private static final String TAG = "InterstitialAdUtil"; |
| | | |
| | | public static void showAd(Activity context, AdUtil.AD_TYPE adType, String pid) { |
| | | if (adType == null) { |
| | |
| | | //请求广告失败 |
| | | @Override |
| | | public void onError(int code, String message) { |
| | | |
| | | Log.i(TAG,"广告错误"); |
| | | } |
| | | |
| | | //广告物料加载完成的回调 |
| | |
| | | package com.weikou.beibeivideo.util.ad; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.SystemClock; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.CSJAdError; |
| | | import com.bytedance.sdk.openadsdk.CSJSplashAd; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.qq.e.ads.splash.SplashAD; |
| | | import com.qq.e.ads.splash.SplashADListener; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.entity.ad.AdTypeVO; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | |
| | | .setSupportDeepLink(true) |
| | | .setImageAcceptedSize(width, height) |
| | | .build(); |
| | | mTTAdNative.loadSplashAd(adSlot, new TTAdNative.SplashAdListener() { |
| | | mTTAdNative.loadSplashAd(adSlot, new TTAdNative.CSJSplashAdListener() { |
| | | |
| | | @Override |
| | | public void onError(int i, String s) { |
| | | public void onSplashLoadSuccess(CSJSplashAd csjSplashAd) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSplashLoadFail(CSJAdError csjAdError) { |
| | | splashAdListener.noAd(); |
| | | } |
| | | |
| | | @Override |
| | | public void onTimeout() { |
| | | splashAdListener.noAd(); |
| | | } |
| | | public void onSplashRenderSuccess(CSJSplashAd csjSplashAd) { |
| | | |
| | | @Override |
| | | public void onSplashAdLoad(TTSplashAd ad) { |
| | | if (ad == null) { |
| | | if (csjSplashAd == null) { |
| | | splashAdListener.noAd(); |
| | | return; |
| | | } |
| | | |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(System.currentTimeMillis() + 1000 * 60 * 30L, ad)); |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(System.currentTimeMillis() + 1000 * 60 * 30L, csjSplashAd)); |
| | | } |
| | | |
| | | @Override |
| | | public void onSplashRenderFail(CSJSplashAd csjSplashAd, CSJAdError csjAdError) { |
| | | splashAdListener.noAd(); |
| | | } |
| | | }, 4000); |
| | | |
| | |
| | | private static TTAdConfig buildConfig(Context context) { |
| | | TTAdConfig.Builder builder = new TTAdConfig.Builder() |
| | | .appId("5095354") |
| | | .useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView |
| | | .appName(context.getString(R.string.app_name)) |
| | | .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK) |
| | | .allowShowNotify(true) //是否允许sdk展示通知栏提示 |
| | |
| | | package com.weikou.beibeivideo.util.video; |
| | | |
| | | import com.bytedance.sdk.djx.DJXSdk; |
| | | import com.bytedance.sdk.djx.IDJXWidget; |
| | | import com.bytedance.sdk.djx.params.DJXWidgetDramaHomeParams; |
| | | import com.bytedance.sdk.djx.params.DJXWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPWidgetBannerParams; |
| | | import com.bytedance.sdk.dp.DPWidgetBubbleParams; |
| | | import com.bytedance.sdk.dp.DPWidgetDramaHomeParams; |
| | | import com.bytedance.sdk.dp.DPWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.DPWidgetGridParams; |
| | | import com.bytedance.sdk.dp.DPWidgetInnerPushParams; |
| | |
| | | return getFactory().createNewsOneTab(params); |
| | | } |
| | | |
| | | public IDPWidget buildDramaHomeWidget(DPWidgetDramaHomeParams params){ |
| | | public IDJXWidget buildDramaHomeWidget(DJXWidgetDramaHomeParams params){ |
| | | |
| | | return getFactory().createDramaHome(params); |
| | | return DJXSdk.factory().createDramaHome(params); |
| | | } |
| | | |
| | | public IDJXWidget buildDramaWidget(DJXWidgetDrawParams params){ |
| | | |
| | | return DJXSdk.factory().createDraw(params); |
| | | } |
| | | |
| | | public void loadVideoCard(DPWidgetVideoCardParams params, IDPWidgetFactory.Callback callback) { |
| | |
| | | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| | | buildscript { |
| | | repositories { |
| | | |
| | | buildscript { |
| | | |
| | | repositories { |
| | | maven {url 'https://developer.huawei.com/repo/'} |
| | | |
| | | //字节跳动SDK |
| | |
| | | jcenter() |
| | | mavenCentral() |
| | | google() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | dependencies { |
| | | classpath 'com.android.tools.build:gradle:4.1.1' |
| | | classpath 'com.huawei.agconnect:agcp:1.4.1.300' |
| | | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72" |
| | | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10" |
| | | } |
| | | } |
| | | |
| | |
| | | return "huawei".equalsIgnoreCase(getChannel(context)); |
| | | } |
| | | |
| | | public static boolean isOppoChannel(Context context){ |
| | | return "oppo".equalsIgnoreCase(getChannel(context)); |
| | | } |
| | | |
| | | public static boolean isVIVOChannel(Context context){ |
| | | return "vivo".equalsIgnoreCase(getChannel(context)); |
| | | } |
| | | |
| | | } |
| | |
| | | public class ExampleInstrumentedTest { |
| | | @Test |
| | | public void useAppContext() throws Exception { |
| | | // Context of the app under test. |
| | | Context appContext = InstrumentationRegistry.getTargetContext(); |
| | | |
| | | assertEquals("com.lzj.gallery.library.test", appContext.getPackageName()); |
| | | } |
| | | } |
| | |
| | | include ':library-push' |
| | | include ':library-BaiduCPU' |
| | | include ':library-VideoPlayer' |
| | | include ':library-GDTSDK' |
| | | include ':library-SocialSdk' |