3个文件已删除
31个文件已修改
27个文件已添加
| | |
| | | android:protectionLevel="signature" /> |
| | | <uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" /> |
| | | |
| | | <uses-sdk tools:overrideLibrary="com.bytedance.pangrowthsdk,com.bytedance.novel.pangolin" /> |
| | | <uses-sdk tools:overrideLibrary="com.bytedance.pangrowthsdk,com.bytedance.novel.pangolin,com.bytedance.sdk.dp.dpsdk_lite,com.bytedance.sdk.dp.dpsdk_live,com.byted.live.api,com.bytedance.pangolin.game,com.bytedance.miniapp" /> |
| | | |
| | | <application |
| | | android:name="com.weikou.beibeivideo.BeibeiVideoApplication" |
| | |
| | | </activity> |
| | | <activity |
| | | android:name="com.weikou.beibeivideo.ui.main.MainActivity" |
| | | android:configChanges="keyboard|orientation|screenSize" |
| | | android:exported="true" |
| | | android:label="@string/app_name" |
| | | android:launchMode="singleTask" |
| | |
| | | android:label="@string/app_name" |
| | | android:windowSoftInputMode="adjustResize" /> |
| | | |
| | | <activity |
| | | android:name=".ui.common.CommonFragmentActivity" |
| | | android:label="@string/app_name" |
| | | android:windowSoftInputMode="adjustResize" /> |
| | | |
| | | |
| | | <!-- 阿里云手机号认证 --> |
| | | |
| | | <!--联通电信授权⻚--> |
| | |
| | | <service android:name="com.weikou.beibeivideo.service.DownLoadFileService" /> |
| | | |
| | | |
| | | |
| | | <meta-data |
| | | android:name="android.max_aspect" |
| | | android:value="2.5" /> |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="huawei"></meta-data> |
| | | android:value="QQ"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | android:name="com.bytedance.sdk.dp.act.DPProvider" |
| | | android:authorities="${applicationId}.BDDPProvider" |
| | | android:exported="false" /> |
| | | |
| | | |
| | | |
| | | |
| | | </application> |
| | |
| | | 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' |
| | | |
| | | configurations.all { |
| | | exclude group: "com.bytedance.boringssl.so", module: 'boringssl-so' |
| | | //若接入流媒体sdk(小视频、直播)需要force constraint-layout版本 |
| | | resolutionStrategy { |
| | | force 'com.android.support.constraint:constraint-layout:1.1.2' |
| | | } |
| | | } |
| | | |
| | | dependencies { |
| | | implementation project(':library-ViewPagerIndicator') |
| | | implementation 'androidx.appcompat:appcompat:1.0.0' |
| | |
| | | implementation files('libs/phoneNumber-L-AuthSDK-2.12.0.aar') |
| | | |
| | | //快手 |
| | | implementation files('libs/kssdk-all-3.3.23-publishRelease-b24448fc1.aar') |
| | | implementation files('libs/kssdk-ct-3.3.27.3-publishRelease-cd62cc584-fullAbi.aar') |
| | | |
| | | |
| | | implementation 'androidx.recyclerview:recyclerview:1.0.0' |
| | |
| | | implementation project(path: ':library-SocialSdk') |
| | | implementation project(path: ':library-APPUpdate') |
| | | implementation project(path: ':library-youth') |
| | | //穿山甲广告 |
| | | implementation files('libs/open_ad_sdk_4.0.0.6.aar') |
| | | |
| | | //阿里百川 |
| | | implementation files('libs/avmpaar3-5.4.36.aar') |
| | |
| | | |
| | | implementation 'com.qhutch.elevationimageview:elevationimageview:2.4' |
| | | |
| | | implementation ('com.pangle.cn:pangrowth-sdk:1.7.0.0'){ |
| | | //穿山甲 |
| | | implementation 'com.pangle.cn:ads-sdk-pro:4.2.0.2' |
| | | |
| | | |
| | | implementation('com.pangle.cn:pangrowth-sdk:1.8.0.0') { |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-dpsdk-live' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-game-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-sdk' |
| | | exclude group: 'com.squareup.okhttp3', module: 'okhttp' |
| | | |
| | | |
| | | |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-dpsdk' |
| | | } |
| | | 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') |
| | | |
| | | //indicator |
| | | implementation 'com.github.hackware1993:MagicIndicator:1.7.0' |
| | |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 128 |
| | | versionName "3.10.10" |
| | | versionCode 130 |
| | | versionName "3.10.12" |
| | | multiDexEnabled = true |
| | | minSdkVersion 17 |
| | | targetSdkVersion 29 |
| | | ndk { |
| | | //兼容64位与32位系统 |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a'//, 'x86', 'x86_64' |
| | | } |
| | | |
| | | manifestPlaceholders = [ |
| | |
| | | VIVO_APPKEY : "e9add1dfed7086061119d407857628ef", |
| | | VIVO_APPID : "100061268", |
| | | //vivo_config_end |
| | | |
| | | APPLOG_SCHEME : "rangersapplog.ffdaf9a8c6428599".toLowerCase() |
| | | ] |
| | | } |
| | | dexOptions { |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | <include layout="@layout/view_activity_top_navbar"></include> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_container" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></FrameLayout> |
| | | |
| | | </LinearLayout> |
| | |
| | | </androidx.viewpager.widget.ViewPager> |
| | | |
| | | <LinearLayout |
| | | android:visibility="gone" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_content_bg_color" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <com.lcjian.library.widget.RatioLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="10dp" |
| | | app:ratio="0.2620"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_short_video" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:src="@drawable/ic_search_short_video"></ImageView> |
| | | </com.lcjian.library.widget.RatioLayout> |
| | | |
| | | <com.lcjian.library.widget.MyGridView |
| | | android:id="@+id/gv_hot_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="10dp" |
| | | android:numColumns="1" |
| | | android:paddingTop="8dp" |
| | | android:layout_marginBottom="10dp" |
| | | android:paddingBottom="8dp" |
| | | android:stretchMode="columnWidth" |
| | | android:verticalSpacing="19dp"></com.lcjian.library.widget.MyGridView> |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/history_search" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/item_title_text_color" |
| | | android:textSize="16sp" /> |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_search_clear_his" |
| | |
| | | style="@style/settingsItemTitleStyle" |
| | | android:layout_alignParentStart="true" |
| | | android:layout_alignParentLeft="true" |
| | | |
| | | android:text="@string/clear_cache" /> |
| | | |
| | | <TextView |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全布丸</string> |
| | | <string name="recommend">刷视频</string> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="recommend">视频</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
| | | <string name="mine">我的</string> |
New file |
| | |
| | | package J; |
| | | |
| | | public class N { |
| | | public static final boolean TESTING_ENABLED = false; |
| | | public static final boolean REQUIRE_MOCK = false; |
| | | public static boolean a; |
| | | public static boolean b; |
| | | |
| | | public static final native void M7xB0tc0(String var0, long[] var1, int var2); |
| | | |
| | | public N() { |
| | | } |
| | | } |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.JsonObject; |
| | | import com.lcjian.library.DeviceUuidFactory; |
| | | import com.lcjian.library.okhttp.OkHttpUtils; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.SystemCommon; |
| | | import com.lcjian.library.util.common.PackageUtils2; |
| | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; |
| | | import com.baidu.mobads.AppActivity; |
| | | import com.bytedance.applog.AppLog; |
| | | import com.bytedance.applog.InitConfig; |
| | | import com.bytedance.applog.util.UriConstants; |
| | | import com.bytedance.novel.pangolin.NovelConfig; |
| | | import com.bytedance.novel.pangolin.NovelSDK; |
| | | import com.bytedance.novel.pangolin.PangolinDocker; |
| | |
| | | |
| | | //快手初始化 |
| | | public static void initKSSDK(Context appContext) { |
| | | if (!AdUtil.isCanInitCSJ()) { |
| | | return; |
| | | } |
| | | KsAdSDK.init(appContext, new SdkConfig.Builder() |
| | | .appId("801000001") // 测试aapId,请联系快⼿平台申请正式AppId,必填 |
| | | .appName(appContext.getString(R.string.app_name)) // 测试appName,请填写您应⽤的名称,⾮必填 |
| | |
| | | if (!AdUtil.isCanInitCSJ()) { |
| | | return; |
| | | } |
| | | |
| | | /* 初始化开始 */ |
| | | final InitConfig config = new InitConfig("5095354", ManifestDataUtil.getAppMetaData(application, "UMENG_CHANNEL")); // 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) |
| | | .preloadDraw(true) |
| | | .needInitAppLog(false) |
| | | .setIsAndroidx(true) |
| | | .initListener(new DPSdkConfig.InitListener() { |
| | |
| | | // .liveConfig(new DPSdkConfig.LiveConfig()) |
| | | |
| | | ;//若您需要接入直播,参考「直播接入文档」;否则可忽略此参数。 |
| | | DPSdk.init(application, "SDK_Setting_5095354.json", configBuilder.build()); |
| | | try { |
| | | DPSdk.init(application, "SDK_Setting_5095354.json", configBuilder.build()); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | import androidx.fragment.app.FragmentActivity; |
| | | |
| | | import com.umeng.analytics.MobclickAgent; |
| | |
| | | if (AdUtil.getAdType(getApplicationContext(), AdPositionEnum.splashHotStart) == null) { |
| | | KSConstant.PID_FEED = 8010000022L; |
| | | KSConstant.PID_FULL_VIDEO = 8010000015L; |
| | | KSConstant.PID_SHORT_VIDEO = 8010000036L; |
| | | //广告下载二次确认框 |
| | | } |
| | | |
| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.bytedance.sdk.openadsdk.TTFeedAd; |
| | |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.CSJConstant; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.weikou.beibeivideo.util.ui.IPageEventListener; |
| | | |
| | |
| | | .setSupportDeepLink(true) |
| | | .setImageAcceptedSize(width, height) |
| | | .setAdCount(1) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .build(); |
| | | |
| | | mTTAdNative.loadStream(adSlot, new TTAdNative.FeedAdListener() { |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.common; |
| | | |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.widget.TextView; |
| | | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | public class CommonFragmentActivity extends BaseActivity { |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.activity_common_fragment); |
| | | String title = getIntent().getStringExtra("title"); |
| | | String fragmentName = getIntent().getStringExtra("fragment"); |
| | | |
| | | |
| | | ((TextView) findViewById(R.id.tv_top_bar_middle)).setText(title); |
| | | findViewById(R.id.tv_top_bar_left).setOnClickListener( |
| | | new OnClickListener() { |
| | | @Override |
| | | public void onClick(View arg0) { |
| | | finish(); |
| | | } |
| | | }); |
| | | |
| | | Object fragment = null; |
| | | try { |
| | | fragment = Class.forName(fragmentName).newInstance(); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } catch (InstantiationException e) { |
| | | e.printStackTrace(); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_container, (Fragment) fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.ad.KSConstant; |
| | | import com.weikou.beibeivideo.util.video.DPEventCollectUtil; |
| | | import com.weikou.beibeivideo.util.video.DPHolder; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import java.util.Map; |
| | |
| | | } |
| | | |
| | | private void init() { |
| | | mIDPWidget = DPSdk.factory().createDraw(DPWidgetDrawParams.obtain().hideClose(true, null) |
| | | |
| | | mIDPWidget = DPHolder.getInstance().buildDrawWidget(DPWidgetDrawParams.obtain().hideClose(true, null) |
| | | .drawContentType(DPWidgetDrawParams.DRAW_CONTENT_TYPE_ALL) |
| | | .listener(new IDPNewsListener() { |
| | | @Override |
| | | public void onDPRefreshFinish() { |
| | |
| | | @Override |
| | | public Fragment getItem(int position) { |
| | | Log.i(TAG, "getItem:" + position); |
| | | if (getTypeCount() > 1) { |
| | | if (position == 0) { |
| | | return mDYVideoFragment; |
| | | } else { |
| | | return mKSVideoFragment; |
| | | } |
| | | |
| | | if (AdUtil.isCanInitCSJ()&& AdUtil.getAdType(getContext(), AdPositionEnum.splashHotStart) != null) { |
| | | return mDYVideoFragment; |
| | | } else { |
| | | return mKSVideoFragment; |
| | | } |
| | |
| | | |
| | | |
| | | private int getTypeCount() { |
| | | if (AdUtil.isCanInitCSJ()&& AdUtil.getAdType(getContext(), AdPositionEnum.splashHotStart) != null) { |
| | | return 2; |
| | | } else { |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.JsonUtil; |
| | | import com.weikou.beibeivideo.util.UmengEventUtil; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.cache.DiskLruCacheManager; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | |
| | | categories.addAll(list); |
| | | if (categories.size() > 0) { |
| | | HomeClass feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("feedVideos"); |
| | | feedVideos.setName("刷一刷"); |
| | | categories.add(1, feedVideos); |
| | | if(AdUtil.isCanInitCSJ()) { |
| | | HomeClass feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("shortVideos"); |
| | | feedVideos.setName("热门"); |
| | | categories.add(1, feedVideos); |
| | | } |
| | | } |
| | | |
| | | if (categories != null) |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsContentPage; |
| | | import com.kwad.sdk.api.KsHorizontalFeedPage; |
| | | import com.kwad.sdk.api.KsScene; |
| | | import com.kwad.sdk.api.KsTubePage; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.ad.KSConstant; |
| | | import com.weikou.beibeivideo.util.video.DPEventCollectUtil; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | /** |
| | | * 快手短剧 |
| | | */ |
| | | public class KSHorizontalFeedVideoFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "KSHFeedVideoFragment"; |
| | | private KsHorizontalFeedPage mKsHorizontalFeedPage; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | |
| | | |
| | | public KSHorizontalFeedVideoFragment() { |
| | | super(); |
| | | setName(KSHorizontalFeedVideoFragment.class.getName()); |
| | | } |
| | | |
| | | private Fragment fragment; |
| | | |
| | | |
| | | @Override |
| | | public int getContentResource() { |
| | | return R.layout.fragment_ks_video; |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | if (mKsHorizontalFeedPage != null && mKsHorizontalFeedPage.getFragment() != null) { |
| | | mKsHorizontalFeedPage.getFragment().onResume(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | if (mKsHorizontalFeedPage != null && mKsHorizontalFeedPage.getFragment() != null) { |
| | | mKsHorizontalFeedPage.getFragment().onPause(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void setUserVisibleHint(boolean isVisibleToUser) { |
| | | super.setUserVisibleHint(isVisibleToUser); |
| | | if (mKsHorizontalFeedPage != null && mKsHorizontalFeedPage.getFragment() != null) { |
| | | mKsHorizontalFeedPage.getFragment().setUserVisibleHint(isVisibleToUser); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onHiddenChanged(boolean hidden) { |
| | | super.onHiddenChanged(hidden); |
| | | if (mKsHorizontalFeedPage != null && mKsHorizontalFeedPage.getFragment() != null) { |
| | | mKsHorizontalFeedPage.getFragment().onHiddenChanged(hidden); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Log.i(TAG, "onCreate"); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | init(); |
| | | } |
| | | |
| | | public void init() { |
| | | if (mKsHorizontalFeedPage == null) { |
| | | preInit(); |
| | | } |
| | | if (mKsHorizontalFeedPage != null) { |
| | | this.fragment = mKsHorizontalFeedPage.getFragment(); |
| | | if (this.fragment != null) |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | |
| | | public void preInit() { |
| | | KsScene adScene = new KsScene.Builder(KSConstant.PID_SHORT_VIDEO).build(); |
| | | mKsHorizontalFeedPage = KsAdSDK.getLoadManager().loadHorizontalPlayFeedPage(adScene); |
| | | initListener(); |
| | | } |
| | | |
| | | |
| | | private void initListener() { |
| | | mKsHorizontalFeedPage.setVideoListener(new KsContentPage.VideoListener() { |
| | | @Override |
| | | public void onVideoPlayStart(KsContentPage.ContentItem item) { |
| | | Log.d(TAG, "onVideoPlayStart item=" + item); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayPaused(KsContentPage.ContentItem item) { |
| | | Log.d(TAG, "onVideoPlayPaused item=" + item); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayResume(KsContentPage.ContentItem item) { |
| | | Log.d(TAG, "onVideoPlayResume item=" + item); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayCompleted(KsContentPage.ContentItem item) { |
| | | Log.d(TAG, "onVideoPlayCompleted item=" + item); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayError(KsContentPage.ContentItem item, int what, int extra) { |
| | | Log.d(TAG, "onVideoPlayError item=" + item); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsContentPage; |
| | | import com.kwad.sdk.api.KsScene; |
| | | import com.kwad.sdk.api.KsTubePage; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.ad.KSConstant; |
| | | import com.weikou.beibeivideo.util.video.DPEventCollectUtil; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | /** |
| | | * 快手短剧 |
| | | */ |
| | | public class KSShortVideoFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "KSShortVideoFragment"; |
| | | private KsTubePage ksContentPage; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | |
| | | |
| | | public KSShortVideoFragment() { |
| | | super(); |
| | | setName(KSShortVideoFragment.class.getName()); |
| | | } |
| | | |
| | | private Fragment fragment; |
| | | |
| | | |
| | | @Override |
| | | public int getContentResource() { |
| | | return R.layout.fragment_ks_video; |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | if (ksContentPage != null && ksContentPage.getFragment() != null) { |
| | | ksContentPage.getFragment().onResume(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | if (ksContentPage != null && ksContentPage.getFragment() != null) { |
| | | ksContentPage.getFragment().onPause(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void setUserVisibleHint(boolean isVisibleToUser) { |
| | | super.setUserVisibleHint(isVisibleToUser); |
| | | if (ksContentPage != null && ksContentPage.getFragment() != null) { |
| | | ksContentPage.getFragment().setUserVisibleHint(isVisibleToUser); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onHiddenChanged(boolean hidden) { |
| | | super.onHiddenChanged(hidden); |
| | | if (ksContentPage != null && ksContentPage.getFragment() != null) { |
| | | ksContentPage.getFragment().onHiddenChanged(hidden); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Log.i(TAG, "onCreate"); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | init(); |
| | | } |
| | | |
| | | public void init() { |
| | | if (ksContentPage == null) { |
| | | preInit(); |
| | | } |
| | | if (ksContentPage != null) { |
| | | this.fragment = ksContentPage.getFragment(); |
| | | if (this.fragment != null) |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | |
| | | public void preInit() { |
| | | KsScene adScene = new KsScene.Builder(KSConstant.PID_SHORT_VIDEO).build(); |
| | | ksContentPage = KsAdSDK.getLoadManager().loadTubePage(adScene,false); |
| | | ksContentPage.setVideoListener(new KsContentPage.VideoListener() { |
| | | @Override |
| | | public void onVideoPlayStart(KsContentPage.ContentItem contentItem) { |
| | | Log.i(TAG, "onVideoPlayStart"); |
| | | DPEventCollectUtil.playDrawVideo(getContext(), null, "ks", "short_video", false); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayPaused(KsContentPage.ContentItem contentItem) { |
| | | Log.i(TAG, "onVideoPlayPaused"); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayResume(KsContentPage.ContentItem contentItem) { |
| | | Log.i(TAG, "onVideoPlayResume"); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayCompleted(KsContentPage.ContentItem contentItem) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPlayError(KsContentPage.ContentItem contentItem, int i, int i1) { |
| | | Log.i(TAG, "onVideoPlayError"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public void preInit() { |
| | | KsScene adScene = new KsScene.Builder(KSConstant.PID_FULL_VIDEO).build(); |
| | | if (KsAdSDK.getLoadManager() == null) { |
| | | return; |
| | | } |
| | | ksContentPage = KsAdSDK.getLoadManager().loadContentPage(adScene); |
| | | ksContentPage.setVideoListener(new KsContentPage.VideoListener() { |
| | | @Override |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.PackageInfo; |
| | | import android.content.pm.PackageManager.NameNotFoundException; |
| | | import android.os.Bundle; |
| | | import android.provider.Settings; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.GridView; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.novel.pangolin.NovelSDK; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.content.ConnectivityChangeHelper; |
| | | import com.lcjian.library.content.ConnectivityChangeHelper.OnConnectivityChangeListener; |
| | | import com.lcjian.library.util.cache.DiskLruCache; |
| | | import com.lcjian.library.util.common.StorageUtils; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.VideoType; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.ui.category.CategoryAdapter; |
| | | import com.weikou.beibeivideo.ui.recommend.SearchActivity; |
| | | import com.weikou.beibeivideo.util.video.DPEventCollectUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | import androidx.fragment.app.FragmentManager; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | | /** |
| | | * 小说 |
| | |
| | | import com.weikou.beibeivideo.entity.VideoDetailInfo; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.entity.VideoResource; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; |
| | | import com.weikou.beibeivideo.entity.video.FunshionPlayInfo; |
| | | import com.weikou.beibeivideo.ui.dialog.VideoResourceListDialog; |
| | |
| | | |
| | | // 加载播放页第一条广告,先设置加载上下文环境和条件 |
| | | private void loadAD1() { |
| | | |
| | | if (AdUtil.getAdType(getContext(), AdPositionEnum.splash) == null) { |
| | | return; |
| | | } |
| | | |
| | | new ExpressAdManager(AdUtil.AD_TYPE.gdt2, getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 500) |
| | | .setSupportDeepLink(true) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .setOrientation(TTAdConstant.VERTICAL)//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL |
| | | .build(); |
| | | mTTAdNative.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() { |
| | |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 500) |
| | | .setSupportDeepLink(true) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .setOrientation(TTAdConstant.VERTICAL)//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL |
| | | .build(); |
| | | mTTAdNative.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() { |
| | |
| | | import android.widget.Toast; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | | import com.bytedance.sdk.dp.DPUpdate; |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.nostra13.universalimageloader.core.ImageLoader; |
| | | import com.umeng.analytics.MobclickAgent; |
| | |
| | | private TextView tv_top_bar_middle; |
| | | private TextView tv_version_name;// 版本号 |
| | | |
| | | private CheckBox chb_only_wifi_download,chb_recommend_content,chb_recommend_ad; |
| | | private CheckBox chb_only_wifi_download, chb_recommend_content, chb_recommend_ad; |
| | | private RelativeLayout rl_clear_cache; |
| | | private RelativeLayout rl_about_us; |
| | | private RelativeLayout rl_check_update;// 检查更新 |
| | |
| | | settings.edit() |
| | | .putBoolean("recommend_content", isChecked) |
| | | .commit(); |
| | | |
| | | if (isChecked) { |
| | | KsAdSDK.setPersonalRecommend(true); |
| | | DPUpdate.setPersonalRec(true); |
| | | } else { |
| | | KsAdSDK.setPersonalRecommend(false); |
| | | DPUpdate.setPersonalRec(false); |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | settings.edit() |
| | | .putBoolean("recommend_ad", isChecked) |
| | | .commit(); |
| | | if (isChecked) { |
| | | KsAdSDK.setProgrammaticRecommend(true); |
| | | } else { |
| | | KsAdSDK.setProgrammaticRecommend(false); |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | import com.weikou.beibeivideo.entity.recommend.HomeClass; |
| | | import com.weikou.beibeivideo.ui.category.bean.HotStar; |
| | | import com.weikou.beibeivideo.ui.main.FeedVideoFragment; |
| | | import com.weikou.beibeivideo.ui.main.KSHorizontalFeedVideoFragment; |
| | | import com.weikou.beibeivideo.ui.main.KSShortVideoFragment; |
| | | import com.weikou.beibeivideo.ui.main.MainActivity; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | |
| | | bundle.putInt("position", Integer.parseInt(position)); |
| | | fragment.setArguments(bundle); |
| | | return fragment; |
| | | } else if ("feedVideos".equalsIgnoreCase(type.getDataType())) { |
| | | return new FeedVideoFragment(); |
| | | } else if ("shortVideos".equalsIgnoreCase(type.getDataType())) { |
| | | return new KSHorizontalFeedVideoFragment(); |
| | | } else { |
| | | CategoryRecommendFragment fragment = new CategoryRecommendFragment(); |
| | | Bundle bundle = new Bundle(); |
| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.common.CommonFragmentActivity; |
| | | import com.weikou.beibeivideo.ui.common.GridVideoAdapter1; |
| | | import com.weikou.beibeivideo.ui.main.MainActivity; |
| | | import com.weikou.beibeivideo.ui.video.SuggestKeysAdapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.R; |
| | |
| | | |
| | | private String value = ""; |
| | | |
| | | private boolean touchSearchInput = false; |
| | | private AQuery mAQuery; |
| | | |
| | | |
| | | private void initView() { |
| | |
| | | ll_search_history = findViewById(R.id.ll_search_history); |
| | | fl_suggest = findViewById(R.id.fl_suggest); |
| | | ll_search_rank = findViewById(R.id.ll_search_rank); |
| | | mAQuery = new AQuery(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return false; |
| | | } else { |
| | | if (!StringUtils.isEmpty(et_search_key.getEditableText() |
| | | +"")) { |
| | | + "")) { |
| | | jumpToSearch(et_search_key.getEditableText() |
| | | +""); |
| | | + ""); |
| | | } else { |
| | | jumpToSearch(et_search_key.getHint() + ""); |
| | | } |
| | |
| | | }); |
| | | |
| | | et_search_key.setHint(getIntent().getStringExtra("key")); |
| | | mAQuery.id(R.id.iv_short_video).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(SearchActivity.this, MainActivity.class).putExtra("position", 0+"").putExtra("cposition", 1+"")); |
| | | finish(); |
| | | } |
| | | }); |
| | | |
| | | getHotSearch(); |
| | | getHistorySearch(); |
| | |
| | | } else { |
| | | gv_hot_search.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | gv_hot_search.setAdapter(new HotSearchAdapter( |
| | | hotSearchs, true)); |
| | | } else { |
| | |
| | | layoutInflater = LayoutInflater.from(context); |
| | | } |
| | | |
| | | //最多8个 |
| | | @Override |
| | | public int getCount() { |
| | | return mList == null ? 0 : mList.size(); |
| | | return mList == null ? 0 : (mList.size()>8?8:mList.size()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (position % 2 == 0) { |
| | | viewHolder.tv_rank.setText((position / 2 + 1) + ""); |
| | | } else { |
| | | viewHolder.tv_rank.setText((mList.size() / 2 + (position + 1) / 2) + ""); |
| | | viewHolder.tv_rank.setText((getCount() / 2 + (position + 1) / 2) + ""); |
| | | } |
| | | viewHolder.tv_content.setText(mList.get(position)); |
| | | |
| | |
| | | |
| | | public class BeibeiConstant { |
| | | |
| | | |
| | | |
| | | public final static String ALIYUN_ONE_KEY_LOGIN_SECRETINFO = "+KTOnd6EET2Hn8A0Fv3tY8jkuz90mazidn+1D+PWV79klpi3J2HRZQwTdlPox3VxWjtq+Qyt11Z4ENqAtGMBmbvoFJw/nFeobrPhtjEHJO5I5s0gvp4+HTJbQBRfx7gDGEr72r84SAVn/mVStPhXMZh582JvbArtiPpV8Owl6R5kRuaJ7StEdmhZqsHwMs4Sr4gYeRy1MPw9milzO3Us4UA6Z0l/jlbUfDggDQaT9tE9d2DS/EG0M9DFU9Gjo3BJGTTlV0bQvV/iVl7RynqCY4ZU9x4ktUZm9jHG6Pfa24N2Z8naaFjTww=="; |
| | | |
| | | public final static boolean IS_TEST = false; |
| | |
| | | //无效广告 |
| | | public static String INVALID_AD = "111111111"; |
| | | |
| | | public static String PPTV_INTERSTITIALAD="946078773"; |
| | | public static String PPTV_INTERSTITIALAD = "946078773"; |
| | | |
| | | |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD="946608275"; |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD = "946608275"; |
| | | |
| | | |
| | | //首页插屏 |
| | | public static String HOME_INTERSTITIALAD="947410891"; |
| | | public static String HOME_INTERSTITIALAD = "947410891"; |
| | | |
| | | |
| | | //二次下载提示 |
| | | public static boolean CSJ_AD_DOWNLOAD_NOTIFY = false; |
| | | |
| | | |
| | | } |
| | |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdDislike; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(width, height) |
| | | .setAdCount(count) //请求广告数量为1到3条 |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .build(); |
| | | if (mTTAdNative == null) { |
| | | if (adLoadListener != null) |
| | |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialADListener; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialMediaListener; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | |
| | | public class FullVideoAdManager { |
| | |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(w, h) |
| | | .setOrientation(TTAdConstant.VERTICAL) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .build(); |
| | | TTAdManager ttAdManager = null; |
| | | try { |
| | |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 300) |
| | | .setSupportDeepLink(true) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .setOrientation(TTAdConstant.VERTICAL)//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL |
| | | .build(); |
| | | |
| | |
| | | |
| | | public class KSConstant { |
| | | |
| | | public static long PID_SHORT_VIDEO = 8010000029L;//8010000029L; |
| | | public static long PID_FULL_VIDEO = 8010000001L; |
| | | public static long PID_FEED = 8010000008L; |
| | | |
| | |
| | | .setSupportDeepLink(true) |
| | | .setUserID(UTDevice.getUtdid(mContext)) |
| | | .setExpressViewAcceptedSize(width, height) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .setOrientation(hrizontal ? TTAdConstant.HORIZONTAL : TTAdConstant.VERTICAL) |
| | | .build(); |
| | | if (mTTAdNative == null) { |
| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | |
| | | .setCodeId(code) |
| | | .setSupportDeepLink(true) |
| | | .setImageAcceptedSize(width, height) |
| | | .setDownloadType(CSJConstant.CSJ_AD_DOWNLOAD_NOTIFY? TTAdConstant.DOWNLOAD_TYPE_POPUP :TTAdConstant.DOWNLOAD_TYPE_NO_POPUP) |
| | | .build(); |
| | | mTTAdNative.loadSplashAd(adSlot, new TTAdNative.SplashAdListener() { |
| | | |
New file |
| | |
| | | package com.weikou.beibeivideo.util.video; |
| | | |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPWidgetBannerParams; |
| | | import com.bytedance.sdk.dp.DPWidgetBubbleParams; |
| | | import com.bytedance.sdk.dp.DPWidgetDrawParams; |
| | | import com.bytedance.sdk.dp.DPWidgetGridParams; |
| | | import com.bytedance.sdk.dp.DPWidgetInnerPushParams; |
| | | import com.bytedance.sdk.dp.DPWidgetNewsParams; |
| | | import com.bytedance.sdk.dp.DPWidgetTextChainParams; |
| | | import com.bytedance.sdk.dp.DPWidgetVideoCardParams; |
| | | import com.bytedance.sdk.dp.DPWidgetVideoSingleCardParams; |
| | | import com.bytedance.sdk.dp.IDPNativeData; |
| | | import com.bytedance.sdk.dp.IDPWidget; |
| | | import com.bytedance.sdk.dp.IDPWidgetFactory; |
| | | |
| | | import org.json.JSONObject; |
| | | |
| | | /** |
| | | * Create by hanweiwei on 2020-03-26. |
| | | */ |
| | | public final class DPHolder { |
| | | private static volatile DPHolder sInstance; |
| | | |
| | | public static DPHolder getInstance() { |
| | | if (sInstance == null) { |
| | | synchronized (DPHolder.class) { |
| | | if (sInstance == null) { |
| | | sInstance = new DPHolder(); |
| | | } |
| | | } |
| | | } |
| | | return sInstance; |
| | | } |
| | | |
| | | private DPHolder() { |
| | | } |
| | | |
| | | |
| | | public IDPWidget buildDrawWidget(DPWidgetDrawParams params) { |
| | | //创建draw视频流组件 |
| | | return getFactory().createDraw(params); |
| | | } |
| | | |
| | | public IDPWidget buildGridWidget(DPWidgetGridParams params) { |
| | | //创建宫格组件 |
| | | return getFactory().createGrid(params); |
| | | } |
| | | |
| | | public IDPWidget buildDoubleFeedWidget(DPWidgetGridParams params) { |
| | | //创建双Feed组件 |
| | | return getFactory().createDoubleFeed(params); |
| | | } |
| | | |
| | | public IDPWidget buildNewsTabsWidget(DPWidgetNewsParams params) { |
| | | //创建多频道新闻组件 |
| | | return getFactory().createNewsTabs(params); |
| | | } |
| | | |
| | | public IDPWidget buildNewsOneTabWidget(DPWidgetNewsParams params) { |
| | | //创建单列表新闻组件 |
| | | return getFactory().createNewsOneTab(params); |
| | | } |
| | | |
| | | public void loadVideoCard(DPWidgetVideoCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadVideoCard(params, callback); |
| | | } |
| | | |
| | | public void loadSmallVideoCard(DPWidgetVideoCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadSmallVideoCard(params, callback); |
| | | } |
| | | |
| | | public void loadVideoSingleCard(DPWidgetVideoSingleCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadVideoSingleCard(params, callback); |
| | | } |
| | | |
| | | public void loadTextChain(DPWidgetTextChainParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadTextChain(params, callback); |
| | | } |
| | | public void loadCustomVideoCard(DPWidgetVideoCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadCustomVideoCard(params, callback); |
| | | } |
| | | public void loadBubble(DPWidgetBubbleParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadBubble(params, callback); |
| | | } |
| | | public void loadBanner(DPWidgetBannerParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadBanner(params, callback); |
| | | } |
| | | public void loadInnerPush(DPWidgetInnerPushParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadInnerPush(params, callback); |
| | | } |
| | | |
| | | public void loadVideoSingleCard4News(DPWidgetVideoSingleCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadVideoSingleCard4News(params, callback); |
| | | } |
| | | |
| | | public void loadNativeNews(DPWidgetNewsParams params, IDPNativeData.DPNativeDataListener listener) { |
| | | getFactory().loadNativeNews(params, listener); |
| | | } |
| | | |
| | | public void enterNewsDetail(DPWidgetNewsParams params, long groupId, String data) { |
| | | getFactory().enterNewsDetail(params, groupId, data); |
| | | } |
| | | |
| | | public void loadPush(DPWidgetNewsParams params) { |
| | | getFactory().pushNews(params); |
| | | } |
| | | |
| | | public void uploadLog(String category, String event, JSONObject json) { |
| | | getFactory().uploadLog(category, event, json); |
| | | } |
| | | |
| | | public void notifyUserInfo() { |
| | | //接入红包功能的开发者,在用户登录成功后需要刷新用户信息 |
| | | // long uid = LoginActivity.getUserId(); |
| | | // if (uid == 0) { |
| | | // return; |
| | | // } |
| | | // getFactory().notifyUserInfo(new DPUser() |
| | | // .setUserId(uid)//必须透传用户uid |
| | | // .setName("test_name")//用户昵称,可选 |
| | | // .setAvatarUrl("xxx")//用户图像,可选 |
| | | // ); |
| | | } |
| | | |
| | | private IDPWidgetFactory getFactory() { |
| | | //一定要初始化后才能调用,否则会发生异常问题 |
| | | return DPSdk.factory(); |
| | | } |
| | | |
| | | } |
| | |
| | | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| | | buildscript { |
| | | repositories { |
| | | |
| | | //字节跳动SDK |
| | | maven { url "https://artifact-maven.byted.org/repository/Volcengine/" } |
| | | maven { |
| | | url "https://artifact.bytedance.com/repository/Volcengine/" |
| | | } |
| | | maven { |
| | | url "https://artifact.bytedance.com/repository/pangle/" |
| | | } |
| | | maven { url 'http://maven.byted.org/repository/android_public/' } |
| | | maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" } |
| | | |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | |
| | | maven{url 'https://artifact.bytedance.com/repository/Volcengine/'} |
| | | |
| | | maven { url 'https://repo1.maven.org/maven2/' } |
| | | |
| | |
| | | } |
| | | maven { url 'http://developer.huawei.com/repo/' } |
| | | |
| | | maven { url 'https://artifact.bytedance.com/repository/pangle'} |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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" |
| | | } |
| | | } |
| | | |
| | | allprojects { |
| | | repositories { |
| | | |
| | | |
| | | //字节跳动SDK |
| | | maven { url "https://artifact-maven.byted.org/repository/Volcengine/" } |
| | | maven { |
| | | url "https://artifact.bytedance.com/repository/Volcengine/" |
| | | } |
| | | maven { |
| | | url "https://artifact.bytedance.com/repository/pangle/" |
| | | } |
| | | maven { url 'http://maven.byted.org/repository/android_public/' } |
| | | maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" } |
| | | |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | |
| | | maven{url 'https://artifact.bytedance.com/repository/Volcengine/'} |
| | | |
| | | maven { url 'https://repo1.maven.org/maven2/' } |
| | | |
| | |
| | | // maven { url 'https://dl.bintray.com/umsdk/release' } |
| | | // maven { url "https://dl.bintray.com/thelasterstar/maven/" } |
| | | maven { url 'http://developer.huawei.com/repo/' } |
| | | maven { url 'https://artifact.bytedance.com/repository/pangle'} |
| | | |
| | | |
| | | } |
| | | } |