| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="baidu"></meta-data> |
| | | android:value="QQ"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | android:exported="true" |
| | | android:label="@string/app_name" |
| | | android:launchMode="singleTop" |
| | | android:taskAffinity="" |
| | | android:theme="@android:style/Theme.Translucent.NoTitleBar" /> |
| | | |
| | | <!-- QQ分享 --> |
| | |
| | | android:name="XIAOMI_APPKEY" |
| | | android:value="${XIAOMI_APPKEY}"></meta-data> |
| | | |
| | | <receiver |
| | | android:name=".receiver.XMPushMessageReceiver" |
| | | android:exported="true"> |
| | | <intent-filter> |
| | | <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" /> |
| | | </intent-filter> |
| | | <intent-filter> |
| | | <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" /> |
| | | </intent-filter> |
| | | <intent-filter> |
| | | <action android:name="com.xiaomi.mipush.ERROR" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <!-- <receiver--> |
| | | <!-- android:name=".receiver.XMPushMessageReceiver"--> |
| | | <!-- android:exported="true">--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.xiaomi.mipush.ERROR" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- </receiver>--> |
| | | |
| | | <!--OPPO --> |
| | | <meta-data |
| | |
| | | "interstitial_note_ad_code_id": "947236267", |
| | | "staggered_grid_ad_code_id": "947236244", |
| | | "staggered_grid_draw_ad_code_id": "947236250", |
| | | "staggered_grid_draw_native_ad_code_id": "947236251" |
| | | "staggered_grid_draw_native_ad_code_id": "947236251", |
| | | "draw_interstitial_ad_code_id": "947590715", |
| | | "draw_fullscreen_interstitial_ad_code_id": "947590712", |
| | | "draw_banner_code_id": "947590714", |
| | | "drama_rewarded_ad_code_id": "952314219", |
| | | "drama_rewarded_ad_code_id_02": "952314221", |
| | | "drama_draw_ad_code_id": "952314220" |
| | | }, |
| | | "novel": { |
| | | "status": 1, |
| | |
| | | "interstitial_code_id": "947236540", |
| | | "banner_ad_code_id": "947236558", |
| | | "end_ad_code_id": "947236544" |
| | | } |
| | | }, |
| | | "live": null |
| | | } |
| | |
| | | implementation files('libs/nb_trade-4.0.0.27.aar') |
| | | |
| | | |
| | | |
| | | implementation 'androidx.cardview:cardview:1.0.0' |
| | | |
| | | // //视频播放器 |
| | |
| | | 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:+' |
| | | |
| | | //加载动画库 |
| | | implementation 'com.github.ybq:Android-SpinKit:1.4.0' |
| | |
| | | implementation 'com.qhutch.elevationimageview:elevationimageview:2.4' |
| | | |
| | | //穿山甲 |
| | | implementation 'com.pangle.cn:ads-sdk-pro:4.9.0.8' |
| | | |
| | | |
| | | implementation('com.pangle.cn:pangrowth-sdk:3.1.0.1') { |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-dpsdk-live' |
| | | //为保证兼容性 建议使用广告SDK版本 |
| | | implementation "com.pangle.cn:mediation-sdk:5.6.1.6" |
| | | 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.squareup.okhttp3', module: 'okhttp' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-reward-sdk' |
| | | // exclude group: 'com.pangle.cn', module: 'pangrowth-dpsdk' |
| | | exclude group: 'com.pangle.cn', module: 'partner-live-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'partner-luckycat-api-sdk' |
| | | exclude group: 'com.pangle.cn', module: 'pangrowth-luckycat-api' |
| | | } |
| | | implementation('com.bytedance.applog:RangersAppLog-Lite-cn:6.6.2') |
| | | // 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') |
| | | |
| | |
| | | disable 'MissingTranslation' |
| | | } |
| | | |
| | | sourceSets { |
| | | main { |
| | | java { |
| | | exclude '**/XMPushMessageReceiver.java' |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 138 |
| | | versionName "3.10.20" |
| | | versionCode 142 |
| | | versionName "3.10.24" |
| | | multiDexEnabled = true |
| | | minSdkVersion 17 |
| | | targetSdkVersion 29 |
| | | ndk { |
| | | //兼容64位与32位系统 |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a'//, 'x86', 'x86_64' |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a'// |
| | | // abiFilters 'arm64-v8a' |
| | | } |
| | | |
| | | manifestPlaceholders = [ |
| | |
| | | //删除注释,防止注释里面的中文乱码导致更改后的内容系统无法正常解析 |
| | | manifestContent = manifestContent.replaceAll("<!--[\\s\\S]*?-->", "") |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.CAMERA" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.CAMERA"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.BLUETOOTH" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REORDER_TASKS" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.BLUETOOTH"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REORDER_TASKS"/>', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.VIBRATE"/>', '') |
| | | |
| | | println "AndroidManifest-Content:" |
| | | |
| | | println "AndroidManifest-Content:--------------------------------------" |
| | | println manifestContent |
| | | file(manifestPath).write(manifestContent) |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <item android:drawable="@drawable/ic_short_tv_highlight" android:state_checked="true"></item> |
| | | <item android:drawable="@drawable/ic_short_tv" android:state_checked="false"></item> |
| | | |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android" > |
| | | <solid android:color="@android:color/white" /> |
| | | |
| | | <item name="android:shadowDx">0</item> |
| | | <item name="android:shadowDy">1</item> |
| | | <item name="android:shadowColor">#40000000</item> |
| | | <corners android:radius="14dp" /> |
| | | |
| | | <padding |
| | | android:bottom="6dp" |
| | | android:left="6dp" |
| | | android:right="6dp" |
| | | android:top="6dp"></padding> |
| | | |
| | | |
| | | |
| | | |
| | | </shape> |
| | |
| | | <TextView |
| | | android:id="@+id/tv_nickName" |
| | | style="@style/personInfoItemContentStyle" |
| | | android:text="编辑昵称" /> |
| | | android:drawableRight="@null" |
| | | android:text="" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:visibility="gone" |
| | | android:id="@+id/ll_autograph" |
| | | style="@style/personInfoItemStyle" |
| | | android:layout_marginTop="10dp"> |
| | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:visibility="gone" |
| | | android:id="@+id/ll_authority_notify" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="85dp" |
| | | android:layout_marginLeft="12dp" |
| | | android:layout_marginTop="56dp" |
| | | android:layout_marginRight="12dp" |
| | | android:background="@drawable/shape_splash_authority_notify_bg" |
| | | android:orientation="vertical" |
| | | android:padding="16dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="手机权限使用说明" |
| | | android:textColor="#ff000000" |
| | | android:textSize="15sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="16dp" |
| | | android:text="校验手机识别码,防止账号被盗" |
| | | android:textColor="#ff000000" |
| | | android:textSize="13sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_splash_ad" |
| | |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | |
| | | android:textColor="@color/selector_bottom_bar_text" |
| | | android:textSize="10sp" /> |
| | | |
| | | <LinearLayout |
| | | android:visibility="gone" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:orientation="vertical" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_nav_cartoon" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:button="@null" |
| | | android:drawableTop="@drawable/ic_cartoon" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center_horizontal" |
| | | android:text="动漫" |
| | | android:textAppearance="?android:attr/textAppearanceSmall" |
| | | android:textColor="@color/main_menu_text_color" |
| | | android:textSize="10sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/rb_nav_short_tv" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:button="@null" |
| | | android:drawableTop="@drawable/selector_short_tv" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center_horizontal" |
| | | android:text="短剧" |
| | | android:textAppearance="?android:attr/textAppearanceSmall" |
| | | android:textColor="@color/selector_bottom_bar_text" |
| | | android:textSize="10sp" /> |
| | | |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/rb_nav_mine" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerInParent="true" |
| | | android:ellipsize="end" |
| | | android:maxLength="6" |
| | | android:maxLength="10" |
| | | android:singleLine="true" |
| | | android:textColor="@color/page_title_text_color" |
| | | android:textSize="18sp" /> |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="app_name">影视大全布丸</string> |
| | | <string name="recommend">视频</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
| | |
| | | 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; |
| | | import com.bytedance.novel.pangolin.data.INovelInitListener; |
| | | import com.bytedance.novel.pangolin.data.NormalFontType; |
| | | import com.bytedance.novel.pangolin.data.ReaderFontType; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPSdkConfig; |
| | | import com.bytedance.sdk.dp.IDPPrivacyController; |
| | |
| | | |
| | | initWX(application); |
| | | initX5(application); |
| | | initNovel(application); |
| | | } |
| | | |
| | | private static String getProcessName(Context context) { |
| | |
| | | * 穿山甲广告初始化 |
| | | */ |
| | | private static void initCSJAd(Application context, InitListener initListener) { |
| | | TTAdManagerHolder.init(context, new TTAdSdk.InitCallback() { |
| | | TTAdManagerHolder.init(context, new TTAdSdk.Callback() { |
| | | @Override |
| | | public void success() { |
| | | if (initListener != null) |
| | |
| | | })// 是否开启sdk 调试⽇志 可选 |
| | | .build()); |
| | | } |
| | | |
| | | private static void initNovel(Application application) { |
| | | if (!AdUtil.isCanInitCSJ()) { |
| | | return; |
| | | } |
| | | |
| | | NovelConfig config = new NovelConfig.Builder() |
| | | .appName(application.getString(R.string.app_name)) //接入小说SDK的App的英文名 必填 |
| | | .appVersionName(PackageUtils2.getVersionName(application)) //接入小说SDKApp的版本名称 必填 |
| | | .appVersionCode(PackageUtils2.getVersionCode(application)) //接入小说SDK App的版本号 必填 |
| | | .channel(ManifestDataUtil.getAppMetaData(application, "UMENG_CHANNEL")) //渠道号维度。开发者自定义字符串即可(建议不要包含test)。选填 |
| | | .initInnerApplog(true) // 是否使用小说sdk来初始化applog sdk。默认为false,需要开发者在App中单独初始化applog sdk,且必须在小说sdk之前初始化。 |
| | | .initInnerOpenAdSdk(true) //是否使用小说sdk来初始化广告sdk,如果为true,需要设置siteId。默认为false,需开发者在App中单独初始化广告sdk并在小说sdk之前初始化。 |
| | | .jsonFileName("SDK_Setting_5095354.json")//json配置文件的名称 必填 |
| | | .normalFontSize(NormalFontType.NORMAL) //全局字号大小 可选 |
| | | .readerFontSize(ReaderFontType.TWO) //阅读器字号大小 可选 |
| | | .initListener(new INovelInitListener() { |
| | | @Override |
| | | public void onInitComplete(boolean b) { |
| | | |
| | | } |
| | | }) |
| | | .build(); |
| | | NovelSDK.INSTANCE.attach(new PangolinDocker(config), application); |
| | | } |
| | | |
| | | private static boolean dpSDKIninted; |
| | | |
| | | public static void initDPSDK(Application application) { |
| | |
| | | if (!dpSDKIninted) { |
| | | DPSdkConfig.Builder configBuilder = new DPSdkConfig.Builder() |
| | | .debug(false) |
| | | .needInitAppLog(false) |
| | | .privacyController(new IDPPrivacyController() { |
| | | @Override |
| | | public boolean isCanUsePhoneState() { |
| | |
| | | public String getAndroidId() { |
| | | return super.getAndroidId(); |
| | | } |
| | | }) |
| | | .initListener(new DPSdkConfig.InitListener() { |
| | | @Override |
| | | public void onInitComplete(boolean b, String s) { |
| | | dpSDKIninted = b; |
| | | } |
| | | }) //接入了红包功能需要传入的参数,没有接入的话可以忽略该配置 |
| | | }); |
| | | // .initListener(new DPSdkConfig.InitListener() { |
| | | // @Override |
| | | // public void onInitComplete(boolean b, String s) { |
| | | // dpSDKIninted = b; |
| | | // } |
| | | // }) //接入了红包功能需要传入的参数,没有接入的话可以忽略该配置 |
| | | // .luckConfig(new DPSdkConfig.LuckConfig().application(application).enableLuck(false)) |
| | | // .liveConfig(new DPSdkConfig.LiveConfig()) |
| | | |
| | | ;//若您需要接入直播,参考「直播接入文档」;否则可忽略此参数。 |
| | | //若您需要接入直播,参考「直播接入文档」;否则可忽略此参数。 |
| | | 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); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.ui.SplashActivity; |
| | | import com.xiaomi.mipush.sdk.ErrorCode; |
| | | import com.xiaomi.mipush.sdk.MiPushClient; |
| | | import com.xiaomi.mipush.sdk.MiPushCommandMessage; |
| | | import com.xiaomi.mipush.sdk.MiPushMessage; |
| | | import com.xiaomi.mipush.sdk.PushMessageReceiver; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | |
| | | import com.vivo.push.model.UnvarnishedMessage; |
| | | import com.vivo.push.sdk.OpenClientPushMessageReceiver; |
| | | import com.weikou.beibeivideo.ui.SplashActivity; |
| | | import com.xiaomi.mipush.sdk.ErrorCode; |
| | | import com.xiaomi.mipush.sdk.MiPushClient; |
| | | import com.xiaomi.mipush.sdk.MiPushCommandMessage; |
| | | import com.xiaomi.mipush.sdk.MiPushMessage; |
| | | import com.xiaomi.mipush.sdk.PushMessageReceiver; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class VIVOPushMessageReceiver extends OpenClientPushMessageReceiver { |
| | | public static MiPushMessage miPushMessage = null; |
| | | |
| | | @Override |
| | | public void onReceiveRegId(Context context, String regId) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.ScreenUtils; |
| | | import com.lcjian.library.util.common.BitmapUtils; |
| | | import com.lcjian.library.util.common.DrawableUtils; |
| | |
| | | setContentView(R.layout.activity_splash); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | |
| | | if(ConfigUtil.isAiDaoMode(this)){ |
| | | if (ConfigUtil.isAiDaoMode(this)) { |
| | | AiDaoUtil.setAiDaoMode(this); |
| | | } |
| | | |
| | |
| | | iv_bg.setImageBitmap(bitmap1); |
| | | } |
| | | |
| | | private void init(){ |
| | | private void init() { |
| | | SharedPreferences preferences = getSharedPreferences("link_page", |
| | | Context.MODE_PRIVATE); |
| | | isInput = preferences.getBoolean("isInput", false); |
| | |
| | | vg_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | init(); |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mGMAdSplashManager != null) { |
| | | // mGMAdSplashManager.destroy(); |
| | | // mGMAdSplashManager.destroy(); |
| | | } |
| | | } |
| | | |
| | |
| | | if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PERMISSION_GRANTED) { |
| | | SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE); |
| | | //是否需要再次请求权限 |
| | | if (sharedPreferences.getBoolean("show", true)) |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | else { |
| | | if (sharedPreferences.getBoolean("show", true)) { |
| | | String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"); |
| | | if ("huawei".equalsIgnoreCase(channel)) { |
| | | next(); |
| | | } else { |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | iv_bg.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | findViewById(R.id.ll_authority_notify).setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | next(); |
| | | } |
| | | } else { |
| | |
| | | private void next() { |
| | | //百度内容联盟 |
| | | // MobadsPermissionSettings.setPermissionReadDeviceID(true); |
| | | iv_bg.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | findViewById(R.id.ll_authority_notify).setVisibility(View.GONE); |
| | | } |
| | | }); |
| | | |
| | | if (!BeibeiVideoApplication.IsInited()) { |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application, new BeibeiVideoApplication.InitListener() { |
| | | @Override |
| | |
| | | |
| | | // 设置哀悼模式 |
| | | ConfigUtil.saveAiDaoMode(getApplicationContext(), data.optBoolean("aiDaoMode")); |
| | | |
| | | |
| | | |
| | | |
| | | //保存免广告权益持续时间 |
| | |
| | | if (requestCode == REQUEST_CODE) { |
| | | for (int i = 0; i < permissions.length; i++) { |
| | | if (grantResults[i] == PERMISSION_GRANTED) {//选择了“始终允许” |
| | | |
| | | init(); |
| | | } else { |
| | | //拒绝了授权 |
| | |
| | | tv_skip.postDelayed(playErrorRunnable, 10000); |
| | | |
| | | // 如果是视频广告,可以调用preloadVideo预加载视频素材 |
| | | ad.preloadVideo(new VideoPreloadListener() { |
| | | //展示广告 |
| | | VideoOption videoOption = getVideoOption(); |
| | | ad.bindMediaView(mediaView, videoOption, new NativeADMediaListener() { |
| | | @Override |
| | | public void onVideoCached() { |
| | | Log.d(TAG, "onVideoCached"); |
| | | //展示广告 |
| | | VideoOption videoOption = getVideoOption(); |
| | | ad.bindMediaView(mediaView, videoOption, new NativeADMediaListener() { |
| | | @Override |
| | | public void onVideoInit() { |
| | | Log.d(TAG, "onVideoInit: "); |
| | | public void onVideoInit() { |
| | | Log.d(TAG, "onVideoInit: "); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public void onVideoLoading() { |
| | | Log.d(TAG, "onVideoLoading: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoLoading() { |
| | | Log.d(TAG, "onVideoLoading: "); |
| | | } |
| | | @Override |
| | | public void onVideoReady() { |
| | | Log.d(TAG, "onVideoReady"); |
| | | img_poster.setVisibility(View.GONE); |
| | | pb_progress.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoReady() { |
| | | Log.d(TAG, "onVideoReady"); |
| | | img_poster.setVisibility(View.GONE); |
| | | pb_progress.setVisibility(View.GONE); |
| | | } |
| | | @Override |
| | | public void onVideoLoaded(int videoDuration) { |
| | | Log.d(TAG, "onVideoLoaded: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoLoaded(int videoDuration) { |
| | | Log.d(TAG, "onVideoLoaded: "); |
| | | } |
| | | @Override |
| | | public void onVideoStart() { |
| | | Log.d(TAG, "onVideoStart"); |
| | | if (ad.getVideoDuration() / 1000 > AD_DURATION) |
| | | remainTime = AD_DURATION; |
| | | else |
| | | remainTime = ad.getVideoDuration() / 1000; |
| | | |
| | | @Override |
| | | public void onVideoStart() { |
| | | Log.d(TAG, "onVideoStart"); |
| | | if (ad.getVideoDuration() / 1000 > AD_DURATION) |
| | | remainTime = AD_DURATION; |
| | | else |
| | | remainTime = ad.getVideoDuration() / 1000; |
| | | |
| | | videoAdListener.startPlay(); |
| | | autoTimer(img_poster); |
| | | videoAdListener.startPlay(); |
| | | autoTimer(img_poster); |
| | | // img_poster.post(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | |
| | | // } |
| | | // }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPause() { |
| | | Log.d(TAG, "onVideoPause: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoResume() { |
| | | Log.d(TAG, "onVideoResume: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoCompleted() { |
| | | Log.d(TAG, "onVideoCompleted: "); |
| | | ll_skip.setVisibility(View.GONE); |
| | | if (videoAdListener != null) { |
| | | videoAdListener.finishPlay(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError(AdError error) { |
| | | Log.d(TAG, "onVideoError: "); |
| | | if (videoAdListener != null) { |
| | | videoAdListener.finishPlay(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoStop() { |
| | | Log.d(TAG, "onVideoStop"); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoClicked() { |
| | | Log.d(TAG, "onVideoClicked"); |
| | | } |
| | | }); |
| | | ad.setNativeAdEventListener(new NativeADEventListener() { |
| | | @Override |
| | | public void onADExposed() { |
| | | Log.d(TAG, "onADExposed"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked() { |
| | | Log.d(TAG, "onADClicked"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADError(AdError adError) { |
| | | Log.d(TAG, "onADError"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADStatusChanged() { |
| | | Log.d(TAG, "onADStatusChanged"); |
| | | } |
| | | }); |
| | | ad.startVideo(); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoCacheFailed(int errorNo, String msg) { |
| | | Log.d(TAG, "onVideoCacheFailed:" + msg); |
| | | public void onVideoPause() { |
| | | Log.d(TAG, "onVideoPause: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoResume() { |
| | | Log.d(TAG, "onVideoResume: "); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoCompleted() { |
| | | Log.d(TAG, "onVideoCompleted: "); |
| | | ll_skip.setVisibility(View.GONE); |
| | | if (videoAdListener != null) { |
| | | videoAdListener.finishPlay(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError(AdError error) { |
| | | Log.d(TAG, "onVideoError: "); |
| | | if (videoAdListener != null) { |
| | | videoAdListener.finishPlay(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoStop() { |
| | | Log.d(TAG, "onVideoStop"); |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoClicked() { |
| | | Log.d(TAG, "onVideoClicked"); |
| | | } |
| | | }); |
| | | ad.setNativeAdEventListener(new NativeADEventListener() { |
| | | @Override |
| | | public void onADExposed() { |
| | | Log.d(TAG, "onADExposed"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked() { |
| | | Log.d(TAG, "onADClicked"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADError(AdError adError) { |
| | | Log.d(TAG, "onADError"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADStatusChanged() { |
| | | Log.d(TAG, "onADStatusChanged"); |
| | | } |
| | | }); |
| | | ad.startVideo(); |
| | | |
| | | } else { |
| | | pb_progress.setVisibility(View.GONE); |
| | | if (videoAdListener != null) { |
| | |
| | | } |
| | | break; |
| | | case R.id.ll_nickName: |
| | | getNickName(); |
| | | // getNickName(); |
| | | break; |
| | | case R.id.ll_birthday: |
| | | getDate(); |
| | |
| | | getSex(); |
| | | break; |
| | | case R.id.ll_autograph://个性签名 |
| | | getAutograph(); |
| | | // getAutograph(); |
| | | break; |
| | | |
| | | case R.id.tv_bind_qq: |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.content.Context; |
| | | import android.os.Bundle; |
| | | 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.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 java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.fragment.app.FragmentManager; |
| | | |
| | | /** |
| | | * 主页面--抖音短剧 |
| | | */ |
| | | public class DYDramaVideoFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "DYDramaVideoFragment"; |
| | | private IDPWidget mIDPWidget; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | private FragmentManager fragmentManager; |
| | | |
| | | |
| | | public DYDramaVideoFragment() { |
| | | super(); |
| | | setName(DYDramaVideoFragment.class.getName()); |
| | | } |
| | | |
| | | public DYDramaVideoFragment(FragmentManager fragmentManager) { |
| | | super(); |
| | | setName(DYDramaVideoFragment.class.getName()); |
| | | this.fragmentManager = fragmentManager; |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Log.i(TAG, "onCreate"); |
| | | } |
| | | |
| | | @Override |
| | | public int getContentResource() { |
| | | return R.layout.fragment_ks_video; |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | Log.i(TAG, "onResume"); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onResume(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | Log.i(TAG, "onPause"); |
| | | super.onPause(); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onPause(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void setUserVisibleHint(boolean isVisibleToUser) { |
| | | Log.i(TAG, "setUserVisibleHint:" + isVisibleToUser); |
| | | super.setUserVisibleHint(isVisibleToUser); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().setUserVisibleHint(isVisibleToUser); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onHiddenChanged(boolean hidden) { |
| | | Log.i(TAG, "onHiddenChanged:" + hidden); |
| | | super.onHiddenChanged(hidden); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onHiddenChanged(hidden); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | 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(); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPRequestStart(@Nullable Map<String, Object> map) { |
| | | super.onDPRequestStart(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 boolean isNeedBlock(DPDrama dpDrama, int i, @Nullable Map<String, Object> map) { |
| | | return super.isNeedBlock(dpDrama, i, map); |
| | | } |
| | | }) |
| | | ); |
| | | |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | | fragmentManager = null; |
| | | if (fragmentManager != null) { |
| | | fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } else { |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | private static void log(String msg) { |
| | | Log.d(TAG, String.valueOf(msg)); |
| | | } |
| | | |
| | | @Override |
| | | public void onDetach() { |
| | | super.onDetach(); |
| | | Log.i(TAG, "onDetach"); |
| | | } |
| | | |
| | | @Override |
| | | public void onAttach(@NonNull Context context) { |
| | | super.onAttach(context); |
| | | Log.i(TAG, "onAttach"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mIDPWidget != null) { |
| | | mIDPWidget.destroy(); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private void init() { |
| | | try { |
| | | mIDPWidget = DPHolder.getInstance().buildDrawWidget(DPWidgetDrawParams.obtain().hideClose(true, null) |
| | | .drawContentType(DPWidgetDrawParams.DRAW_CHANNEL_TYPE_RECOMMEND) |
| | | .listener(new IDPNewsListener() { |
| | | @Override |
| | | public void onDPRefreshFinish() { |
| | | log("onDPRefreshFinish"); |
| | | } |
| | | |
| | | mIDPWidget = DPHolder.getInstance().buildDrawWidget(DPWidgetDrawParams.obtain().hideClose(true, null) |
| | | .drawContentType(DPWidgetDrawParams.DRAW_CONTENT_TYPE_ALL) |
| | | .listener(new IDPNewsListener() { |
| | | @Override |
| | | public void onDPRefreshFinish() { |
| | | log("onDPRefreshFinish"); |
| | | } |
| | | @Override |
| | | public void onDPNewsItemClick(Map<String, Object> map) { |
| | | log("onDPNewsItemClick"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPNewsItemClick(Map<String, Object> map) { |
| | | log("onDPNewsItemClick"); |
| | | } |
| | | @Override |
| | | public void onDPVideoPlay(Map<String, Object> map) { |
| | | log("onDPVideoPlay"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPVideoPlay(Map<String, Object> map) { |
| | | log("onDPVideoPlay"); |
| | | } |
| | | @Override |
| | | public void onDPVideoPause(Map<String, Object> map) { |
| | | log("onDPVideoPause"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPVideoPause(Map<String, Object> map) { |
| | | log("onDPVideoPause"); |
| | | } |
| | | @Override |
| | | public void onDPVideoContinue(Map<String, Object> map) { |
| | | log("onDPVideoContinue"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPVideoContinue(Map<String, Object> map) { |
| | | log("onDPVideoContinue"); |
| | | } |
| | | @Override |
| | | public void onDPVideoOver(Map<String, Object> map) { |
| | | log("onDPVideoOver"); |
| | | DPEventCollectUtil.playDrawVideo(getContext(), null, "dy", "home", false); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPVideoOver(Map<String, Object> map) { |
| | | log("onDPVideoOver"); |
| | | DPEventCollectUtil.playDrawVideo(getContext(), null, "dy", "home", false); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPVideoCompletion(Map<String, Object> map) { |
| | | log("onDPVideoCompletion"); |
| | | super.onDPVideoCompletion(map); |
| | | @Override |
| | | public void onDPVideoCompletion(Map<String, Object> map) { |
| | | log("onDPVideoCompletion"); |
| | | super.onDPVideoCompletion(map); |
| | | // DPEventCollectUtil.playDrawVideo(getContext(), null, "dy", "home", true); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDPNewsDetailEnter(Map<String, Object> map) { |
| | | log("onDPNewsDetailEnter"); |
| | | } |
| | | @Override |
| | | public void onDPNewsDetailEnter(Map<String, Object> map) { |
| | | log("onDPNewsDetailEnter"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDPNewsDetailExit(Map<String, Object> map) { |
| | | log("onDPNewsDetailExit"); |
| | | } |
| | | @Override |
| | | public void onDPNewsDetailExit(Map<String, Object> map) { |
| | | log("onDPNewsDetailExit"); |
| | | } |
| | | |
| | | |
| | | })); |
| | | })); |
| | | |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | | if (fragmentManager != null) { |
| | | fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } else { |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | | if (fragmentManager != null) { |
| | | fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } else { |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | feedVideos.setDataType("shortVideos"); |
| | | feedVideos.setName("热门"); |
| | | categories.add(1, feedVideos); |
| | | //抖音短剧 |
| | | feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("dyDrama"); |
| | | feedVideos.setName("剧场"); |
| | | categories.add(1, feedVideos); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.content.Context; |
| | | import android.os.Bundle; |
| | | 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.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 java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.fragment.app.FragmentManager; |
| | | |
| | | /** |
| | | * 主页面--抖音短剧 |
| | | */ |
| | | public class HomeTabDramaFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "HomeTabDramaFragment"; |
| | | private IDPWidget mIDPWidget; |
| | | private MySwipeRefreshLayout swipeRefreshLayout; |
| | | private FragmentManager fragmentManager; |
| | | |
| | | |
| | | public HomeTabDramaFragment() { |
| | | super(); |
| | | setName(HomeTabDramaFragment.class.getName()); |
| | | } |
| | | |
| | | public HomeTabDramaFragment(FragmentManager fragmentManager) { |
| | | super(); |
| | | setName(HomeTabDramaFragment.class.getName()); |
| | | this.fragmentManager = fragmentManager; |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Log.i(TAG, "onCreate"); |
| | | } |
| | | |
| | | @Override |
| | | public int getContentResource() { |
| | | return R.layout.fragment_ks_video; |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | Log.i(TAG, "onResume"); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onResume(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | Log.i(TAG, "onPause"); |
| | | super.onPause(); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onPause(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void setUserVisibleHint(boolean isVisibleToUser) { |
| | | Log.i(TAG, "setUserVisibleHint:" + isVisibleToUser); |
| | | super.setUserVisibleHint(isVisibleToUser); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().setUserVisibleHint(isVisibleToUser); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onHiddenChanged(boolean hidden) { |
| | | Log.i(TAG, "onHiddenChanged:" + hidden); |
| | | super.onHiddenChanged(hidden); |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onHiddenChanged(hidden); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | swipeRefreshLayout = contentView.findViewById(R.id.srl_ks); |
| | | swipeRefreshLayout.setEnabled(false); |
| | | init(); |
| | | } |
| | | |
| | | private void init() { |
| | | try { |
| | | mIDPWidget = DPHolder.getInstance().buildDramaHomeWidget( |
| | | DPWidgetDramaHomeParams.obtain() |
| | | .showPageTitle(false) |
| | | .detailConfig(DPDramaDetailConfig.obtain(DPDramaDetailConfig.COMMON_DETAIL)) |
| | | ); |
| | | Fragment fragment = mIDPWidget.getFragment(); |
| | | if (fragment != null) { |
| | | fragmentManager = null; |
| | | if (fragmentManager != null) { |
| | | fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } else { |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | private static void log(String msg) { |
| | | Log.d(TAG, String.valueOf(msg)); |
| | | } |
| | | |
| | | @Override |
| | | public void onDetach() { |
| | | super.onDetach(); |
| | | Log.i(TAG, "onDetach"); |
| | | } |
| | | |
| | | @Override |
| | | public void onAttach(@NonNull Context context) { |
| | | super.onAttach(context); |
| | | Log.i(TAG, "onAttach"); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mIDPWidget != null) { |
| | | mIDPWidget.destroy(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.weikou.beibeivideo.util.ui.AiDaoUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.yeshi.appupdate.AppUpdate; |
| | | import com.yeshi.push.PushUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | |
| | | |
| | | return new Fragment[]{ |
| | | new HomeFragment(), new DrawVideoFragment(getSupportFragmentManager()), |
| | | new DYNewsFragment(getSupportFragmentManager()), new MineFragment(), new NovelFragment(getSupportFragmentManager()) |
| | | new DYNewsFragment(getSupportFragmentManager()),new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | |
| | | }; |
| | | } |
| | |
| | | .changeFragment(DrawVideoFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_short_tv: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(DYDramaVideoFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_discover: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(DYNewsFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_novel: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(NovelFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_mine: { |
| | | mFragmentSwitchHelper.changeFragment(MineFragment.class); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | super.onCreate(savedInstanceState); |
| | | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);// 锁定竖屏 |
| | | setContentView(R.layout.activity_main); |
| | | if(ConfigUtil.isAiDaoMode(this)){ |
| | | if (ConfigUtil.isAiDaoMode(this)) { |
| | | AiDaoUtil.setAiDaoMode(this); |
| | | } |
| | | |
| | |
| | | R.id.fl_main_fragment_container, getSupportFragmentManager(), getFragments() |
| | | ); |
| | | |
| | | findViewById(R.id.tv_nav_cartoon).setOnClickListener(new View.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(MainActivity.this, BrowserActivity.class); |
| | | // intent.putExtra("title", "椰视漫画"); |
| | | // intent.putExtra("url", "http:///")m.cartoon.yeshitv.com; |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | |
| | | |
| | | rg_nav = findViewById(R.id.rg_nav); |
| | |
| | | mAQuery.id(R.id.rb_nav_discover).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_nav_draw_video).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_nav_novel).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.GONE); |
| | | } else { |
| | | setSearchBarVisibility(); |
| | | mAQuery.id(R.id.rb_nav_draw_video).visibility(View.VISIBLE); |
| | |
| | | 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()) { |
| | | 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()) { |
| | | 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); |
| | |
| | | final AdUtil.AD_TYPE adType = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | if (adType == null) { |
| | | return; |
| | | } |
| | | |
| | | String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"); |
| | | if ("huawei".equalsIgnoreCase(channel)) { |
| | | // 华为平台的弹出广告每天只能弹出一次 |
| | | if (!AdUtil.canShowAdHuaWei(getApplicationContext(), AdPositionEnum.homeInterstitial)) { |
| | | return; |
| | | } |
| | | AdUtil.showAdHuaWei(getApplicationContext(),AdPositionEnum.homeInterstitial); |
| | | } |
| | | |
| | | adCallback = new Runnable() { |
| | |
| | | findViewById(R.id.rb_nav_draw_video).performClick(); |
| | | break; |
| | | case 2: |
| | | findViewById(R.id.rb_nav_discover).performClick(); |
| | | findViewById(R.id.rb_nav_short_tv).performClick(); |
| | | break; |
| | | // case 3: |
| | | // findViewById(R.id.rb_nav_novel).performClick(); |
| | | // break; |
| | | case 3: |
| | | findViewById(R.id.rb_nav_novel).performClick(); |
| | | break; |
| | | case 4: |
| | | findViewById(R.id.rb_nav_mine).performClick(); |
| | | break; |
| | | } |
| | |
| | | |
| | | import com.lcjian.library.RetainViewFragment; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.tencent.smtt.export.external.TbsCoreSettings; |
| | | import com.tencent.smtt.export.external.interfaces.SslError; |
| | | import com.tencent.smtt.export.external.interfaces.SslErrorHandler; |
| | | import com.tencent.smtt.sdk.QbSdk; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.entity.AccumulateRule; |
| | | import com.weikou.beibeivideo.entity.PlayUrl; |
| | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * 网页加载页面 |
| | | * |
| | |
| | | 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.video.ChangeVideoEvent; |
| | | import com.weikou.beibeivideo.entity.vo.VideoDetailAdInfoVO; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | |
| | | if (adInfo == null || !adInfo.isFullVideo()) |
| | | return; |
| | | |
| | | //如果是全局广告配置不允许展示则不展示 |
| | | if (AdUtil.getAdType(getApplicationContext(), AdPositionEnum.videoDetailFullVideo)==null){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | //加载广告 |
| | |
| | | //如果是华为渠道,固定为广点通插屏 |
| | | String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"); |
| | | if("huawei".equalsIgnoreCase(channel)){ |
| | | |
| | | if(!AdUtil.canShowAdHuaWei(getApplicationContext(),AdPositionEnum.videoDetailFullVideo)){ |
| | | return; |
| | | } |
| | | AdUtil.showAdHuaWei(getApplicationContext(),AdPositionEnum.videoDetailFullVideo); |
| | | //采用广点通插屏 |
| | | InterstitialAdUtil.showAd(this, AdUtil.AD_TYPE.gdt,"7002342568464590"); |
| | | return; |
| | |
| | | // if(1>0){ |
| | | // return; |
| | | // } |
| | | |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(VideoDetailActivity2.this); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId("946608275") |
| | |
| | | |
| | | @Override |
| | | public void onError(int i, String s) { |
| | | |
| | | Log.i(TAG, s); |
| | | } |
| | | |
| | |
| | | } |
| | | break; |
| | | case R.id.rl_about_us: { |
| | | //关于我们 |
| | | Intent intent = new Intent(this, BrowserActivity.class); |
| | | intent.putExtra("url", BeibeiConstant.ABOUT_US); |
| | | // intent.putExtra("url", "http://192.168.3.122:9999"); |
| | | startActivity(intent); |
| | | } |
| | | break; |
| | |
| | | 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.HomeTabDramaFragment; |
| | | import com.weikou.beibeivideo.ui.main.KSHorizontalFeedVideoFragment; |
| | | import com.weikou.beibeivideo.ui.main.KSShortVideoFragment; |
| | | import com.weikou.beibeivideo.ui.main.MainActivity; |
| | |
| | | return fragment; |
| | | } else if ("shortVideos".equalsIgnoreCase(type.getDataType())) { |
| | | return new KSHorizontalFeedVideoFragment(); |
| | | }else if ("dyDrama".equalsIgnoreCase(type.getDataType())) { |
| | | return new HomeTabDramaFragment(); |
| | | } else { |
| | | CategoryRecommendFragment fragment = new CategoryRecommendFragment(); |
| | | Bundle bundle = new Bundle(); |
| | |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.AdTypeVO; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.TimeUtil; |
| | | import com.weikou.beibeivideo.util.TimeUtils; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | |
| | | import org.json.JSONException; |
| | |
| | | } |
| | | |
| | | |
| | | // 是否可以显示华为的广告 |
| | | public static boolean canShowAdHuaWei(Context context, AdPositionEnum position){ |
| | | SharedPreferences share = context.getSharedPreferences("adConfig", Context.MODE_PRIVATE); |
| | | Long lastTime = share.getLong("huawei_show_time_"+position.name(),0); |
| | | if( TimeUtils.millisToStringDate(System.currentTimeMillis(),"yyyyMMdd").equalsIgnoreCase( TimeUtils.millisToStringDate(lastTime,"yyyyMMdd"))) { |
| | | //同一天 |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public static void showAdHuaWei(Context context, AdPositionEnum position){ |
| | | SharedPreferences share = context.getSharedPreferences("adConfig", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = share.edit(); |
| | | editor.putLong("huawei_show_time_"+position.name(), System.currentTimeMillis()); |
| | | editor.commit(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return TTAdSdk.getAdManager(); |
| | | } |
| | | |
| | | public static void init(Context context, TTAdSdk.InitCallback initCallback) { |
| | | public static void init(Context context, TTAdSdk.Callback initCallback) { |
| | | doInit(context, initCallback); |
| | | } |
| | | |
| | | //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明 |
| | | private static void doInit(Context context, TTAdSdk.InitCallback initCallback) { |
| | | private static void doInit(Context context, TTAdSdk.Callback initCallback) { |
| | | if (!TTAdSdk.isInitSuccess()) { |
| | | try { |
| | | TTAdSdk.init(context, buildConfig(context), initCallback); |
| | | |
| | | TTAdSdk.init(context, buildConfig(context)); |
| | | TTAdSdk.start(initCallback); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | |
| | | public String getDevImei() { |
| | | return DeviceUtil.getImeiCache(context); |
| | | } |
| | | }) |
| | | .asyncInit(true) |
| | | .needClearTaskReset(); |
| | | }); |
| | | //.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。 |
| | | //if (AdUtil.getAdType(context, AdPositionEnum.splashHotStart) != null) { |
| | | // builder.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI); |
| | |
| | | import com.lcjian.library.util.common.ClipboardUtil; |
| | | import com.lcjian.library.util.common.PackageUtils2; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.lcjian.library.util.security.AEScrypt; |
| | | import com.lcjian.library.util.security.DEScrypt; |
| | | import com.lcjian.library.util.security.MD5Utils; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.UserInfo; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.JumpActivityUtil; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | |
| | | public String getUid() { |
| | | return mContext.getSharedPreferences("user", MODE_PRIVATE).getString("LoginUid", ""); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getUserInfo() throws JSONException { |
| | | JSONObject data=new JSONObject(); |
| | | data.put("device",BeibeiVideoAPI.getDeviceId(mContext)); |
| | | UserInfo user = UserUtil.getLoginUserInfo(mContext); |
| | | if(user!=null){ |
| | | //获取用户头像与昵称 |
| | | data.put("login",true); |
| | | JSONObject userJSON=new JSONObject(); |
| | | userJSON.put("id",user.getId()); |
| | | userJSON.put("nickName",user.getNickname()); |
| | | userJSON.put("portrait",user.getPortrait()); |
| | | data.put("user",userJSON); |
| | | |
| | | }else{ |
| | | data.put("login",false); |
| | | } |
| | | return data.toString(); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getAppName(){ |
| | | return mContext.getString(R.string.app_name); |
| | |
| | | |
| | | @JavascriptInterface |
| | | public String apiDecode(String result) { |
| | | |
| | | return DEScrypt.decode(result); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String apiEncode(String result) { |
| | | return DEScrypt.encode(result); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | |
| | | import com.bytedance.novel.pangolin.NovelSDK; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | |
| | |
| | | public static void playDrawVideo(Context context, Map<String, Object> map, String type, String from, boolean complete) { |
| | | |
| | | BeibeiVideoAPI.playDrawVideo(context, type, from, complete, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传小说阅读时间 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void uploadNovelReadTime(Context context) { |
| | | long time = NovelSDK.INSTANCE.getNovelReadingDuration(); |
| | | if (time <= 0) |
| | | return; |
| | | BeibeiVideoAPI.readNovel(context, time, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | |
| | |
| | | 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){ |
| | | |
| | | return getFactory().createDramaHome(params); |
| | | } |
| | | |
| | | public void loadVideoCard(DPWidgetVideoCardParams params, IDPWidgetFactory.Callback callback) { |
| | | getFactory().loadVideoCard(params, callback); |
| | | } |
| | |
| | | int currentVersion = info.versionCode; |
| | | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| | | int lastVersion = prefs.getInt("version_code", 0); |
| | | if (currentVersion > lastVersion) { // 濡傛灉褰撳墠鐗堟湰澶т簬涓婃鐗堟湰锛岃鐗堟湰灞炰簬绗竴娆″惎鍔? |
| | | // 灏嗗綋鍓嶇増鏈啓鍏reference涓紝鍒欎笅娆″惎鍔ㄧ殑鏃跺?锛屾嵁姝ゅ垽鏂紝涓嶅啀涓洪娆″惎鍔? |
| | | if (currentVersion > lastVersion) { |
| | | prefs.edit().putInt("version_code", currentVersion).commit(); |
| | | return true; |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 鑾峰彇versionCode |
| | | * 获取versionCode |
| | | * |
| | | * @param context |
| | | * @return 鐗堟湰鍙? |
| | | * @return |
| | | */ |
| | | public static int getVersionCode(Context context) { |
| | | try { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 鑾峰彇澶栭儴瀛樺偍鍗� |
| | | * 获取外部存储 |
| | | * |
| | | * @param context |
| | | * @return |
| | |
| | | } |
| | | /* |
| | | * } else { if (Environment.getStorageState(Environment.) |
| | | * .equals(Environment.MEDIA_MOUNTED)) { // 涓簍rue鐨勮瘽锛屽缃畇d鍗″瓨鍦�} } |
| | | * .equals(Environment.MEDIA_MOUNTED)) { // 为true的话,} } |
| | | */ |
| | | |
| | | return null; |
| | |
| | | public static String getDownLoadPath(Context context) { |
| | | File downloadStorage = getDownloadStorage(context); |
| | | File downloadPath = null; |
| | | // Log.i("help", "鎵嬫満鍐呭瓨"); |
| | | // Log.i("help", "手机内存"); |
| | | if (downloadStorage.equals(Environment.getDataDirectory())) { |
| | | downloadPath = new File(context.getFilesDir(), "video"); |
| | | } else { |
| | |
| | | // String name = context.getPackageName(); |
| | | // int type = getDeaultStorage(context); |
| | | // if (type == STORAGE_MOBILE) { |
| | | // // 涓嬭浇鏂囦欢瀛樻斁鍒版牴鐩綍 Download鏂囦欢澶逛笅 |
| | | // // 下载文件存放到根目录 Download文件夹下 |
| | | // // File f = Environment |
| | | // // .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); |
| | | // |
| | | // // 涓嬭浇鏂囦欢瀛樻斁鍒癮pp瀹夎鐩綍涓� |
| | | // File f = context.getExternalFilesDir("鏈ㄧ摐缂撳瓨鏂囦欢"); |
| | | // // 下载文件存放到app安裑目录 |
| | | // File f = context.getExternalFilesDir("木瓜缓存文件"); |
| | | // // File f = context.getExternalCacheDir(); |
| | | // if (!f.exists()) |
| | | // f.mkdirs(); |
| | |
| | | import android.text.style.RelativeSizeSpan; |
| | | import android.widget.TextView; |
| | | |
| | | import com.lcjian.library.util.common.DeviceUtil; |
| | | |
| | | /** |
| | | * 瀛楃蹇嵎鏂瑰紡锛氬垽鏂瓧绗︿覆<涓枃瀛楃銆侀偖绠便?鎵嬫満鍙枫?绌哄瓧绗︺?鏁存暟銆佹诞鐐规暟> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * is null or its length is 0 or it is made by space |
| | | * |
| | | * |
| | | * @param str |
| | | * @return if string is null or its size is 0 or it is made by space, return |
| | | * true, else return false. |
| | |
| | | |
| | | /** |
| | | * is null or its length is 0 |
| | | * |
| | | * |
| | | * @param str |
| | | * @return if string is null or its size is 0, return true, else return |
| | | * false. |
| | |
| | | |
| | | /** |
| | | * compare two string |
| | | * |
| | | * |
| | | * @param actual |
| | | * @param expected |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * capitalize first letter |
| | | * |
| | | * |
| | | * <pre> |
| | | * capitalizeFirstLetter(null) = null; |
| | | * capitalizeFirstLetter("") = ""; |
| | |
| | | * capitalizeFirstLetter("ab") = "Ab" |
| | | * capitalizeFirstLetter("Abc") = "Abc" |
| | | * </pre> |
| | | * |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | char c = str.charAt(0); |
| | | return (!Character.isLetter(c) || Character.isUpperCase(c)) ? str |
| | | : new StringBuilder(str.length()) |
| | | .append(Character.toUpperCase(c)) |
| | | .append(str.substring(1)).toString(); |
| | | .append(Character.toUpperCase(c)) |
| | | .append(str.substring(1)).toString(); |
| | | } |
| | | |
| | | |
| | |
| | | if (text == null || text.length() == 0) { |
| | | return false; |
| | | } |
| | | try { |
| | | Integer.parseInt(text); |
| | | try { |
| | | Integer.parseInt(text); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | |
| | | |
| | | /** |
| | | * 是否是正确的电话号码 |
| | | * |
| | | * |
| | | * @param mobile |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 身份证验�? |
| | | * |
| | | * |
| | | * @param card |
| | | * @return |
| | | */ |
| | |
| | | String deviceid =""; |
| | | if (ContextCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED |
| | | || ContextCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { |
| | | deviceid = DeviceUtil.getImeiCache(context); |
| | | deviceid = tm.getDeviceId();// 获取deviceId |
| | | } |
| | | |
| | | return deviceid; |
| | | } |
| | | |
| | | public static void getdiffrentColor(TextView tv, int color, int start, |
| | | int end) { |
| | | int end) { |
| | | SpannableStringBuilder style = new SpannableStringBuilder(tv.getText()); |
| | | ForegroundColorSpan redSpan = new ForegroundColorSpan(color); |
| | | style.setSpan(redSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | |
| | | } |
| | | |
| | | public static void getdiffrentColor(TextView tv, int color, int size, |
| | | int start, int end) { |
| | | int start, int end) { |
| | | SpannableStringBuilder style = new SpannableStringBuilder(tv.getText()); |
| | | ForegroundColorSpan redSpan = new ForegroundColorSpan(color); |
| | | style.setSpan(redSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | package="com.mozillaonline.downloadprovider" |
| | | android:versionCode="1" |
| | | android:versionName="1.0" > |
| | | android:versionName="1.0"> |
| | | |
| | | <!-- Allows access to the Download Manager --> |
| | | <!--<permission--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.ACCESS_DOWNLOAD_MANAGER"--> |
| | | <!--android:description="@string/permdesc_downloadManager"--> |
| | | <!--android:label="@string/permlab_downloadManager"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.ACCESS_DOWNLOAD_MANAGER"--> |
| | | <!--android:description="@string/permdesc_downloadManager"--> |
| | | <!--android:label="@string/permlab_downloadManager"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | <!--<permission android:name="android.permission.WRITE_MEDIA_STORAGE" >--> |
| | | <!--</permission>--> |
| | | <!-- Allows advanced access to the Download Manager --> |
| | | <!--<permission--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED"--> |
| | | <!--android:description="@string/permdesc_downloadManagerAdvanced"--> |
| | | <!--android:label="@string/permlab_downloadManagerAdvanced"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED"--> |
| | | <!--android:description="@string/permdesc_downloadManagerAdvanced"--> |
| | | <!--android:label="@string/permlab_downloadManagerAdvanced"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | |
| | | <!-- Allows to send broadcasts on download completion --> |
| | | <!--<permission--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.SEND_DOWNLOAD_COMPLETED_INTENTS"--> |
| | | <!--android:description="@string/permdesc_downloadCompletedIntent"--> |
| | | <!--android:label="@string/permlab_downloadCompletedIntent"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | <!--android:name="com.ddysvideo.mozillaonline.permission.SEND_DOWNLOAD_COMPLETED_INTENTS"--> |
| | | <!--android:description="@string/permdesc_downloadCompletedIntent"--> |
| | | <!--android:label="@string/permlab_downloadCompletedIntent"--> |
| | | <!--android:protectionLevel="normal" />--> |
| | | |
| | | <uses-permission android:name="android.permission.INTERNET" /> |
| | | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| | |
| | | |
| | | <application |
| | | android:icon="@drawable/ic_launcher" |
| | | android:label="@string/app_name" > |
| | | android:label="@string/app_name"> |
| | | <activity |
| | | android:name=".DownloadProviderActivity" |
| | | android:label="@string/app_name" > |
| | | android:label="@string/app_name"> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.MAIN" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <activity android:name="com.mozillaonline.providers.downloads.ui.DownloadList" > |
| | | </activity> |
| | | <activity android:name="com.mozillaonline.providers.downloads.ui.DownloadList"></activity> |
| | | |
| | | <provider |
| | | android:name="com.mozillaonline.providers.downloads.DownloadProvider" |
| | |
| | | |
| | | <receiver |
| | | android:name="com.mozillaonline.providers.downloads.DownloadReceiver" |
| | | android:exported="false" > |
| | | android:exported="false"> |
| | | <intent-filter> |
| | | <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
| | | </intent-filter> |
| | |
| | | dependencies { |
| | | api fileTree(include: '*.jar', dir: 'libs') |
| | | api 'androidx.legacy:legacy-support-v4:1.0.0' |
| | | // api 'com.qq.e.union:union:4.461.1331' |
| | | api 'com.qq.e.union:union:4.480.1350' |
| | | api 'com.qq.e.union:union:4.542.1412' |
| | | |
| | | api 'com.tencent.tbs:tbssdk:44213' |
| | | api 'com.tencent.tbs:tbssdk:44286' |
| | | |
| | | // implementation 'com.qq.e.union:union:4.410.1290' |
| | | // api files("libs/GDTSDK.unionNormal.4.420.1290.aar") |
| | | } |
| | | |
| | | android { |
| | | compileSdkVersion 26 |
| | | compileSdkVersion 30 |
| | | buildToolsVersion '28.0.3' |
| | | defaultConfig { |
| | | minSdkVersion 16 |
| | | targetSdkVersion 26 |
| | | targetSdkVersion 30 |
| | | } |
| | | sourceSets { |
| | | main { |
| | |
| | | dependencies { |
| | | api 'com.huawei.hms:push:5.0.4.302' |
| | | api files('libs\\com.heytap.msp.aar') |
| | | api files('libs\\MiPush_SDK_Client_3_8_5.jar') |
| | | // api files('libs\\MiPush_SDK_Client_3_8_5.jar') |
| | | api files('libs\\vivo_pushsdk_v3.0.0.0_480.aar') |
| | | api 'com.meizu.flyme.internet:push-internal:4.0.4' |
| | | |
| | |
| | | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> |
| | | |
| | | <permission |
| | | android:name="${applicationId}.permission.MIPUSH_RECEIVE" |
| | | android:protectionLevel="signature" /> |
| | | <!-- <permission--> |
| | | <!-- android:name="${applicationId}.permission.MIPUSH_RECEIVE"--> |
| | | <!-- android:protectionLevel="signature" />--> |
| | | |
| | | <uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" /> |
| | | <!-- <uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />--> |
| | | |
| | | <!--OPPO推送权限 --> |
| | | <!-- 如果应用无透传权限,则不用配置--> |
| | |
| | | |
| | | |
| | | <!-- 小米推送 --> |
| | | <service |
| | | android:name="com.xiaomi.push.service.XMPushService" |
| | | android:enabled="true" |
| | | android:process=":pushservice" /> |
| | | <!-- <service--> |
| | | <!-- android:name="com.xiaomi.push.service.XMPushService"--> |
| | | <!-- android:enabled="true"--> |
| | | <!-- android:process=":pushservice" />--> |
| | | |
| | | <!--注:此service必须在3.0.1版本以后(包括3.0.1版本)加入--> |
| | | <service |
| | | android:name="com.xiaomi.push.service.XMJobService" |
| | | android:enabled="true" |
| | | android:exported="false" |
| | | android:permission="android.permission.BIND_JOB_SERVICE" |
| | | android:process=":pushservice" /> |
| | | <!-- <!–注:此service必须在3.0.1版本以后(包括3.0.1版本)加入–>--> |
| | | <!-- <service--> |
| | | <!-- android:name="com.xiaomi.push.service.XMJobService"--> |
| | | <!-- android:enabled="true"--> |
| | | <!-- android:exported="false"--> |
| | | <!-- android:permission="android.permission.BIND_JOB_SERVICE"--> |
| | | <!-- android:process=":pushservice" />--> |
| | | |
| | | <service |
| | | android:name="com.xiaomi.mipush.sdk.PushMessageHandler" |
| | | android:enabled="true" |
| | | android:exported="true" /> |
| | | <!-- <service--> |
| | | <!-- android:name="com.xiaomi.mipush.sdk.PushMessageHandler"--> |
| | | <!-- android:enabled="true"--> |
| | | <!-- android:exported="true" />--> |
| | | |
| | | <!--注:此service必须在2.2.5版本以后(包括2.2.5版本)加入--> |
| | | <service |
| | | android:name="com.xiaomi.mipush.sdk.MessageHandleService" |
| | | android:enabled="true" /> |
| | | <!-- <!–注:此service必须在2.2.5版本以后(包括2.2.5版本)加入–>--> |
| | | <!-- <service--> |
| | | <!-- android:name="com.xiaomi.mipush.sdk.MessageHandleService"--> |
| | | <!-- android:enabled="true" />--> |
| | | |
| | | <receiver |
| | | android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" |
| | | android:exported="true"> |
| | | <intent-filter> |
| | | <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
| | | <category android:name="android.intent.category.DEFAULT" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <!-- <receiver--> |
| | | <!-- android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver"--> |
| | | <!-- android:exported="true">--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />--> |
| | | <!-- <category android:name="android.intent.category.DEFAULT" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- </receiver>--> |
| | | |
| | | <receiver |
| | | android:name="com.xiaomi.push.service.receivers.PingReceiver" |
| | | android:exported="false" |
| | | android:process=":pushservice"> |
| | | <intent-filter> |
| | | <action android:name="com.xiaomi.push.PING_TIMER" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <!-- <receiver--> |
| | | <!-- android:name="com.xiaomi.push.service.receivers.PingReceiver"--> |
| | | <!-- android:exported="false"--> |
| | | <!-- android:process=":pushservice">--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.xiaomi.push.PING_TIMER" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- </receiver>--> |
| | | |
| | | |
| | | |
| | |
| | | import com.meizu.cloud.pushsdk.PushManager; |
| | | import com.vivo.push.IPushActionListener; |
| | | import com.vivo.push.PushClient; |
| | | import com.xiaomi.mipush.sdk.MiPushClient; |
| | | //暂时取消小米推送 |
| | | //import com.xiaomi.mipush.sdk.MiPushClient; |
| | | |
| | | public class PushUtil { |
| | | |
| | |
| | | |
| | | String appId = ManifestDataUtil.getAppMetaData(context, "XIAOMI_APPID").replace("XIAOMI-", ""); |
| | | String appKey = ManifestDataUtil.getAppMetaData(context, "XIAOMI_APPKEY").replace("XIAOMI-", ""); |
| | | MiPushClient.registerPush(context, appId, appKey);//注册小米推送 |
| | | xmRegId = MiPushClient.getRegId(context); |
| | | Log.i(TAG, "小米注册成功:" + xmRegId); |
| | | // MiPushClient.registerPush(context, appId, appKey);//注册小米推送 |
| | | // xmRegId = MiPushClient.getRegId(context); |
| | | // Log.i(TAG, "小米注册成功:" + xmRegId); |
| | | if (!StringUtils.isEmpty(xmRegId)) { |
| | | tokenListener.onToken("xm", xmRegId); |
| | | } |
| | |
| | | testImplementation 'junit:junit:4.+' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.1' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' |
| | | api 'com.tencent.tbs:tbssdk:44213' |
| | | api 'com.tencent.tbs:tbssdk:44286' |
| | | |
| | | |
| | | |