From 1981dee5aec45793d3c4ebdbc4e637528c71b3c5 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 03 二月 2021 19:20:47 +0800 Subject: [PATCH] 'PPTV' --- BuWanVideo/libs/logger-2.0.0-release.aar | 0 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDataNotifyDialog.java | 3 BuWanVideo/libs/open_ad_sdk.aar | 0 library-common/src/com/lcjian/library/util/common/StringUtils.java | 2 BuWanVideo/res/layout/dialog_loading.xml | 26 library-VideoPlayer/src/main/assets/player_acfun.js | 25 BuWanVideo/libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar | 0 BuWanVideo/libs/crashshield-2.0.0-release.aar | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/mine/BrowserActivity.java | 37 BuWanVideo/src/com/weikou/beibeivideo/entity/PlayUrl.java | 37 BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java | 143 ++ BuWanVideo/src/com/weikou/beibeivideo/util/ad/ExpressAdManager.java | 2 BuWanVideo/src/com/weikou/beibeivideo/ui/ad/PlayVideoPreADFragment.java | 11 library-VideoPlayer/src/main/assets/player_funshion.js | 25 BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java | 153 +- BuWanVideo/res/drawable-xhdpi/icon_login_phone.png | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java | 15 BuWanVideo/libs/phoneNumber-L-AuthSDK-2.12.0.aar | 0 BuWanVideo/libs/securityguardaar3-5.4.171.aar | 0 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoPlayerController.java | 10 BuWanVideo/src/com/doudou/ysvideo/wxapi/WXEntryActivity.java | 4 BuWanVideo/src/com/weikou/beibeivideo/ui/dialog/LoadingDialogUtil.java | 106 + BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java | 92 + BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment2.java | 2 BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java | 144 ++ BuWanVideo/src/com/weikou/beibeivideo/util/browser/BaseBWJavaInterface.java | 10 BuWanVideo/src/com/weikou/beibeivideo/util/ad/AdUtil.java | 1 BuWanVideo/res/drawable/shape_login_onkey_bg.xml | 9 BuWanVideo/src/com/weikou/beibeivideo/util/VideoUtil.java | 68 + BuWanVideo/src/com/weikou/beibeivideo/ui/main/MineFragment.java | 101 + BuWanVideo/res/drawable-xxhdpi/ic_login_close.png | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayActivity.java | 467 +++++++ BuWanVideo/src/com/weikou/beibeivideo/ui/login/RegisterActivity.java | 5 BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java | 139 + gradle/wrapper/gradle-wrapper.properties | 4 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java | 27 BuWanVideo/res/drawable/shape_vip_open_btn.xml | 14 BuWanVideo/res/layout/item_funshion_gdt_ad_view.xml | 68 - library-BaiduCPU/src/main/java/com/yeshi/ec/library_baiducpu/fragment/BaiDuCPUContentFragment.java | 2 BuWanVideo/res/drawable-xhdpi/icon_vip_logo.png | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity.java | 33 BuWanVideo/res/layout/mine_fragment.xml | 73 + BuWanVideo/res/layout/activity_register.xml | 2 BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java | 2 BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java | 22 BuWanVideo/src/com/weikou/beibeivideo/ui/login/PersonInfoActivity.java | 49 BuWanVideo/res/drawable-xxhdpi/ic_login_logo.png | 0 BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java | 29 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoResourceUtil.java | 2 BuWanVideo/libs/main-2.0.0-release.aar | 0 BuWanVideo/res/layout/browser_pptv_activity.xml | 46 BuWanVideo/src/com/weikou/beibeivideo/ui/common/LiveBrowserActivity.java | 2 BuWanVideo/AndroidManifest.xml | 42 BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java | 59 BuWanVideo/src/com/weikou/beibeivideo/entity/vo/UserInfoVO.java | 138 ++ BuWanVideo/libs/FunshionBase-2.0.0.0.aar | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/main/HomeFragment.java | 63 library-common/src/com/lcjian/library/upgrade/UpdateService.java | 2 BuWanVideo/res/drawable/shape_vip_bg.xml | 12 BuWanVideo/res/drawable-xhdpi/ic_login_logo.png | 0 BuWanVideo/res/layout/act_login.xml | 2 BuWanVideo/src/com/weikou/beibeivideo/util/browser/BWJavaInterface.java | 57 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisodeDialog.java | 3 BuWanVideo/src/com/weikou/beibeivideo/util/FunshionConstant.java | 2 BuWanVideo/res/drawable-xhdpi/ic_user_agreement_unchecked.png | 0 BuWanVideo/res/drawable-xhdpi/ic_user_agreement_checked.png | 0 BuWanVideo/res/drawable-xhdpi/ic_login_close.png | 0 BuWanVideo/libs/FunshionAD-1.3.16.aar | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java | 65 BuWanVideo/src/com/weikou/beibeivideo/ui/media/IQYVideoFragment.java | 2 BuWanVideo/res/values/colors.xml | 4 BuWanVideo/res/drawable-xhdpi/icon_vip.png | 0 BuWanVideo/libs/alibc_link_partner-4.1.15.aar | 0 BuWanVideo/libs/avmpaar3-5.4.36.aar | 0 BuWanVideo/res/layout/act_phone_login.xml | 197 +++ BuWanVideo/libs/sgmiddletieraar3-5.4.9.aar | 0 BuWanVideo/res/drawable-xxhdpi/ic_login_privacy_checked.png | 0 BuWanVideo/build.gradle | 48 BuWanVideo/res/layout/fragment_player_funshion.xml | 11 BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java | 115 + BuWanVideo/JniLibs/armeabi/libfsp2p.so | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/mine/SettingsActivity.java | 10 BuWanVideo/res/values/strings.xml | 3 BuWanVideo/res/layout/browser_fengxing_activity.xml | 15 BuWanVideo/src/com/weikou/beibeivideo/ui/VBrowserActivity.java | 6 BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java | 10 build.gradle | 5 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisode.java | 2 BuWanVideo/libs/FunshionBase-2.0.0.2.aar | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java | 461 +++++++ BuWanVideo/src/com/weikou/beibeivideo/util/AlibcTradeUtil.java | 2 library-common/build.gradle | 2 BuWanVideo/res/drawable/selector_user_agreement_checkbox.xml | 4 /dev/null | 16 BuWanVideo/libs/mtopsdk_allinone_open-3.1.2.5.jar | 0 BuWanVideo/src/com/weikou/beibeivideo/ui/login/LoginActivity.java | 46 BuWanVideo/libs/armeabi/libfsp2p.so | 0 library-VideoPlayer/src/main/java/com/yeshi/video/player/util/PlayerFullScreenUtil.java | 46 BuWanVideo/libs/securitybodyaar3-5.4.99.aar | 0 library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDefinition.java | 2 BuWanVideo/src/com/weikou/beibeivideo/entity/video/ChangeVideoEvent.java | 25 101 files changed, 2,983 insertions(+), 506 deletions(-) diff --git a/BuWanVideo/AndroidManifest.xml b/BuWanVideo/AndroidManifest.xml index d6238ff..6f78fd7 100644 --- a/BuWanVideo/AndroidManifest.xml +++ b/BuWanVideo/AndroidManifest.xml @@ -63,6 +63,7 @@ android:label="@string/app_name" android:largeHeap="true" android:theme="@style/AppTheme" + android:usesCleartextTraffic="true" tools:replace="android:allowBackup"> <activity @@ -137,8 +138,14 @@ android:name="com.weikou.beibeivideo.ui.mine.BrowserActivity" android:configChanges="screenSize|keyboardHidden|orientation" android:label="@string/app_name"></activity> + <activity - android:name="com.weikou.beibeivideo.ui.mine.FXBrowserActivity" + android:name="com.weikou.beibeivideo.ui.mine.PPTVPlayActivity" + android:configChanges="screenSize|keyboardHidden|orientation" + android:label="@string/app_name"></activity> + + <activity + android:name="com.weikou.beibeivideo.ui.video.VideoPlayerBrowserActivity" android:configChanges="screenSize|keyboardHidden|orientation" android:hardwareAccelerated="true" android:label="@string/app_name"> @@ -203,6 +210,12 @@ android:label="@string/app_name"></activity> <activity + android:name="com.weikou.beibeivideo.ui.login.PhoneLoginActivity" + android:label="@string/app_name"></activity> + + + + <activity android:name="com.weikou.beibeivideo.ui.video.VideoPlayerActivity" android:configChanges="orientation|screenSize|keyboardHidden" android:hardwareAccelerated="true" @@ -218,6 +231,28 @@ android:label="@string/app_name" android:windowSoftInputMode="adjustResize" /> + <!-- 闃块噷浜戞墜鏈哄彿璁よ瘉 --> + + <!--鑱旈�氱數淇℃巿鏉冣粴--> + <activity + android:name="com.mobile.auth.gatewayauth.LoginAuthActivity" + android:configChanges="orientation|keyboardHidden|screenSize" + android:exported="false" + android:launchMode="singleTop" + android:theme="@style/authsdk_activity_dialog" /> + <activity + android:name="com.mobile.auth.gatewayauth.activity.AuthWebVeiwActivity" + android:configChanges="orientation|keyboardHidden|screenSize" + android:exported="false" + android:launchMode="singleTop" + android:screenOrientation="behind" /> + <activity + android:name="com.cmic.sso.sdk.activity.LoginAuthActivity" + android:configChanges="orientation|keyboardHidden|screenSize" + android:exported="false" + android:launchMode="singleTop" /> + + <!--鐧惧害鍐呭鑱旂洘 --> <activity android:name="com.baidu.mobads.AppActivity" @@ -226,7 +261,6 @@ <service android:name="com.yeshi.appupdate.service.DownLoadFileService"></service> - <service android:name="com.weikou.wpc.superad.service.DownLoadFileService"></service> <service android:name="com.weikou.beibeivideo.service.DownLoadFileService" /> @@ -256,7 +290,7 @@ android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> <meta-data android:name="UMENG_CHANNEL" - android:value="vivo"></meta-data> + android:value="qq"></meta-data> <provider @@ -298,8 +332,6 @@ <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> - - <activity android:name="com.weikou.wpc.superad.BrowserActivity" /> <!-- 銆愬繀椤汇�� 淇¢附receiver骞挎挱鎺ユ敹 --> <receiver diff --git a/BuWanVideo/JniLibs/armeabi/libfsp2p.so b/BuWanVideo/JniLibs/armeabi/libfsp2p.so new file mode 100644 index 0000000..0404e6a --- /dev/null +++ b/BuWanVideo/JniLibs/armeabi/libfsp2p.so Binary files differ diff --git a/BuWanVideo/build.gradle b/BuWanVideo/build.gradle index 2d1ff40..22205b8 100644 --- a/BuWanVideo/build.gradle +++ b/BuWanVideo/build.gradle @@ -7,12 +7,19 @@ implementation files('libs/jg_filter_sdk_1.1.jar') implementation files('libs/wup-1.0.0.E-SNAPSHOT.jar') implementation files('libs/Xg_sdk_v2.46_20160602_1638.jar') - implementation files('libs/FunshionAD-1.3.9.aar') - implementation files('libs/FunshionBase-1.6.1.aar') - implementation files('libs/FunshionPlaySDK-1.6.1.aar') - //鑱氳兘璧� - implementation files('libs/YmSdk20200820.aar') + implementation files('libs/FunshionAD-1.3.16.aar') +// implementation files('libs/FunshionBase-1.6.1.aar') + implementation files('libs/FunshionBase-2.0.0.0.aar') + implementation files('libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar') + implementation files('libs/tbs_sdk_thirdapp_v4.3.0.39_43939.jar') + + //闃块噷浜戞墜鏈哄彿璁よ瘉 + implementation files('libs/crashshield-2.0.0-release.aar') + implementation files('libs/logger-2.0.0-release.aar') + implementation files('libs/main-2.0.0-release.aar') + implementation files('libs/phoneNumber-L-AuthSDK-2.12.0.aar') + implementation 'com.android.support:recyclerview-v7:27.1.1' implementation project(path: ':library-BaiduCPU') @@ -21,19 +28,20 @@ implementation project(path: ':library-SocialSdk') implementation project(path: ':library-APPUpdate') //绌垮北鐢插箍鍛� - implementation (name: 'open_ad_sdk', ext: 'aar') + implementation(name: 'open_ad_sdk', ext: 'aar') //闃块噷鐧惧窛 + + implementation files('libs/avmpaar3-5.4.36.aar') + implementation files('libs/securitybodyaar3-5.4.99.aar') + implementation files('libs/securityguardaar3-5.4.171.aar') + implementation files('libs/sgmiddletieraar3-5.4.9.aar') + implementation files('libs/mtopsdk_allinone_open-3.1.2.5.jar') + //鐧婚檰 implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.6@aar' implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.6@aar' implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.6@aar' //瀹夊叏缁勪欢 - implementation 'com.taobao.android:securityguardaar3:5.4.171@aar' - implementation 'com.taobao.android:securitybodyaar3:5.4.99@aar' - implementation 'com.taobao.android:avmpaar3:5.4.36@aar' - implementation 'com.taobao.android:sgmiddletieraar3:5.4.9@aar' - //Mtop - implementation 'com.taobao.android:mtopsdk_allinone_open:3.1.2.5@jar' //applink implementation 'com.alibaba.sdk.android:alibc_link_partner:4.1.15@aar' //ut @@ -55,6 +63,10 @@ //寰俊SDK api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' + //鍔犺浇鍔ㄧ敾搴� + implementation 'com.github.ybq:Android-SpinKit:1.4.0' + + } android { signingConfigs { @@ -67,7 +79,7 @@ } useLibrary 'org.apache.http.legacy' compileSdkVersion 27 - buildToolsVersion '28.0.3' + buildToolsVersion '29.0.2' compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 @@ -82,13 +94,13 @@ } defaultConfig { applicationId "com.doudou.ysvideo" - versionCode 99 - versionName "3.8.1" + versionCode 104 + versionName "3.8.6" multiDexEnabled = true minSdkVersion 17 targetSdkVersion 27 ndk { - abiFilters "armeabi-v7a", "x86", "armeabi" + abiFilters "armeabi" } } dexOptions { @@ -157,4 +169,8 @@ flatDir { dirs 'libs' } + mavenCentral() + maven { + url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" + } } \ No newline at end of file diff --git a/BuWanVideo/libs/FunshionAD-1.3.16.aar b/BuWanVideo/libs/FunshionAD-1.3.16.aar new file mode 100644 index 0000000..9c4c44c --- /dev/null +++ b/BuWanVideo/libs/FunshionAD-1.3.16.aar Binary files differ diff --git a/BuWanVideo/libs/FunshionAD-1.3.9.aar b/BuWanVideo/libs/FunshionAD-1.3.9.aar deleted file mode 100644 index a892b7a..0000000 --- a/BuWanVideo/libs/FunshionAD-1.3.9.aar +++ /dev/null Binary files differ diff --git a/BuWanVideo/libs/FunshionBase-1.6.1.aar b/BuWanVideo/libs/FunshionBase-1.6.1.aar deleted file mode 100644 index 35c1ccf..0000000 --- a/BuWanVideo/libs/FunshionBase-1.6.1.aar +++ /dev/null Binary files differ diff --git a/BuWanVideo/libs/FunshionBase-2.0.0.0.aar b/BuWanVideo/libs/FunshionBase-2.0.0.0.aar new file mode 100644 index 0000000..6346766 --- /dev/null +++ b/BuWanVideo/libs/FunshionBase-2.0.0.0.aar Binary files differ diff --git a/BuWanVideo/libs/FunshionBase-2.0.0.2.aar b/BuWanVideo/libs/FunshionBase-2.0.0.2.aar new file mode 100644 index 0000000..9d7f07b --- /dev/null +++ b/BuWanVideo/libs/FunshionBase-2.0.0.2.aar Binary files differ diff --git a/BuWanVideo/libs/FunshionPlaySDK-1.6.1.aar b/BuWanVideo/libs/FunshionPlaySDK-1.6.1.aar deleted file mode 100644 index 3b9b557..0000000 --- a/BuWanVideo/libs/FunshionPlaySDK-1.6.1.aar +++ /dev/null Binary files differ diff --git a/BuWanVideo/libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar b/BuWanVideo/libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar new file mode 100644 index 0000000..432e6d3 --- /dev/null +++ b/BuWanVideo/libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar Binary files differ diff --git a/BuWanVideo/libs/YmSdk20200820.aar b/BuWanVideo/libs/YmSdk20200820.aar deleted file mode 100644 index 04ed6dd..0000000 --- a/BuWanVideo/libs/YmSdk20200820.aar +++ /dev/null Binary files differ diff --git a/BuWanVideo/libs/alibc_link_partner-4.1.15.aar b/BuWanVideo/libs/alibc_link_partner-4.1.15.aar new file mode 100644 index 0000000..9307ef0 --- /dev/null +++ b/BuWanVideo/libs/alibc_link_partner-4.1.15.aar Binary files differ diff --git a/BuWanVideo/libs/armeabi/libfsp2p.so b/BuWanVideo/libs/armeabi/libfsp2p.so new file mode 100644 index 0000000..0404e6a --- /dev/null +++ b/BuWanVideo/libs/armeabi/libfsp2p.so Binary files differ diff --git a/BuWanVideo/libs/avmpaar3-5.4.36.aar b/BuWanVideo/libs/avmpaar3-5.4.36.aar new file mode 100644 index 0000000..31b61ae --- /dev/null +++ b/BuWanVideo/libs/avmpaar3-5.4.36.aar Binary files differ diff --git a/BuWanVideo/libs/crashshield-2.0.0-release.aar b/BuWanVideo/libs/crashshield-2.0.0-release.aar new file mode 100644 index 0000000..5e068c1 --- /dev/null +++ b/BuWanVideo/libs/crashshield-2.0.0-release.aar Binary files differ diff --git a/BuWanVideo/libs/logger-2.0.0-release.aar b/BuWanVideo/libs/logger-2.0.0-release.aar new file mode 100644 index 0000000..79dfbaa --- /dev/null +++ b/BuWanVideo/libs/logger-2.0.0-release.aar Binary files differ diff --git a/BuWanVideo/libs/main-2.0.0-release.aar b/BuWanVideo/libs/main-2.0.0-release.aar new file mode 100644 index 0000000..92084c3 --- /dev/null +++ b/BuWanVideo/libs/main-2.0.0-release.aar Binary files differ diff --git a/BuWanVideo/libs/mtopsdk_allinone_open-3.1.2.5.jar b/BuWanVideo/libs/mtopsdk_allinone_open-3.1.2.5.jar new file mode 100644 index 0000000..a38e692 --- /dev/null +++ b/BuWanVideo/libs/mtopsdk_allinone_open-3.1.2.5.jar Binary files differ diff --git a/BuWanVideo/libs/open_ad_sdk.aar b/BuWanVideo/libs/open_ad_sdk.aar index e4931e1..ac657c1 100644 --- a/BuWanVideo/libs/open_ad_sdk.aar +++ b/BuWanVideo/libs/open_ad_sdk.aar Binary files differ diff --git a/BuWanVideo/libs/phoneNumber-L-AuthSDK-2.12.0.aar b/BuWanVideo/libs/phoneNumber-L-AuthSDK-2.12.0.aar new file mode 100644 index 0000000..1e40c67 --- /dev/null +++ b/BuWanVideo/libs/phoneNumber-L-AuthSDK-2.12.0.aar Binary files differ diff --git a/BuWanVideo/libs/securitybodyaar3-5.4.99.aar b/BuWanVideo/libs/securitybodyaar3-5.4.99.aar new file mode 100644 index 0000000..4157815 --- /dev/null +++ b/BuWanVideo/libs/securitybodyaar3-5.4.99.aar Binary files differ diff --git a/BuWanVideo/libs/securityguardaar3-5.4.171.aar b/BuWanVideo/libs/securityguardaar3-5.4.171.aar new file mode 100644 index 0000000..d010247 --- /dev/null +++ b/BuWanVideo/libs/securityguardaar3-5.4.171.aar Binary files differ diff --git a/BuWanVideo/libs/sgmiddletieraar3-5.4.9.aar b/BuWanVideo/libs/sgmiddletieraar3-5.4.9.aar new file mode 100644 index 0000000..c31f016 --- /dev/null +++ b/BuWanVideo/libs/sgmiddletieraar3-5.4.9.aar Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/ic_login_close.png b/BuWanVideo/res/drawable-xhdpi/ic_login_close.png new file mode 100644 index 0000000..cf92d8d --- /dev/null +++ b/BuWanVideo/res/drawable-xhdpi/ic_login_close.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/ic_login_logo.png b/BuWanVideo/res/drawable-xhdpi/ic_login_logo.png new file mode 100644 index 0000000..a9cb123 --- /dev/null +++ b/BuWanVideo/res/drawable-xhdpi/ic_login_logo.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_checked.png b/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_checked.png index 4c44086..df2abdc 100644 --- a/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_checked.png +++ b/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_checked.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_unchecked.png b/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_unchecked.png index 2fd4495..e4f2d33 100644 --- a/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_unchecked.png +++ b/BuWanVideo/res/drawable-xhdpi/ic_user_agreement_unchecked.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/icon_login_phone.png b/BuWanVideo/res/drawable-xhdpi/icon_login_phone.png new file mode 100644 index 0000000..01027ff --- /dev/null +++ b/BuWanVideo/res/drawable-xhdpi/icon_login_phone.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/icon_vip.png b/BuWanVideo/res/drawable-xhdpi/icon_vip.png new file mode 100644 index 0000000..5aba6ee --- /dev/null +++ b/BuWanVideo/res/drawable-xhdpi/icon_vip.png Binary files differ diff --git a/BuWanVideo/res/drawable-xhdpi/icon_vip_logo.png b/BuWanVideo/res/drawable-xhdpi/icon_vip_logo.png new file mode 100644 index 0000000..4a9e9be --- /dev/null +++ b/BuWanVideo/res/drawable-xhdpi/icon_vip_logo.png Binary files differ diff --git a/BuWanVideo/res/drawable-xxhdpi/ic_login_close.png b/BuWanVideo/res/drawable-xxhdpi/ic_login_close.png new file mode 100644 index 0000000..90ee891 --- /dev/null +++ b/BuWanVideo/res/drawable-xxhdpi/ic_login_close.png Binary files differ diff --git a/BuWanVideo/res/drawable-xxhdpi/ic_login_logo.png b/BuWanVideo/res/drawable-xxhdpi/ic_login_logo.png new file mode 100644 index 0000000..a9cb123 --- /dev/null +++ b/BuWanVideo/res/drawable-xxhdpi/ic_login_logo.png Binary files differ diff --git a/BuWanVideo/res/drawable-xxhdpi/ic_login_privacy_checked.png b/BuWanVideo/res/drawable-xxhdpi/ic_login_privacy_checked.png new file mode 100644 index 0000000..df2abdc --- /dev/null +++ b/BuWanVideo/res/drawable-xxhdpi/ic_login_privacy_checked.png Binary files differ diff --git a/BuWanVideo/res/drawable/selector_user_agreement_checkbox.xml b/BuWanVideo/res/drawable/selector_user_agreement_checkbox.xml index 06cef7a..0fdd4f7 100644 --- a/BuWanVideo/res/drawable/selector_user_agreement_checkbox.xml +++ b/BuWanVideo/res/drawable/selector_user_agreement_checkbox.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/ic_user_agreement_unchecked" android:state_checked="true"></item> - <item android:drawable="@drawable/ic_user_agreement_checked" android:state_checked="false"></item> + <item android:drawable="@drawable/ic_user_agreement_checked" android:state_checked="true"></item> + <item android:drawable="@drawable/ic_user_agreement_unchecked" android:state_checked="false"></item> </selector> \ No newline at end of file diff --git a/BuWanVideo/res/drawable/shape_login_onkey_bg.xml b/BuWanVideo/res/drawable/shape_login_onkey_bg.xml new file mode 100644 index 0000000..26df0b5 --- /dev/null +++ b/BuWanVideo/res/drawable/shape_login_onkey_bg.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="#ff30354f" /> + <corners + android:bottomLeftRadius="16dp" + android:bottomRightRadius="16dp" + android:topLeftRadius="16dp" + android:topRightRadius="16dp" /> +</shape> \ No newline at end of file diff --git a/BuWanVideo/res/drawable/shape_vip_bg.xml b/BuWanVideo/res/drawable/shape_vip_bg.xml new file mode 100644 index 0000000..ed442d9 --- /dev/null +++ b/BuWanVideo/res/drawable/shape_vip_bg.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + + <gradient + android:angle="0" + android:endColor="#ffe9ce93" + android:startColor="#fff7edd7" /> + + <corners android:radius="5dp" /> + +</shape> \ No newline at end of file diff --git a/BuWanVideo/res/drawable/shape_vip_open_btn.xml b/BuWanVideo/res/drawable/shape_vip_open_btn.xml new file mode 100644 index 0000000..909e69d --- /dev/null +++ b/BuWanVideo/res/drawable/shape_vip_open_btn.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="@color/transparent" /> + <corners android:radius="20dp" /> + <stroke + android:width="1dp" + android:color="#885E24"></stroke> + <padding + android:bottom="6dp" + android:left="9dp" + android:right="9dp" + android:top="6dp"></padding> +</shape> \ No newline at end of file diff --git a/BuWanVideo/res/layout/act_login.xml b/BuWanVideo/res/layout/act_login.xml index 30ee345..0242e4e 100644 --- a/BuWanVideo/res/layout/act_login.xml +++ b/BuWanVideo/res/layout/act_login.xml @@ -306,7 +306,7 @@ android:layout_gravity="center_vertical" android:background="@drawable/selector_user_agreement_checkbox" android:button="@null" - android:checked="true" + android:checked="false" android:gravity="center" /> <TextView diff --git a/BuWanVideo/res/layout/act_phone_login.xml b/BuWanVideo/res/layout/act_phone_login.xml new file mode 100644 index 0000000..a4f3ab9 --- /dev/null +++ b/BuWanVideo/res/layout/act_phone_login.xml @@ -0,0 +1,197 @@ +<?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/theme" + android:orientation="vertical"> + + <View + android:id="@+id/v_status_bar" + android:layout_width="match_parent" + android:layout_height="15dp" + android:background="@color/top_bar_color" /> + + + <FrameLayout + android:layout_width="match_parent" + android:layout_height="48dp"> + + <TextView + android:id="@+id/tv_back" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:drawableLeft="@drawable/ic_back_two" + android:drawablePadding="3dp" + android:gravity="center_vertical" + android:padding="8dp" + android:text="杩斿洖" + android:textColor="@color/white" + android:textSize="16sp" /> + + <TextView + android:id="@+id/tv_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:paddingTop="6dp" + android:paddingBottom="6dp" + android:text="娉ㄥ唽" + android:textColor="@color/white" + android:textSize="20sp" /> + </FrameLayout> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent"> + + + <LinearLayout + android:id="@+id/ll_login_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="50dp" + android:layout_marginTop="174dp" + android:layout_marginRight="50dp" + android:gravity="center" + android:orientation="vertical"> + + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:background="@drawable/shape_login_input_bg" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingLeft="20dp" + android:paddingTop="12dp" + android:paddingRight="20dp" + android:paddingBottom="12dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="18dp" + android:src="@drawable/icon_login_phone"></ImageView> + + <EditText + android:id="@+id/et_phone" + style="@style/loginInputStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="21dp" + android:hint="璇疯緭鍏ユ偍鐨勬墜鏈哄彿" + android:inputType="phone" /> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="44dp" + android:layout_marginTop="15dp" + android:background="@drawable/shape_login_input_bg" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingLeft="20dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="18dp" + android:src="@drawable/icon_login_code"></ImageView> + + <EditText + android:id="@+id/et_verfication_code" + style="@style/loginInputStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginLeft="18dp" + android:layout_weight="1" + android:digits="@string/rule_number" + android:hint="璇疯緭鍏ユ偍鐨勯獙璇佺爜" + android:inputType="number" /> + + <TextView + android:id="@+id/tv_obtain_verfication_code" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_margin="3dp" + android:background="@drawable/shape_login_send_code_btn" + android:gravity="center" + android:paddingLeft="15dp" + android:paddingRight="15dp" + android:text="鍙戦�侀獙璇佺爜" + android:textColor="#F4DE4A" + android:textSize="13sp"></TextView> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="32dp" + android:orientation="horizontal"> + + + <TextView + android:id="@+id/tv_confirm" + android:layout_width="match_parent" + android:layout_height="44dp" + android:background="@drawable/shape_login_btn" + android:gravity="center" + android:paddingLeft="14dp" + android:paddingRight="14dp" + android:text="鐧诲綍" + android:textColor="#F4DE4A" + android:textSize="17sp" /> + </LinearLayout> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginTop="8dp" + android:orientation="horizontal"> + + <CheckBox + android:id="@+id/cb_user_agreement" + android:layout_width="15dp" + android:layout_height="15dp" + android:layout_gravity="center_vertical" + android:background="@drawable/selector_user_agreement_checkbox" + android:button="@null" + android:checked="false" + android:gravity="center" /> + + <TextView + android:id="@+id/tv_user_agreement" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:text="@string/user_agreement" + android:textColor="@color/blue1" /> + + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center"> + + <TextView + android:id="@+id/tv_login_onekey" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:padding="5dp" + android:text="鏈満鍙风爜涓�閿櫥褰�" + android:textColor="#FFE84D" + android:textSize="11sp"> + + + </TextView> + + </LinearLayout> + + </LinearLayout> + + </ScrollView> + +</LinearLayout> \ No newline at end of file diff --git a/BuWanVideo/res/layout/activity_register.xml b/BuWanVideo/res/layout/activity_register.xml index 14c65f3..003b91c 100644 --- a/BuWanVideo/res/layout/activity_register.xml +++ b/BuWanVideo/res/layout/activity_register.xml @@ -187,7 +187,7 @@ android:layout_gravity="center_vertical" android:background="@drawable/selector_user_agreement_checkbox" android:button="@null" - android:checked="true" + android:checked="false" android:gravity="center" /> <TextView diff --git a/BuWanVideo/res/layout/browser_fengxing_activity.xml b/BuWanVideo/res/layout/browser_fengxing_activity.xml index a325e97..3170078 100644 --- a/BuWanVideo/res/layout/browser_fengxing_activity.xml +++ b/BuWanVideo/res/layout/browser_fengxing_activity.xml @@ -19,6 +19,7 @@ android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical"> + <LinearLayout android:id="@+id/top" android:layout_width="match_parent" @@ -75,8 +76,10 @@ android:paddingRight="10dp" android:text="妯睆" android:textColor="@color/white" - android:textSize="18sp"></TextView> + android:textSize="18sp" + android:visibility="gone"></TextView> </LinearLayout> + <ProgressBar android:id="@+id/myProgressBar" style="?android:attr/progressBarStyleHorizontal" @@ -84,10 +87,18 @@ android:layout_height="3dp" android:background="@color/yellow" android:visibility="gone" /> + <FrameLayout android:id="@+id/fl_webview" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_weight="1"></FrameLayout> + android:layout_weight="1"> + + <WebView + android:id="@+id/webView" + android:layout_width="match_parent" + android:layout_height="match_parent"></WebView> + + </FrameLayout> </LinearLayout> </LinearLayout> \ No newline at end of file diff --git a/BuWanVideo/res/layout/browser_pptv_activity.xml b/BuWanVideo/res/layout/browser_pptv_activity.xml new file mode 100644 index 0000000..299146e --- /dev/null +++ b/BuWanVideo/res/layout/browser_pptv_activity.xml @@ -0,0 +1,46 @@ +<?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/white" + android:orientation="vertical"> + + <View + android:id="@+id/v_status_bar" + android:layout_width="match_parent" + android:layout_height="15dp" + android:background="@color/top_bar_color" /> + + <include layout="@layout/navigation_top_bar" /> + + <ProgressBar + android:id="@+id/myProgressBar" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="match_parent" + android:layout_height="3dp" + android:background="@color/yellow" /> + + + <FrameLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.weikou.beibeivideo.util.x5.X5WebView + android:id="@+id/webview" + android:layout_width="fill_parent" + android:layout_height="fill_parent" /> + + <FrameLayout + android:visibility="gone" + android:id="@+id/fl_ad" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + + </FrameLayout> + + + </FrameLayout> + + +</LinearLayout> \ No newline at end of file diff --git a/BuWanVideo/res/layout/dialog_loading.xml b/BuWanVideo/res/layout/dialog_loading.xml new file mode 100644 index 0000000..2129a80 --- /dev/null +++ b/BuWanVideo/res/layout/dialog_loading.xml @@ -0,0 +1,26 @@ +<?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="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:orientation="vertical"> + + <com.github.ybq.android.spinkit.SpinKitView + android:id="@+id/spin_kit" + style="@style/SpinKitView.Large.Circle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + app:SpinKit_Color="@color/colorLoading" /> + + <TextView + android:id="@+id/tv_msg" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:textColor="@color/colorLoading"></TextView> + + +</LinearLayout> \ No newline at end of file diff --git a/BuWanVideo/res/layout/fragment_player_funshion.xml b/BuWanVideo/res/layout/fragment_player_funshion.xml index d1e839d..3b5d313 100644 --- a/BuWanVideo/res/layout/fragment_player_funshion.xml +++ b/BuWanVideo/res/layout/fragment_player_funshion.xml @@ -33,18 +33,23 @@ </FrameLayout> - <com.lcjian.library.video.VideoPlayerController + <com.yeshi.video.player.common.VideoPlayerController android:id="@+id/vpc_funshion" android:layout_width="match_parent" - android:layout_height="match_parent"></com.lcjian.library.video.VideoPlayerController> + android:layout_height="match_parent"></com.yeshi.video.player.common.VideoPlayerController> <FrameLayout android:id="@+id/fl_ad" - android:background="#000000" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="#000000" android:visibility="gone"> + <ProgressBar + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center"></ProgressBar> + </FrameLayout> </FrameLayout> diff --git a/BuWanVideo/res/layout/item_funshion_gdt_ad_view.xml b/BuWanVideo/res/layout/item_funshion_gdt_ad_view.xml index 3a74aec..6e6736d 100644 --- a/BuWanVideo/res/layout/item_funshion_gdt_ad_view.xml +++ b/BuWanVideo/res/layout/item_funshion_gdt_ad_view.xml @@ -1,72 +1,11 @@ -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.qq.e.ads.nativ.widget.NativeAdContainer xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <RelativeLayout - android:id="@+id/ad_info_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/colorAccent" - android:visibility="gone"> - - <!-- 鍘熺敓骞垮憡鐨勫皬鍥� --> - <ImageView - android:id="@+id/img_logo" - android:layout_width="64dp" - android:layout_height="64dp" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:layout_marginTop="10dp" - android:layout_marginRight="10dp" - android:layout_marginBottom="10dp" /> - - <!-- 鍘熺敓骞垮憡鐨勭偣鍑绘寜閽� --> - <Button - android:id="@+id/btn_download" - android:layout_width="60dp" - android:layout_height="30dp" - android:layout_alignTop="@id/img_logo" - android:layout_alignParentRight="true" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:background="#00000000" - android:textColor="@android:color/white" - android:textSize="14sp" /> - - <!-- 鍘熺敓骞垮憡鐨勬爣棰� --> - <TextView - android:id="@+id/text_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignTop="@id/img_logo" - android:layout_marginLeft="6dp" - android:layout_toLeftOf="@id/btn_download" - android:layout_toRightOf="@id/img_logo" - android:ellipsize="end" - android:singleLine="true" - android:textColor="#e0000000" /> - - <!-- 鍘熺敓骞垮憡鐨勬弿杩� --> - <TextView - android:id="@+id/text_desc" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/text_title" - android:layout_alignBottom="@id/img_logo" - android:layout_marginLeft="6dp" - android:layout_marginRight="6dp" - android:layout_toLeftOf="@id/btn_download" - android:layout_toRightOf="@id/img_logo" - android:ellipsize="end" - android:maxLines="2" - android:textColor="#a0000000" - android:textSize="10px" /> - </RelativeLayout> <FrameLayout - android:id="@+id/custom_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true"> @@ -166,15 +105,16 @@ android:layout_gravity="right|bottom" android:layout_marginRight="3dp" android:layout_marginBottom="15dp" + android:background="@drawable/shape_video_detail_ad_input" android:drawableRight="@drawable/ic_input" android:drawablePadding="5dp" android:paddingLeft="8dp" android:paddingTop="2dp" android:paddingRight="8dp" android:paddingBottom="2dp" - android:background="@drawable/shape_video_detail_ad_input" android:text="浜嗚В璇︽儏" android:textColor="@color/white"></TextView> </FrameLayout> -</LinearLayout> + +</com.qq.e.ads.nativ.widget.NativeAdContainer> diff --git a/BuWanVideo/res/layout/mine_fragment.xml b/BuWanVideo/res/layout/mine_fragment.xml index 59e6664..f03b6fd 100644 --- a/BuWanVideo/res/layout/mine_fragment.xml +++ b/BuWanVideo/res/layout/mine_fragment.xml @@ -76,23 +76,41 @@ </LinearLayout> - <TextView - android:id="@+id/mine_tv_name" + <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="12dp" - android:textColor="#ffdcdcdc" - android:textSize="18sp" - android:visibility="gone" /> + android:layout_marginTop="12dp" + android:layout_marginBottom="10dp" + android:gravity="center_vertical|left"> + + <TextView + android:id="@+id/mine_tv_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="#ffdcdcdc" + android:textSize="18sp" + android:visibility="gone" /> + + <ImageView + android:id="@+id/mine_iv_vip" + android:layout_width="22dp" + android:layout_height="10dp" + android:layout_marginLeft="7.5dp" + android:src="@drawable/icon_vip" + android:visibility="gone"></ImageView> + + </LinearLayout> </LinearLayout> </com.lcjian.library.widget.RatioLayout> <LinearLayout + android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="10dp" + android:orientation="horizontal"> <LinearLayout @@ -100,6 +118,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" + android:gravity="center_horizontal" android:orientation="vertical" android:padding="8dp"> @@ -180,7 +199,8 @@ android:layout_weight="1" android:gravity="center_horizontal" android:orientation="vertical" - android:padding="8dp"> + android:padding="8dp" + android:visibility="gone"> <ImageView android:layout_width="wrap_content" @@ -201,6 +221,45 @@ </LinearLayout> + <LinearLayout + android:id="@+id/ll_vip" + android:layout_margin="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/shape_vip_bg" + android:gravity="center_vertical" + android:orientation="horizontal" + android:padding="9dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/icon_vip_logo"></ImageView> + + <TextView + android:layout_marginLeft="9dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="寮�閫歏IP锛岀湅钃濆厜闄㈢嚎澶х墖!" + android:textColor="#ff885e24" + android:textSize="12sp" /> + + <View + android:layout_width="0dp" + android:layout_height="1dp" + android:layout_weight="1"></View> + + <TextView + android:id="@+id/tv_vip_open" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/shape_vip_open_btn" + android:text="寮�閫氫細鍛�" + android:textColor="#ff885e24" + android:textSize="10sp" /> + + </LinearLayout> + <LinearLayout android:layout_width="match_parent" diff --git a/BuWanVideo/res/values/colors.xml b/BuWanVideo/res/values/colors.xml index 2aca68d..839416f 100644 --- a/BuWanVideo/res/values/colors.xml +++ b/BuWanVideo/res/values/colors.xml @@ -45,6 +45,10 @@ <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> + <color name="colorLoading">#0052F6</color> + + + <color name="videoTitle">#DCDCDC</color> <color name="videoTag">#c0c0c0</color> diff --git a/BuWanVideo/res/values/strings.xml b/BuWanVideo/res/values/strings.xml index 83a35f5..15d1b04 100644 --- a/BuWanVideo/res/values/strings.xml +++ b/BuWanVideo/res/values/strings.xml @@ -1,5 +1,5 @@ <resources> - <string name="app_name">褰辫澶у叏甯冧父</string> + <string name="app_name">褰辫澶у叏</string> <string name="recommend">鎺ㄨ崘</string> <string name="category">鍒嗙被</string> <string name="discover">鍙戠幇</string> @@ -103,6 +103,7 @@ <string name="activity_main_login">绔嬪嵆鐧诲綍</string> <string name="user_agreement">銆婄敤鎴蜂娇鐢ㄥ崗璁��</string> <string name="privacy_policy">銆婇殣绉佹斂绛栥��</string> + <string name="rule_number">0123456789</string> <string name="rule_email">0123456789abcdefghijklmnopqrstuvwxyz@.</string> <string name="rule_password">0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`卢!"拢$%^*()~=#{}[];':,./?/*-_+<>@&</string> <string name="help">甯姪</string> diff --git a/BuWanVideo/src/com/doudou/ysvideo/wxapi/WXEntryActivity.java b/BuWanVideo/src/com/doudou/ysvideo/wxapi/WXEntryActivity.java index d33fa1c..88761e1 100644 --- a/BuWanVideo/src/com/doudou/ysvideo/wxapi/WXEntryActivity.java +++ b/BuWanVideo/src/com/doudou/ysvideo/wxapi/WXEntryActivity.java @@ -1,7 +1,6 @@ package com.doudou.ysvideo.wxapi; -import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.SharedPreferences; @@ -23,7 +22,6 @@ import com.weikou.beibeivideo.BeibeiVideoApplication; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.util.UserUtil; -import com.weikou.beibeivideo.util.novel.NovelJNZUtil; import org.apache.http.Header; import org.json.JSONObject; @@ -136,8 +134,6 @@ edit.putString("sex", user.optString("sex")); edit.commit(); - - NovelJNZUtil.setUid(getApplicationContext()); SingleToast.showToast(getApplicationContext(), "鐧诲綍鎴愬姛"); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java index 28bde51..dc8e570 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java @@ -326,6 +326,88 @@ } /** + * 鐢佃瘽鍙风爜缁戝畾 + * + * @param context + * @param loginUid + * @param phone + * @param code + * @param accessToken + * @param handler + */ + + public static void bindPhone(Context context, String loginUid, String phone, String code, String accessToken, ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "bindPhone"); + params.put("loginUid", loginUid); + if (phone != null) + params.put("phone", phone); + if (code != null) + params.put("code", code); + if (accessToken != null) + params.put("accessToken", accessToken); + commonPost(context, BASE_URL + "user", params, handler); + } + + + /** + * 缁戝畾QQ + * + * @param context + * @param loginUid + * @param name + * @param portrait + * @param openId + * @param handler + */ + public static void bindQQ(Context context, String loginUid, String name, String portrait, String openId, ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "bindQQ"); + params.put("loginUid", loginUid); + if (name != null) + params.put("Name", name); + if (portrait != null) + params.put("Portrait", portrait); + if (openId != null) + params.put("OpenId", openId); + commonPost(context, BASE_URL + "user", params, handler); + } + + + /** + * 鏄惁鍏佽涓�閿櫥褰� + * + * @param context + * @param loginUid + * @param handler + */ + public static void allowOneKeyLogin(Context context, String loginUid, ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "allowOneKeyLogin"); + params.put("loginUid", loginUid); + commonPost(context, BASE_URL + "user", params, handler); + } + + + /** + * 缁戝畾寰俊 + * + * @param context + * @param loginUid + * @param code + * @param handler + */ + public static void bindWX(Context context, String loginUid, String code, ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "bindWX"); + params.put("loginUid", loginUid); + if (code != null) + params.put("code", code); + commonPost(context, BASE_URL + "user", params, handler); + } + + + /** * 鑾峰彇楠岃瘉鐮� * * @param context @@ -338,6 +420,23 @@ params.put("Method", "sendVerifyCode"); params.put("Uid", uid); params.put("Email", name); + commonPost(context, BASE_URL + "user", params, handler); + } + + /** + * 鍙戦�佺粦瀹氶獙璇佺爜 + * + * @param context + * @param loginUid + * @param phone + * @param handler + */ + public static void sendBindVerifyCode(Context context, String loginUid, String phone, + ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "sendBindVerifyCode"); + params.put("loginUid", loginUid); + params.put("phone", phone); commonPost(context, BASE_URL + "user", params, handler); } @@ -371,10 +470,9 @@ public static void getPersonInfo(Context context, String uid, String loginUid, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("Method", "getLoginUserInfo"); params.put("Uid", uid); - params.put("LoginUid", loginUid); - commonPost(context, BASE_URL + "user", params, handler); + params.put("loginUid", loginUid); + commonPost(context, BASE_URL + "user/getUserInfo", params, handler); } /** @@ -388,15 +486,19 @@ String personSign, String portrait, String nickName, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("Method", "updateLoginUserInfo"); params.put("Uid", uid); - params.put("LoginUid", loginUid); - params.put("Sex", sex); - params.put("BirthDay", birthday); - params.put("PersonalSign", personSign); - params.put("Portrait", portrait); - params.put("NickName", nickName); - commonPost(context, BASE_URL + "user", params, handler); + params.put("loginUid", loginUid); + if (sex != null) + params.put("sex", sex); + if (birthday != null) + params.put("birthday", birthday); + if (personSign != null) + params.put("personSign", personSign); + if (portrait != null) + params.put("portrait", portrait); + if (nickName != null) + params.put("nickName", nickName); + commonPost(context, BASE_URL + "user/updateUserInfo", params, handler); } /** @@ -1003,6 +1105,17 @@ } + //鎾斁缁熻 + public static void playStatistic(Context context, String videoId, String resourceId, + ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "playStatistic"); + params.put("VideoId", videoId); + params.put("ResourceId", resourceId); + commonPost(context, BASE_URL + "other", params, handler); + } + + public static void isCollect(Context context, String uid, String videoId, String thirdType, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); @@ -1066,6 +1179,14 @@ } + public static void getFuntvAuthCode(Context context, + ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "getFuntvAuthCode"); + commonPost(context, BASE_URL + "other", params, handler); + } + + public static void getBaiDuNewsTypeList(Context context, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<>(); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java index b96f4ad..48eb81d 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java @@ -5,17 +5,18 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.graphics.Color; +import android.content.SharedPreferences; +import android.os.Handler; +import android.os.Message; import android.support.multidex.MultiDex; import android.util.Log; -import android.widget.Toast; - import com.alibaba.baichuan.android.trade.AlibcTradeSDK; import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; import com.baidu.mobads.AppActivity; import com.fun.xm.FSPlayer; -import com.iBookStar.views.YmConfig; +import com.funshion.playsdk.callback.FunshionPlayInitCallback; +import com.funshion.playsdk.register.IAuthCodeGetter; import com.lcjian.library.util.ManifestDataUtil; import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; import com.nostra13.universalimageloader.core.ImageLoader; @@ -30,14 +31,14 @@ import com.umeng.commonsdk.UMConfigure; import com.umeng.socialize.PlatformConfig; import com.umeng.socialize.UMShareAPI; -import com.weikou.beibeivideo.ui.video.FunshionPlayerFragment; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.CrashHandler; import com.weikou.beibeivideo.util.FunshionConstant; -import com.weikou.beibeivideo.util.UserUtil; import com.weikou.beibeivideo.util.ad.TTAdManagerHolder; import com.weikou.beibeivideo.util.downutil.StringUtils; -import com.weikou.beibeivideo.util.novel.NovelJNZUtil; + +import org.apache.http.Header; +import org.json.JSONObject; public class BeibeiVideoApplication extends Application { @@ -57,6 +58,54 @@ return instance; } + private Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + switch (msg.what) { + case 0: + if (authCodeCallBack != null) + BeibeiVideoAPI.getFuntvAuthCode(application, new BasicTextHttpResponseHandler() { + + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + if (jsonObject.optBoolean("IsPost")) { + String authCode = jsonObject.optString("Data"); + if (!StringUtils.isNullOrEmpty(authCode)) { + SharedPreferences.Editor editor = application.getSharedPreferences("funtv", Context.MODE_PRIVATE).edit(); + editor.putString("authCode", authCode); + editor.commit(); + } + authCodeCallBack.onSuccess(authCode); + } else { + SharedPreferences share = application.getSharedPreferences("funtv", Context.MODE_PRIVATE); + String authCode = share.getString("authCode", ""); + if (!StringUtils.isNullOrEmpty(authCode)) { + authCodeCallBack.onSuccess(authCode); + } + } + } + + @Override + public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { + super.onFailure(statusCode, headers, responseString, throwable); + SharedPreferences share = application.getSharedPreferences("funtv", Context.MODE_PRIVATE); + String authCode = share.getString("authCode", ""); + if (!StringUtils.isNullOrEmpty(authCode)) { + authCodeCallBack.onSuccess(authCode); + } + } + } + ); + + break; + + } + } + }; + + + private IAuthCodeGetter.AuthCodeCallBack authCodeCallBack; @Override public void onCreate() { @@ -88,20 +137,30 @@ initTaoKe(); try { //鍒濆鍖栨挱鏀炬彃浠� - FSPlayer.init(this, FunshionConstant.APICODE); + FSPlayer.init(this, FunshionConstant.APP_ID, new IAuthCodeGetter() { + @Override + public void getAuthCode(AuthCodeCallBack authCodeCallBack) { + BeibeiVideoApplication.this.authCodeCallBack = authCodeCallBack; + handler.sendEmptyMessage(0); + } + }, new FunshionPlayInitCallback() { + + @Override + public void onSuccess() { + Log.i(TAG, "椋庤鎾斁鍣ㄥ垵濮嬪寲鎴愬姛"); + } + + @Override + public void onFail(int i, String s) { + Log.i(TAG, "椋庤鎾斁鍣ㄥ垵濮嬪寲澶辫触锛�" + i + "-" + s); + } + }); } catch (Exception e) { } //鐧惧害鍐呭鑱旂洘 try { AppActivity.setActionBarColorTheme(AppActivity.ActionBarColorTheme.ACTION_BAR_BLACK_THEME); - } catch (Exception e) { - - } - try { - //鑱氳兘璧� - YmConfig.initNovel(this, "8845"); - NovelJNZUtil.setUid(this); } catch (Exception e) { } @@ -132,8 +191,11 @@ @Override public void onFailure(int code, String msg) { + Log.i(TAG,"鐧惧窛鍒濆鍖栧け璐ワ細"+code+"-"+msg); } }); + + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/entity/PlayUrl.java b/BuWanVideo/src/com/weikou/beibeivideo/entity/PlayUrl.java index 7a0d5a6..7981b75 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/entity/PlayUrl.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/entity/PlayUrl.java @@ -21,24 +21,35 @@ private String aid;//涓撹緫ID @Expose private String vid;//瑙嗛ID + @Expose + private String code;//椋庤Code - public String getAid() { - return aid; - } - public void setAid(String aid) { - this.aid = aid; - } + public String getCode() { + return code; + } - public String getVid() { - return vid; - } + public void setCode(String code) { + this.code = code; + } - public void setVid(String vid) { - this.vid = vid; - } + public String getAid() { + return aid; + } - public VideoResource getResource() { + public void setAid(String aid) { + this.aid = aid; + } + + public String getVid() { + return vid; + } + + public void setVid(String vid) { + this.vid = vid; + } + + public VideoResource getResource() { return resource; } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/entity/video/ChangeVideoEvent.java b/BuWanVideo/src/com/weikou/beibeivideo/entity/video/ChangeVideoEvent.java new file mode 100644 index 0000000..be24588 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/entity/video/ChangeVideoEvent.java @@ -0,0 +1,25 @@ +package com.weikou.beibeivideo.entity.video; + +import com.weikou.beibeivideo.entity.VideoInfo; + +public class ChangeVideoEvent { + private VideoInfo videoInfo; + + private String tag; + + public VideoInfo getVideoInfo() { + return videoInfo; + } + + public void setVideoInfo(VideoInfo videoInfo) { + this.videoInfo = videoInfo; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/entity/vo/UserInfoVO.java b/BuWanVideo/src/com/weikou/beibeivideo/entity/vo/UserInfoVO.java new file mode 100644 index 0000000..6aad90a --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/entity/vo/UserInfoVO.java @@ -0,0 +1,138 @@ +package com.weikou.beibeivideo.entity.vo; + +import java.io.Serializable; + +public class UserInfoVO implements Serializable { + private String id; + private String nickName; + private String portrait; + private String sex; + private String birthday; + private String sign; + + private String pptvUid; + //缁戝畾鐨勭數璇濆彿鐮� + + private String qqOpenId; + private String qqNickName; + private String wxUnionId; + private String wxName; + private String phone; + private String email; + + //VIP鍒版湡鏃堕棿 + private Long vipExpireTime; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getPortrait() { + return portrait; + } + + public void setPortrait(String portrait) { + this.portrait = portrait; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getPptvUid() { + return pptvUid; + } + + public void setPptvUid(String pptvUid) { + this.pptvUid = pptvUid; + } + + public String getQqOpenId() { + return qqOpenId; + } + + public void setQqOpenId(String qqOpenId) { + this.qqOpenId = qqOpenId; + } + + public String getQqNickName() { + return qqNickName; + } + + public void setQqNickName(String qqNickName) { + this.qqNickName = qqNickName; + } + + public String getWxUnionId() { + return wxUnionId; + } + + public void setWxUnionId(String wxUnionId) { + this.wxUnionId = wxUnionId; + } + + public String getWxName() { + return wxName; + } + + public void setWxName(String wxName) { + this.wxName = wxName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Long getVipExpireTime() { + return vipExpireTime; + } + + public void setVipExpireTime(Long vipExpireTime) { + this.vipExpireTime = vipExpireTime; + } +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java index bf896e4..885b713 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java @@ -34,11 +34,14 @@ import com.weikou.beibeivideo.BeibeiVideoApplication; import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.entity.ad.AdTypeVO; +import com.weikou.beibeivideo.ui.dialog.UserProtocolDialog; import com.weikou.beibeivideo.ui.main.MainActivity; import com.weikou.beibeivideo.util.BeibeiConstant; +import com.weikou.beibeivideo.util.ConfigUtil; import com.weikou.beibeivideo.util.GlideRoundTransform; import com.weikou.beibeivideo.util.PermissionsChecker; import com.weikou.beibeivideo.util.SDCardUtil; +import com.weikou.beibeivideo.util.UserUtil; import com.weikou.beibeivideo.util.ad.AdUtil; import com.weikou.beibeivideo.util.ad.CSJConstant; import com.weikou.beibeivideo.util.ad.GDTConstant; @@ -123,16 +126,52 @@ SDCardUtil.initStorage(this); //鍒濆鍖栦竴娆anner锛屽惁鍒欏悗闈anner浣跨敤鏃朵細鍑虹幇鍗¢】 // new BannerView(SplashActivity.this, ADSize.BANNER, BeibeiConstant.GDT_ID, BeibeiConstant.GDT_PLAYER_DETAIL); - - vg_ad.post(new Runnable() { - @Override - public void run() { - myRequetPermission(); - } - }); - + //寮圭敤鎴峰崗璁 + showProtocol(); } + + private void showProtocol() { + String data = "鎰熻阿鎮ㄥ" + getResources().getString(R.string.app_name) + "涓�鐩翠互鏉ョ殑淇′换锛�<br>"; + data += "鎴戜滑渚濈収鏂扮殑鐩戠瑕佹眰鏉′緥鏇存柊浜�"; + data += String.format("<a href='%s'>銆婇殣绉佹斂绛栥��</a>鍜�", BeibeiConstant.PRIVACY_POLICY); + data += String.format("<a href='%s'>銆婄敤鎴峰崗璁��</a>", BeibeiConstant.USER_AGREEMENT); + data += "涓洪噰鍙栫浉搴斿畨鍏ㄤ繚鎶ゆ帾鏂斤紝灏藉姏淇濇姢鎮ㄧ殑涓汉淇℃伅瀹夊叏鍙帶锛岀壒鍚戜綘璇存槑濡備笅锛�<br>" + + "1銆佹偍鍦ㄤ娇鐢�" + getResources().getString(R.string.app_name) + "鍚勯」浜у搧鎴栨湇鍔℃椂锛屽皢浼氭彁渚涗笌鍏蜂綋鍔熻兘鐩稿叧鐨勪釜浜轰俊鎭紙鍙兘娑夊強甯愬彿銆佷綅缃�佸瓨鍌ㄧ瓑淇℃伅锛夈��<br>" + + "2銆佹偍鍙互闅忔椂鏌ヨ銆佹洿姝c�佸垹闄ゆ偍鐨勪釜浜轰俊鎭紝鎴戜滑涔熸彁渚涜处鎴锋敞閿�鐨勬笭閬撱��<br>" + + "3銆佹湭缁忔偍鐨勫啀娆″悓鎰忥紝鎴戜滑涓嶄細灏嗕笂杩颁俊鎭敤浜庢偍鏈巿鏉冪殑鍏朵粬鐢ㄩ�旀垨鐩殑銆�<br>" + + "4銆佹湭缁忕洃鎶や汉鍚屾剰锛屾垜浠笉浼氭敹闆嗕娇鐢�14鍛ㄥ瞾浠ヤ笅锛堝惈14鍛ㄥ瞾锛夋湭鎴愬勾浜轰釜浜轰俊鎭紝涓斾笉浼氬埄鐢ㄥ叾淇℃伅鎺ㄩ�佹柊闂汇�佹椂鏀夸俊鎭�佸箍鍛婄瓑瀹氬悜鎺ㄩ�佹椿鍔ㄣ��"; + + if (!UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application) && !BeibeiConstant.IS_TEST) { + new UserProtocolDialog.Builder(this).setNegativeButton("涓嶅悓鎰�", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + SplashActivity.this.finish(); + } + }).setPositiveButton("鍚屾剰骞剁户缁�", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + UserUtil.agreeUserProtocol(BeibeiVideoApplication.application); + //璇锋眰鏉冮檺 + vg_ad.post(new Runnable() { + @Override + public void run() { + myRequetPermission(); + } + }); + } + }).setData(data).create().show(); + } else { + //璇锋眰鏉冮檺 + vg_ad.post(new Runnable() { + @Override + public void run() { + myRequetPermission(); + } + }); + } + } @Override public void onResume() { @@ -477,6 +516,8 @@ if (jsonObject.getBoolean("IsPost")) { JSONObject data = jsonObject.getJSONObject("Data"); JSONObject ad = data.optJSONObject("adNew"); + String vipLink = data.optString("vipLink"); + AdUtil.saveAdConfig(getApplicationContext(), ad); AdUtil.AD_TYPE splash = AdUtil.getAdType(getApplicationContext(), AdUtil.POSITION_SPLASH); String pid = AdUtil.getAdPid(getApplicationContext(), AdUtil.POSITION_SPLASH); @@ -489,7 +530,7 @@ } } } - + ConfigUtil.saveVipLink(getApplicationContext(), vipLink); loadSplashAd(splash, pid); } } else { diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/VBrowserActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/VBrowserActivity.java index b1c6703..fc605c7 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/VBrowserActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/VBrowserActivity.java @@ -12,7 +12,6 @@ import android.os.Message; import android.support.v4.app.NotificationCompat; import android.util.Log; -import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -21,14 +20,9 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; -import android.widget.LinearLayout.LayoutParams; -import android.widget.RemoteViews; import android.widget.Toast; -import com.lcjian.library.RetainViewFragment; import com.lcjian.library.util.ManifestDataUtil; -import com.lcjian.library.util.SystemCommon; -import com.weikou.beibeivideo.ui.mine.FXBrowserActivity; import com.weikou.beibeivideo.util.downutil.DownFiles; import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; import com.weikou.beibeivideo.R; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/PlayVideoPreADFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/PlayVideoPreADFragment.java index 47a8fd9..2cfa1fd 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/PlayVideoPreADFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/PlayVideoPreADFragment.java @@ -147,13 +147,16 @@ public void loadVideoAD(IVideoAdListener videoAdListener, PlayVideoPreADSetting setting) { if (setting == null) setting = PlayVideoPreADSetting.PlayVideoPreADSettingFactory.createDefault(); - Log.i(TAG,"loadVideoAD"); + Log.i(TAG, "loadVideoAD"); + if (tv_skip == null) + return; tv_skip.setVisibility(View.GONE); if (mGDTAdData != null) mGDTAdData.destroy(); pb_progress.setVisibility(View.VISIBLE); String pid = setting.getGdtPid(); //TODO 闇�瑕佸崟鐙垽鏂� + if (AdUtil.getAdType(getContext(), AdUtil.POSITION_VIDEO_PLAY_PRE) != AdUtil.AD_TYPE.gdt) pid = BeibeiConstant.GDT_DOWNLOAD_HINT_ID; @@ -234,7 +237,7 @@ * @param videoAdListener */ private void loadGDT(String appId, String pid, IVideoAdListener videoAdListener) { - Log.i(TAG,"loadGDT"); + Log.i(TAG, "loadGDT"); fl_ad.setVisibility(View.GONE); mContainer.setVisibility(View.VISIBLE); NativeUnifiedAD mAdManager = new NativeUnifiedAD(getContext(), appId, pid, new NativeADUnifiedListener() { @@ -250,7 +253,7 @@ @Override public void onADLoaded(List<NativeUnifiedADData> list) { - Log.i(TAG,"onADLoaded"); + Log.i(TAG, "onADLoaded"); final NativeUnifiedADData ad = list.get(0); //濉厖鍐呭 mGDTAdData = ad; @@ -265,7 +268,7 @@ @Override public void run() { if (pb_progress.getVisibility() == View.VISIBLE) { - Log.i(TAG,"playErrorRunnable"); + Log.i(TAG, "playErrorRunnable"); mGDTAdData.destroy(); if (videoAdListener != null) { videoAdListener.finishPlay(); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/common/LiveBrowserActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/common/LiveBrowserActivity.java index c0c5b1e..4c90ba7 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/common/LiveBrowserActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/common/LiveBrowserActivity.java @@ -21,14 +21,12 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.LinearLayout; -import android.widget.RemoteViews; import android.widget.TextView; import android.widget.Toast; import com.lcjian.library.util.ManifestDataUtil; import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.ui.BaseActivity; -import com.weikou.beibeivideo.ui.mine.FXBrowserActivity; import com.weikou.beibeivideo.util.downutil.DownFiles; import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/dialog/LoadingDialogUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/dialog/LoadingDialogUtil.java new file mode 100644 index 0000000..f720400 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/dialog/LoadingDialogUtil.java @@ -0,0 +1,106 @@ +package com.weikou.beibeivideo.ui.dialog; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.content.SharedPreferences; +import android.graphics.drawable.Drawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.TextView; + +import com.alibaba.fastjson.JSONObject; +import com.bumptech.glide.GenericTransitionOptions; +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.lcjian.library.util.common.StringUtils; +import com.lcjian.library.util.common.TimeUtil; +import com.weikou.beibeivideo.R; +import com.weikou.beibeivideo.entity.JumpDetail; +import com.weikou.beibeivideo.util.JumpActivityUtil; + +/** + * 鐢ㄦ埛鍗忚寮规 + */ +public class LoadingDialogUtil { + + private static Dialog pd; + + public static void show(Context context) { + show(context, "", false); + } + + public static void show(Context context, String msg, boolean cancelable) { + try { + dismiss(); + //鎷垮埌dialog + pd = getLoadingDialog(context, msg); + //璁剧疆鐐瑰嚮澶栧洿鏄惁娑堝け + pd.setCancelable(cancelable); + pd.show(); + } catch (Exception e) { + } + } + + //杩欓噷鐨勫姞杞芥晥鏋滆嚜宸遍殢鎰忓畾涔� + public static Dialog getLoadingDialog(Context context, String msg) { + Dialog loading_dialog = new Dialog(context, R.style.Dialog); + View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null); + TextView tv_msg = view.findViewById(R.id.tv_msg); + if (StringUtils.isEmpty(msg)) { + tv_msg.setVisibility(View.GONE); + } else { + tv_msg.setText(msg); + tv_msg.setVisibility(View.VISIBLE); + } + loading_dialog.setContentView(view); + loading_dialog.getWindow().setBackgroundDrawableResource(R.color.transparent); + loading_dialog.setCancelable(false); + return loading_dialog; + } + + + //鍦ㄨ繖閲岀洿鎺ュ仛浜嗗垽鏂紝澶ц儐鐨勬斁蹇冪殑浣跨敤锛屼繚璇佷笉浼氬嚭鐜扮┖鎸囬拡 + public static void dismiss() { + try { + if (pd != null && pd.isShowing()) { + pd.dismiss(); + } + pd = null; + } catch (Exception e) { + // TODO: handle exception + } finally { + pd = null; + } + } + + + public static boolean isShowing() { + try { + if (pd != null) { + return pd.isShowing(); + } + } catch (Exception e) { + // TODO: handle exception + } + return false; + } + + /** + * 璁剧疆dialog鐐瑰嚮澶栭儴鏄惁鍙互娑堝け + */ + public static void setCanceledOnTouchOutside(boolean b) { + try { + if (pd != null && pd.isShowing()) { + pd.setCanceledOnTouchOutside(b); + } + } catch (Exception e) { + // TODO: handle exception + } + + } + + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/LoginActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/LoginActivity.java index b06c4a2..0f6937f 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/LoginActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/LoginActivity.java @@ -12,19 +12,16 @@ import android.os.Handler; import android.os.Message; import android.util.Log; -import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.CheckBox; import android.widget.EditText; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import android.widget.Toast; -import com.google.gson.Gson; import com.lcjian.library.util.SingleToast; import com.lcjian.library.util.common.StringUtils; import com.tencent.mm.opensdk.modelmsg.SendAuth; @@ -32,16 +29,14 @@ import com.umeng.socialize.UMAuthListener; import com.umeng.socialize.UMShareAPI; import com.umeng.socialize.bean.SHARE_MEDIA; -import com.umeng.socialize.utils.SocializeUtils; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; import com.weikou.beibeivideo.BeibeiVideoApplication; +import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.ui.mine.BrowserActivity; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.XGPush; -import com.weikou.beibeivideo.R; -import com.weikou.beibeivideo.util.novel.NovelJNZUtil; import org.apache.http.Header; import org.json.JSONException; @@ -97,7 +92,7 @@ findViewById(R.id.login_tv_cancel).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - finish(); + onResult(RESULT_CANCELED); } }); @@ -125,9 +120,13 @@ public void onClick(View v) { switch (v.getId()) { case R.id.login_tv_cancel:// 鍙栨秷 - finish(); + onResult(RESULT_CANCELED); break; case R.id.ll_login_qq:// QQ鐧诲綍 + if (!cb_user_agreement.isChecked()) { + SingleToast.showToast(LoginActivity.this, "閫夋嫨鍚屾剰鐢ㄦ埛鍗忚鍚庢柟鍙櫥褰�"); + break; + } if (isQQClientAvailable()) { loginType = "1"; // qq鐧诲綍閫昏緫澶勭悊 鐐瑰嚮鐧诲綍鍚庨渶瑕佹殏鏃堕攣瀹氳繑鍥為敭鍜岃繑鍥炲姛鑳� 涓嶇劧浼氭姤閿� @@ -139,6 +138,10 @@ break; case R.id.ll_login_wx://寰俊鐧诲綍 + if (!cb_user_agreement.isChecked()) { + SingleToast.showToast(LoginActivity.this, "閫夋嫨鍚屾剰鐢ㄦ埛鍗忚鍚庢柟鍙櫥褰�"); + break; + } if (isWXClientAvailable()) { loginType = "2"; SendAuth.Req req = new SendAuth.Req(); @@ -241,12 +244,10 @@ data.get("gender")); edit.commit(); - NovelJNZUtil.setUid(getApplicationContext()); - SingleToast.showToast(LoginActivity.this, "鐧诲綍鎴愬姛"); XGPush.registerPush(LoginActivity.this); - finish(); + onResult(RESULT_OK); } @Override @@ -312,7 +313,7 @@ jsonObject.optJSONObject("Data").optString("Nickname")); edit.commit(); SingleToast.showToast(LoginActivity.this, "鐧诲綍鎴愬姛" + "鏄电О涓�:" + jsonObject.optJSONObject("Data").optString("Nickname")); - finish(); + onResult(RESULT_OK); } else { SingleToast.showToast(LoginActivity.this, "鐧诲綍澶辫触"); } @@ -331,7 +332,7 @@ public void onResume() { super.onResume(); if (!StringUtils.isEmpty(getSharedPreferences("user", Context.MODE_PRIVATE).getString("LoginUid", ""))) { - finish(); + onResult(RESULT_OK); } MobclickAgent.onPageStart("鐧诲綍椤�"); } @@ -398,12 +399,10 @@ response.getString("gender")); edit.commit(); - NovelJNZUtil.setUid(getApplicationContext()); - SingleToast.showToast(LoginActivity.this, "鐧诲綍鎴愬姛"); XGPush.registerPush(LoginActivity.this); - finish(); + onResult(RESULT_OK); } @Override @@ -430,4 +429,19 @@ } } }; + + + private void onResult(int resultCode) { + boolean result = getIntent().getBooleanExtra("result", false); + if (result) { + Intent intent = new Intent(); + //鎶婅繑鍥炴暟鎹瓨鍏ntent + setResult(resultCode, intent); + //鍏抽棴Activity + finish(); + } else { + //鍏抽棴Activity + finish(); + } + } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PersonInfoActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PersonInfoActivity.java index 83c1000..cc15811 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PersonInfoActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PersonInfoActivity.java @@ -22,16 +22,19 @@ import android.widget.TextView; import com.bumptech.glide.Glide; +import com.google.gson.Gson; import com.lcjian.library.util.Environment; import com.lcjian.library.util.SingleToast; import com.lcjian.library.util.common.StringUtils; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.entity.vo.UserInfoVO; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.GlideCircleTransform; import com.weikou.beibeivideo.util.SelectPicUtil; import com.weikou.beibeivideo.R; +import com.weikou.beibeivideo.util.UserUtil; import org.apache.http.Header; import org.json.JSONObject; @@ -66,9 +69,9 @@ protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.activity_person_info); - /* + /* * 璁$畻鐘舵�佹爮楂樺害骞惰缃� - */ + */ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { int result = 0; int resourceId = getResources().getIdentifier("status_bar_height", @@ -113,11 +116,15 @@ @Override public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { if (jsonObject.optBoolean("IsPost")) { - Glide.with(PersonInfoActivity.this).load(BeibeiConstant.addPreFix(jsonObject.optJSONObject("Data").optString("Portrait"))).placeholder(R.drawable.ic_portrait_default).error(R.drawable.ic_portrait_default).into(iv_portrait); - tv_nickName.setText(jsonObject.optJSONObject("Data").optString("Nickname")); - tv_birthday.setText(jsonObject.optJSONObject("Data").optString("Birthday")); - tv_sex.setText(Integer.parseInt(jsonObject.optJSONObject("Data").optString("Sex")) == 0 ? "濂�" : "鐢�"); - sign = jsonObject.optJSONObject("Data").optString("Sign"); + JSONObject data = jsonObject.optJSONObject("Data"); + UserInfoVO userInfoVO = new Gson().fromJson(data.toString(), UserInfoVO.class); + + Glide.with(PersonInfoActivity.this).load(BeibeiConstant.addPreFix(userInfoVO.getPortrait())). + placeholder(R.drawable.ic_portrait_default).error(R.drawable.ic_portrait_default).into(iv_portrait); + tv_nickName.setText(userInfoVO.getNickName()); + tv_birthday.setText(userInfoVO.getBirthday()); + tv_sex.setText(Integer.parseInt(userInfoVO.getSex()) == 0 ? "濂�" : "鐢�"); + sign = userInfoVO.getSign(); tv_autograph.setText(sign); } } @@ -148,7 +155,8 @@ imgBase64 = bitmapToBase64(bm); Log.i("mresult", "鍥剧墖璺姴涓�:" + path + "----requestcode:" + requestCode); Glide.with(PersonInfoActivity.this).load(file).transform(new GlideCircleTransform(PersonInfoActivity.this)).into(iv_portrait); - + //涓婁紶 + updatePersonInfo(null, null, null, imgBase64, null); } } } @@ -251,30 +259,25 @@ getAutograph(); break; case R.id.tv_top_right://瀹屾垚涓汉淇℃伅鐨勪慨鏀� - upLoadRegisterData(); break; } } - /** - * 涓婁紶涓汉淇℃伅 - */ - private void upLoadRegisterData() { + + private void updatePersonInfo(String sex, String birthday, + String personSign, String portrait, String nickName) { SharedPreferences sp = getSharedPreferences("user", Context.MODE_PRIVATE); - String uid = sp.getString("uid", ""); - String loginUid = sp.getString("LoginUid", ""); - BeibeiVideoAPI.upLoadPersonInfo(this, uid, loginUid, mSex + "", tv_birthday.getText().toString(), - tv_autograph.getText().toString(), imgBase64, tv_nickName.getText().toString(), new BasicTextHttpResponseHandler() { + String uid = UserUtil.getUid(this); + String loginUid = UserUtil.getLoginUid(this); + BeibeiVideoAPI.upLoadPersonInfo(this, uid, loginUid, sex, birthday, + personSign, portrait, nickName, new BasicTextHttpResponseHandler() { @Override public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { if (jsonObject.optBoolean("IsPost")) { SharedPreferences sharedPreferences = getSharedPreferences("user", Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); - editor.putString("name", tv_nickName.getText().toString()); + editor.putString("name", nickName); editor.commit(); - - SingleToast.showToast(PersonInfoActivity.this, "涓汉淇℃伅鏇存柊鎴愬姛"); - finish(); } } }); @@ -298,6 +301,7 @@ public void onClick(DialogInterface dialog, int which) { Log.i("mResult", "which鐨勫�间负锛�" + which); tv_sex.setText(sex[mSex]); + updatePersonInfo(mSex + "", null, null, null, null); dialog.dismiss(); } }) @@ -338,6 +342,7 @@ return; } else { tv_autograph.setText(str); + updatePersonInfo(null, null, str, null, null); alertDialog.dismiss(); } } @@ -358,6 +363,7 @@ SingleToast.showToast(PersonInfoActivity.this, "鏄电О涓嶈兘涓虹┖"); } else { tv_nickName.setText(str); + updatePersonInfo(null, null, null, null, str); dialog.dismiss(); } } @@ -406,6 +412,7 @@ @Override public void onClick(View v) { tv_birthday.setText(date); + updatePersonInfo(null, date, null, null, null); alertDialog.dismiss(); } }); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java new file mode 100644 index 0000000..f044b37 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java @@ -0,0 +1,461 @@ +package com.weikou.beibeivideo.ui.login; + +import android.app.Dialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.graphics.Paint; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.LinearLayout.LayoutParams; +import android.widget.TextView; +import android.widget.Toast; + +import com.cmic.sso.sdk.AuthRegisterViewConfig; +import com.lcjian.library.util.SingleToast; +import com.lcjian.library.util.common.StringUtils; +import com.mobile.auth.gatewayauth.AuthUIConfig; +import com.mobile.auth.gatewayauth.CustomInterface; +import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper; +import com.mobile.auth.gatewayauth.ResultCode; +import com.mobile.auth.gatewayauth.TokenResultListener; +import com.mobile.auth.gatewayauth.model.TokenRet; +import com.tencent.mm.opensdk.modelmsg.SendAuth; +import com.umeng.analytics.MobclickAgent; +import com.umeng.socialize.UMAuthListener; +import com.umeng.socialize.UMShareAPI; +import com.umeng.socialize.bean.SHARE_MEDIA; +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.BeibeiVideoApplication; +import com.weikou.beibeivideo.R; +import com.weikou.beibeivideo.ui.BaseActivity; +import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; +import com.weikou.beibeivideo.ui.mine.BrowserActivity; +import com.weikou.beibeivideo.util.BeibeiConstant; +import com.weikou.beibeivideo.util.DimenUtils; +import com.weikou.beibeivideo.util.IsEmail; +import com.weikou.beibeivideo.util.UserUtil; +import com.weikou.beibeivideo.util.XGPush; + +import org.apache.http.Header; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.Matcher; + +public class PhoneLoginActivity extends BaseActivity implements OnClickListener, TokenResultListener { + + private final static String TAG = "PhoneLoginActivity"; + + private PhoneNumberAuthHelper mPhoneNumberAuthHelper; + + private TextView tv_login_onekey, tv_obtain_verfication_code, tv_title; + + private EditText et_phone, et_verfication_code; + + private CheckBox cb_user_agreement; + + private boolean showOneKeyLoginToast = false; + + private boolean login; + + private Dialog loadingDialog; + + private void initView() { + loadingDialog = LoadingDialogUtil.getLoadingDialog(this, ""); + + tv_login_onekey = findViewById(R.id.tv_login_onekey); + tv_obtain_verfication_code = findViewById(R.id.tv_obtain_verfication_code); + et_phone = findViewById(R.id.et_phone); + tv_login_onekey = findViewById(R.id.tv_login_onekey); + tv_login_onekey = findViewById(R.id.tv_login_onekey); + cb_user_agreement = findViewById(R.id.cb_user_agreement); + et_verfication_code = findViewById(R.id.et_verfication_code); + tv_title = findViewById(R.id.tv_title); + tv_login_onekey.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //涓嬪垝绾� + tv_login_onekey.getPaint().setAntiAlias(true);//鎶楅敮榻� + + + tv_obtain_verfication_code.setOnClickListener(this); + tv_login_onekey.setOnClickListener(this); + findViewById(R.id.tv_confirm).setOnClickListener(this); + findViewById(R.id.tv_back).setOnClickListener(this); + } + + private void initOneKeyLogin() { + if (!loadingDialog.isShowing()) { + loadingDialog.show(); + } + sdkInit(BeibeiConstant.ALIYUN_ONE_KEY_LOGIN_SECRETINFO); + initUI(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.act_phone_login); + /* + * 璁$畻鐘舵�佹爮楂樺害骞惰缃� + */ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + int result = 0; + int resourceId = getResources().getIdentifier("status_bar_height", + "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, + result); + findViewById(R.id.v_status_bar).setLayoutParams(params); + } else { + findViewById(R.id.v_status_bar).setVisibility(View.GONE); + } + initView(); + login = getIntent().getBooleanExtra("login", false); + tv_title.setText(login ? "鐧诲綍" : "缁戝畾鎵嬫満鍙�"); + + + openOneKeyLogin(false); + + } + + + private synchronized void openOneKeyLogin(final boolean notify) { + BeibeiVideoAPI.allowOneKeyLogin(this, UserUtil.getLoginUid(this), new BasicTextHttpResponseHandler() { + + @Override + public void onStart() { + if (loadingDialog != null && !loadingDialog.isShowing()) { + loadingDialog.show(); + } + } + + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + if (jsonObject.optBoolean("IsPost")) { + initOneKeyLogin(); + //妫�娴嬬幆澧� + mPhoneNumberAuthHelper.checkEnvAvailable(2); + } else { + if (notify) { + Toast.makeText(PhoneLoginActivity.this, jsonObject.optString("Error"), Toast.LENGTH_SHORT).show(); + } + } + } + + @Override + public void onFinish() { + if (loadingDialog != null && loadingDialog.isShowing()) { + loadingDialog.dismiss(); + } + } + }); + + + } + + private void initUI() { + + int width = DimenUtils.getScreenWidth(this); + int widthDP = DimenUtils.px2dip(this, width); + AuthUIConfig uiCOnfig = new AuthUIConfig.Builder() + .setPageBackgroundPath("shape_login_onkey_bg") + + .setNavText("") + .setNavColor(Color.WHITE) + .setNavHidden(false) + .setNavReturnImgPath("ic_login_close") + .setNavReturnImgWidth(22) + .setNavReturnImgHeight(22) + .setNavReturnScaleType(ImageView.ScaleType.FIT_XY) + .setWebNavColor(Color.BLACK) + .setWebNavReturnImgPath("ic_back_two") + .setWebViewStatusBarColor(Color.BLACK) + .setStatusBarColor(Color.BLACK) + + .setLogoWidth(147) + .setLogoHeight(36) + .setLogoImgPath("ic_login_logo") + .setLogoOffsetY(24 - 10) + + .setSloganOffsetY(171 - 10) + .setSloganTextSize(12) + .setSloganTextColor(Color.parseColor("#F4DE4A")) + + .setLogBtnText("饧�閿櫥褰�") + .setLogBtnTextSize(17) + .setLogBtnTextColor(Color.parseColor("#F4DE4A")) + .setLogBtnBackgroundPath("shape_login_btn") + .setLogBtnOffsetY(229 - 10) + .setLogBtnHeight(44) + + + .setDialogWidth(305 * widthDP / 375) + .setDialogHeight(454) + .setNavColor(Color.RED) + .setSwitchAccHidden(true) + .setNumberColor(Color.WHITE) + .setNumberSize(36) + .setNumFieldOffsetY(128 - 10) + + .setAppPrivacyOne("銆婄敤鎴锋湇鍔″崗璁��", BeibeiConstant.USER_AGREEMENT) + .setAppPrivacyTwo("銆婇殣绉佹斂绛栥��", BeibeiConstant.PRIVACY_POLICY) + .setAppPrivacyColor(Color.parseColor("#B3B8D3"), Color.parseColor("#51B3FF")) + .setPrivacyBefore("鐧诲綍鍗宠〃绀哄悓鎰�") + .setPrivacyEnd("") + .setCheckedImgPath("ic_login_privacy_checked") + .setPrivacyTextSize(11) + .setPrivacyState(true) + .setVendorPrivacyPrefix("銆�") + .setVendorPrivacySuffix("銆�") + .create(); + + mPhoneNumberAuthHelper.setAuthUIConfig(uiCOnfig); + } + + + public void sdkInit(String secretInfo) { + mPhoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(this, this); + mPhoneNumberAuthHelper.getReporter().setLoggerEnable(true); + mPhoneNumberAuthHelper.setAuthSDKInfo(secretInfo); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.tv_back: + finish(); + break; + case R.id.tv_user_agreement: + Intent intent = new Intent(this, BrowserActivity.class); + intent.putExtra("url", BeibeiConstant.USER_AGREEMENT); + startActivity(intent); + break; + case R.id.tv_obtain_verfication_code: + String phone = et_phone.getText().toString(); + if (!StringUtils.isMobileNumber(phone)) { + SingleToast.showToast(this, "璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜"); + break; + } + tv_obtain_verfication_code.setEnabled(false); + sendBindVerifyCode(phone); + break; + + case R.id.tv_confirm: + if (!cb_user_agreement.isChecked()) { + SingleToast.showToast(this, "璇峰悓鎰忋�婄敤鎴蜂娇鐢ㄥ崗璁��"); + break; + } + + String phone1 = et_phone.getText().toString(); + String verficationCode = et_verfication_code.getText().toString(); + if (!StringUtils.isMobileNumber(phone1)) { + SingleToast.showToast(this, "璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜"); + return; + } + if (StringUtils.isEmpty(verficationCode)) { + SingleToast.showToast(this, "楠岃瘉鐮佷笉鑳戒负绌�"); + return; + } + bindPhone(null); + break; + + case R.id.tv_login_onekey: + openOneKeyLogin(true); + break; + } + } + + + @Override + public void onTokenSuccess(String s) { + Log.i(TAG, "onTokenSuccess锛�" + s); + TokenRet tokenRet = null; + try { + tokenRet = TokenRet.fromJson(s); + + switch (tokenRet.getCode()) { + case ResultCode.CODE_ERROR_ENV_CHECK_SUCCESS: + Log.i(TAG, "缁堢鐜鏍¢獙鎴愬姛锛�" + s); + mPhoneNumberAuthHelper.getLoginToken(PhoneLoginActivity.this, 5000); + break; + + case ResultCode.CODE_START_AUTHPAGE_SUCCESS: + Log.i(TAG, "鍞よ捣鎺堟潈椤垫垚鍔燂細" + s); + if (loadingDialog.isShowing()) { + loadingDialog.dismiss(); + } + break; + + case ResultCode.CODE_SUCCESS: + bindPhone(tokenRet.getToken()); + Log.i(TAG, "鑾峰彇token鎴愬姛锛�" + s); + mPhoneNumberAuthHelper.setAuthListener(null); + break; + } + } catch (Exception e) { + e.printStackTrace(); + } + + showOneKeyLoginToast = true; + } + + @Override + public void onTokenFailed(String s) { + if (loadingDialog.isShowing()) { + loadingDialog.dismiss(); + } + Log.i(TAG, "onTokenFailed锛�" + s); + TokenRet tokenRet = null; + try { + tokenRet = TokenRet.fromJson(s); + + switch (tokenRet.getCode()) { + //鐢ㄦ埛涓诲姩鍙栨秷 + case ResultCode.CODE_ERROR_USER_CANCEL: + break; + case ResultCode.CODE_ERROR_NO_SIM_FAIL: + case ResultCode.CODE_ERROR_NO_MOBILE_NETWORK_FAIL: + if (showOneKeyLoginToast) { + Toast.makeText(this, "璇锋墦寮�绉诲姩缃戠粶", Toast.LENGTH_SHORT).show(); + } + break; + default: + if (showOneKeyLoginToast) { + Toast.makeText(this, "鏆傛棤娉曚娇鐢ㄧ數璇濆彿鐮佷竴閿櫥褰�", Toast.LENGTH_SHORT).show(); + } + break; + } + + if (ResultCode.CODE_ERROR_USER_CANCEL.equals(tokenRet.getCode())) { + //妯℃嫙鐨勬槸蹇呴』鐧诲綍 鍚﹀垯鐩存帴閫�鍑篴pp鐨勫満鏅� +// finish(); + mPhoneNumberAuthHelper.quitLoginPage(); + } else { +// Toast.makeText(getApplicationContext(), "涓�閿櫥褰曞け璐ュ垏鎹㈠埌鍏朵粬鐧诲綍鏂瑰紡", Toast.LENGTH_SHORT).show(); +// Intent pIntent = new Intent(PhoneLoginActivity.this, MessageActivity.class); +// startActivityForResult(pIntent, 1002); + } + } catch (Exception e) { + e.printStackTrace(); + } + mPhoneNumberAuthHelper.setAuthListener(null); + showOneKeyLoginToast = true; + } + + int timecount = 59; + private Timer timer; + + class MyTask extends TimerTask { + @Override + public void run() { + if (timecount > 0) { + handler.sendEmptyMessage(0); + } else { + handler.sendEmptyMessage(1); + } + } + } + + private void sendBindVerifyCode(String phone) { + timer = new Timer(); + timer.schedule(new PhoneLoginActivity.MyTask(), 1000, 1000); + String loginUid = UserUtil.getLoginUid(this); + BeibeiVideoAPI.sendBindVerifyCode(PhoneLoginActivity.this, loginUid, phone, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + if (jsonObject.optBoolean("IsPost")) { + SingleToast.showToast(PhoneLoginActivity.this, "楠岃瘉鐮佸彂閫佹垚鍔燂紝璇锋敞鎰忔煡鏀�"); + } else { + SingleToast.showToast(PhoneLoginActivity.this, "鑾峰彇楠岃瘉鐮佸け璐�,璇烽噸鏂拌幏鍙栵紒"); + handler.sendEmptyMessage(1); + } + } + + @Override + public void onFinish() { + super.onFinish(); + tv_obtain_verfication_code.setEnabled(true); + } + }); + } + + + private void bindPhone(String accessToken) { + String loginUid = UserUtil.getLoginUid(this); + String phone = (et_phone.getText() + "").trim(); + String code = (et_verfication_code.getText() + "").trim(); + BeibeiVideoAPI.bindPhone(this, loginUid, phone, code, accessToken, new BasicTextHttpResponseHandler() { + + @Override + public void onStart() { + super.onStart(); + if (loadingDialog != null && !loadingDialog.isShowing()) + loadingDialog.show(); + } + + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + if (jsonObject.optBoolean("IsPost")) { + //缁戝畾鎴愬姛 + Toast.makeText(PhoneLoginActivity.this, "缁戝畾鎴愬姛", Toast.LENGTH_SHORT).show(); + PhoneLoginActivity.this.finish(); + } else { + Toast.makeText(PhoneLoginActivity.this, jsonObject.optString("Error"), Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onFinish() { + super.onFinish(); + if (loadingDialog != null && loadingDialog.isShowing()) + loadingDialog.dismiss(); + } + }); + + + } + + Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + switch (msg.what) { + case 0: + tv_obtain_verfication_code.setClickable(false); + tv_obtain_verfication_code.setText("閲嶆柊鍙戦��(" + timecount + "s)"); + timecount--; + break; + case 1: + timer.cancel(); + tv_obtain_verfication_code.setText("鍙戦�侀獙璇佺爜"); + tv_obtain_verfication_code.setClickable(true); + timecount = 59; + break; + } + } + }; + + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/RegisterActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/RegisterActivity.java index 4139e2d..43e7f1a 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/RegisterActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/RegisterActivity.java @@ -118,6 +118,11 @@ break; case R.id.tv_confirm: + if (!cb_user_agreement.isChecked()) { + SingleToast.showToast(RegisterActivity.this, "璇峰悓鎰忋�婄敤鎴蜂娇鐢ㄥ崗璁��"); + break; + } + String email1 = et_email.getText().toString(); String pwd = et_pwd.getText().toString(); String verficationCode = et_verfication_code.getText().toString(); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/HomeFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/HomeFragment.java index 5acb867..0c088a2 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/HomeFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/HomeFragment.java @@ -39,7 +39,6 @@ import com.weikou.beibeivideo.ui.MyRetainViewFragment; import com.weikou.beibeivideo.ui.dialog.FloatADDialog; import com.weikou.beibeivideo.ui.dialog.UserProtocolDialog; -import com.weikou.beibeivideo.ui.recommend.NovelJNZFragment; import com.weikou.beibeivideo.ui.recommend.RecommendFragment; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.UserUtil; @@ -84,39 +83,9 @@ public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!BeibeiConstant.IS_TEST) - showProtocol(); - } - - - private void showProtocol() { - String data = "鎰熻阿鎮ㄥ" + getResources().getString(R.string.app_name) + "涓�鐩翠互鏉ョ殑淇′换锛�<br>"; - data += "鎴戜滑渚濈収鏂扮殑鐩戠瑕佹眰鏉′緥鏇存柊浜�"; - data += String.format("<a href='%s'>銆婇殣绉佹斂绛栥��</a>鍜�", BeibeiConstant.PRIVACY_POLICY); - data += String.format("<a href='%s'>銆婄敤鎴峰崗璁��</a>", BeibeiConstant.USER_AGREEMENT); - data += "涓洪噰鍙栫浉搴斿畨鍏ㄤ繚鎶ゆ帾鏂斤紝灏藉姏淇濇姢鎮ㄧ殑涓汉淇℃伅瀹夊叏鍙帶锛岀壒鍚戜綘璇存槑濡備笅锛�<br>" + - "1銆佹偍鍦ㄤ娇鐢�" + getResources().getString(R.string.app_name) + "鍚勯」浜у搧鎴栨湇鍔℃椂锛屽皢浼氭彁渚涗笌鍏蜂綋鍔熻兘鐩稿叧鐨勪釜浜轰俊鎭紙鍙兘娑夊強甯愬彿銆佷綅缃�佸瓨鍌ㄧ瓑淇℃伅锛夈��<br>" + - "2銆佹偍鍙互闅忔椂鏌ヨ銆佹洿姝c�佸垹闄ゆ偍鐨勪釜浜轰俊鎭紝鎴戜滑涔熸彁渚涜处鎴锋敞閿�鐨勬笭閬撱��<br>" + - "3銆佹湭缁忔偍鐨勫啀娆″悓鎰忥紝鎴戜滑涓嶄細灏嗕笂杩颁俊鎭敤浜庢偍鏈巿鏉冪殑鍏朵粬鐢ㄩ�旀垨鐩殑銆�<br>" + - "4銆佹湭缁忕洃鎶や汉鍚屾剰锛屾垜浠笉浼氭敹闆嗕娇鐢�14鍛ㄥ瞾浠ヤ笅锛堝惈14鍛ㄥ瞾锛夋湭鎴愬勾浜轰釜浜轰俊鎭紝涓斾笉浼氬埄鐢ㄥ叾淇℃伅鎺ㄩ�佹柊闂汇�佹椂鏀夸俊鎭�佸箍鍛婄瓑瀹氬悜鎺ㄩ�佹椿鍔ㄣ��"; - - if (!UserUtil.isAgreeUserProtocol(getContext())) { - new UserProtocolDialog.Builder(getActivity()).setNegativeButton("涓嶅悓鎰�", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - getActivity().finish(); - } - }).setPositiveButton("鍚屾剰", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - UserUtil.agreeUserProtocol(getContext()); - showFloatImgAd(); - } - }).setData(data).create().show(); - } else { showFloatImgAd(); - } } + /** * 灞曠ず鎮诞骞垮憡 @@ -149,7 +118,11 @@ fl_indicator.postDelayed(new Runnable() { @Override public void run() { - builder.create().show(); + try { + builder.create().show(); + } catch (Exception e) { + + } } }, 2000); @@ -204,6 +177,13 @@ cacheValue, new TypeToken<List<HomeClass>>() { }.getType()); + if (list != null) + for (int i = 0; i < list.size(); i++) { + if (list.get(i).getDataType().equalsIgnoreCase("novel")) { + list.remove(i--); + } + } + categories.addAll(list); } @@ -272,6 +252,13 @@ }.getType()); categories.addAll(list); + if (categories != null) + for (int i = 0; i < categories.size(); i++) { + if (categories.get(i).getDataType().equalsIgnoreCase("novel")) { + categories.remove(i--); + } + } + adapter.notifyDataSetChanged(); indicator.notifyDataSetChanged(); @@ -305,12 +292,10 @@ @Override public Fragment getItem(int position) { - if ("novel".equalsIgnoreCase(mlist.get(position).getDataType())) { - return NovelJNZFragment.newInstance(); - } else { - Fragment fragment = RecommendFragment.newInstance(mlist.get(position), position + ""); - return fragment; - } + + Fragment fragment = RecommendFragment.newInstance(mlist.get(position), position + ""); + return fragment; + } @Override diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java index 2b74e60..97edd23 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java @@ -50,14 +50,19 @@ import com.umeng.socialize.media.UMImage; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.BeibeiVideoApplication; import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.db.MessageTable; import com.weikou.beibeivideo.entity.NewComment; +import com.weikou.beibeivideo.entity.VideoInfo; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.ui.baidu.BaiDuNewsFragment; import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment; +import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; import com.weikou.beibeivideo.ui.login.LoginActivity; import com.weikou.beibeivideo.ui.login.PersonInfoActivity; +import com.weikou.beibeivideo.ui.login.PhoneLoginActivity; +import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; import com.weikou.beibeivideo.ui.mine.BrowserActivity; import com.weikou.beibeivideo.ui.mine.SystemMessageActivity; import com.weikou.beibeivideo.ui.mine.WatchHistoryActivity; @@ -247,6 +252,23 @@ }); setRightTopAD(); preLoadCommonAD(); + + + if (BeibeiConstant.IS_TEST) { + tv_search.postDelayed(new Runnable() { + @Override + public void run() { + VideoInfo videoInfo = new VideoInfo(); + videoInfo.setId("8065880"); + videoInfo.setThirdType("0"); + Intent intent = new Intent(MainActivity.this, VideoDetailActivity2.class); + intent.putExtra("video_info",videoInfo); + startActivity(intent); + } + },2000); + } + +// startActivity(new Intent(this, PhoneLoginActivity.class)); } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MineFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MineFragment.java index 86b5a60..33f20a9 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MineFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MineFragment.java @@ -1,7 +1,6 @@ package com.weikou.beibeivideo.ui.main; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; @@ -22,41 +21,45 @@ import com.androidquery.AQuery; import com.bumptech.glide.Glide; -import com.iBookStar.views.YmConfig; -import com.lcjian.library.RetainViewFragment; +import com.google.gson.Gson; import com.lcjian.library.content.ConnectivityChangeHelper; import com.lcjian.library.content.ConnectivityChangeHelper.OnConnectivityChangeListener; import com.lcjian.library.util.common.DimenUtils; import com.lcjian.library.util.common.StringUtils; -import com.lcjian.library.widget.MyGridView; import com.umeng.analytics.MobclickAgent; import com.umeng.socialize.ShareAction; import com.umeng.socialize.UMShareAPI; import com.umeng.socialize.UMShareListener; import com.umeng.socialize.bean.SHARE_MEDIA; -import com.umeng.socialize.media.UMMin; import com.umeng.socialize.media.UMWeb; +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; import com.weikou.beibeivideo.db.MessageTable; import com.weikou.beibeivideo.entity.NewComment; +import com.weikou.beibeivideo.entity.UserInfo; +import com.weikou.beibeivideo.entity.vo.UserInfoVO; import com.weikou.beibeivideo.ui.MyRetainViewFragment; import com.weikou.beibeivideo.ui.common.FollowActivity; -import com.weikou.beibeivideo.ui.common.ShareDialogFragment; -import com.weikou.beibeivideo.ui.discover.ReleasePromptActivity; import com.weikou.beibeivideo.ui.login.LoginActivity; import com.weikou.beibeivideo.ui.login.PersonInfoActivity; import com.weikou.beibeivideo.ui.mine.BrowserActivity; -import com.weikou.beibeivideo.ui.mine.DownloadActivity; -import com.weikou.beibeivideo.ui.mine.FXBrowserActivity; +import com.weikou.beibeivideo.ui.mine.PPTVPlayActivity; +import com.weikou.beibeivideo.ui.video.VideoPlayerBrowserActivity; import com.weikou.beibeivideo.ui.mine.HelpAndTicklingActivity; import com.weikou.beibeivideo.ui.mine.MyFavouriteActivity; import com.weikou.beibeivideo.ui.mine.SettingsActivity; import com.weikou.beibeivideo.ui.mine.SystemMessageActivity; import com.weikou.beibeivideo.ui.mine.WatchHistoryActivity; import com.weikou.beibeivideo.ui.recommend.SearchActivity; -import com.weikou.beibeivideo.util.CustomShareDialog; +import com.weikou.beibeivideo.util.BeibeiConstant; +import com.weikou.beibeivideo.util.ConfigUtil; import com.weikou.beibeivideo.util.GlideCircleTransform; +import com.weikou.beibeivideo.util.UserUtil; import com.weikou.beibeivideo.widget.BadgeView; import com.weikou.beibeivideo.R; + +import org.apache.http.Header; +import org.json.JSONObject; import de.greenrobot.event.EventBus; @@ -86,6 +89,9 @@ private TextView tv_login;// 鐢ㄦ埛鍚� private TextView tv_name; private ImageView iv_user_logo;// 鐢ㄦ埛澶村儚 + private ImageView iv_vip; + private TextView tv_vip_open; + private LinearLayout ll_vip; /** * 鐢ㄤ簬琛ㄧず鐧诲綍鐘舵�� */ @@ -153,6 +159,11 @@ tv_login = contentView.findViewById(R.id.mine_tv_login); tv_name = contentView.findViewById(R.id.mine_tv_name); iv_user_logo = contentView.findViewById(R.id.mine_ci_head); + iv_vip = contentView.findViewById(R.id.mine_iv_vip); + tv_vip_open = contentView.findViewById(R.id.tv_vip_open); + ll_vip = contentView.findViewById(R.id.ll_vip); + + mBadgeView = new BadgeView(iv_user_logo.getContext(), rl_mine_message); mBadgeView.setBackgroundResource(R.drawable.ic_red_dot); mBadgeView.setTextSize(1); @@ -178,6 +189,7 @@ rl_mine_help.setOnClickListener(this); rl_mine_settings.setOnClickListener(this); rl_mine_share.setOnClickListener(this); + tv_vip_open.setOnClickListener(this); getLoaderManager().initLoader(0, null, this); } @@ -253,7 +265,6 @@ //涔︽灦 case R.id.ll_mine_novel: - YmConfig.openReader(); break; case R.id.rl_mine_message: openMsg(); @@ -274,12 +285,23 @@ HelpAndTicklingActivity.class)); break; case R.id.rl_mine_about_us: - Intent intent1 = new Intent(getContext(), FXBrowserActivity.class); - intent1.putExtra("url", "http://bwweb.yeshitv.com/abountOur/index.html"); + Intent intent1 = new Intent(getContext(), BrowserActivity.class); + intent1.putExtra("url", BeibeiConstant.ABOUT_US); +// intent1.putExtra("url", "http://192.168.3.122:8848/buwan-web/BuWanWeb/unregister/index.html"); startActivity(intent1); break; case R.id.rl_mine_settings: startActivity(new Intent(tv_no_network.getContext(), SettingsActivity.class)); + break; + + case R.id.tv_vip_open: + if (!UserUtil.isLogin(tv_no_network.getContext())) + startActivity(new Intent(tv_no_network.getContext(), LoginActivity.class)); + String url = ConfigUtil.getVipLink(tv_no_network.getContext()); + if (StringUtils.isEmpty(url)) { + return; + } + startActivity(new Intent(tv_no_network.getContext(), BrowserActivity.class).putExtra("url", url)); break; } } @@ -348,14 +370,11 @@ * 鍒濆鍖栫敤鎴风櫥褰曚俊鎭� */ private void initLoginInfo() { - SharedPreferences sp_user = tv_no_network.getContext().getSharedPreferences("user", - Context.MODE_PRIVATE); - isLogin = !StringUtils.isEmpty(sp_user.getString("LoginUid", ""));// 鑾峰彇鐧诲綍鐘舵�� - if (isLogin) { - String portrait = sp_user.getString("portrait", "");// 鐢ㄦ埛澶村儚 - String name = sp_user.getString("name", "");// 鐢ㄦ埛鍚嶇О - // ImageLoader.getInstance().displayImage(qqFigureurl, - // iv_user_logo); + UserInfo userInfo = UserUtil.getLoginUserInfo(getContext()); + isLogin = userInfo != null; + if (userInfo != null) { + String portrait = userInfo.getPortrait(); + String name = userInfo.getNickname(); try { Glide.with(getActivity().getApplicationContext()).load(portrait).placeholder(R.drawable.ic_portrait_default) .transform(new GlideCircleTransform(getActivity())) @@ -371,6 +390,21 @@ tv_login.setVisibility(View.VISIBLE); tv_name.setVisibility(View.GONE); } + + UserInfoVO userDetail = UserUtil.getLoginUserInfoDetail(getContext()); + if (userDetail != null) {//宸茬粡鐧诲綍浜嗭紝涓旀槸鏂扮増鏈� + //vip鏍囪瘑 + if (userDetail.getVipExpireTime() != null && System.currentTimeMillis() <= userDetail.getVipExpireTime()) { + iv_vip.setVisibility(View.VISIBLE); + tv_vip_open.setText("浼氬憳缁垂"); + } else { + iv_vip.setVisibility(View.GONE); + tv_vip_open.setText("寮�閫氫細鍛�"); + } + } else { + iv_vip.setVisibility(View.GONE); + } + } /** @@ -384,9 +418,7 @@ SharedPreferences preferences = tv_no_network.getContext().getSharedPreferences( "user", Context.MODE_PRIVATE); isHaveNewCom = preferences.getBoolean("isCheckedCom", false); - if (!isLogin) { - initLoginInfo(); - } + initLoginInfo(); mChangeHelper.registerReceiver(); MobclickAgent.onPageStart("涓婚〉闈⑩�旀垜鐨�"); SharedPreferences preferences2 = tv_no_network.getContext().getSharedPreferences( @@ -396,6 +428,8 @@ } else { mUpdateBadgeView.hide(); } + + getPersonInfo(); } @Override @@ -422,4 +456,23 @@ } } + private void getPersonInfo() { + UserUtil.updateUserInfo(getContext(), new UserUtil.IUserInfoUpdateListener() { + @Override + public void noLogin() { + + } + + @Override + public void onSuccess() { + + } + + @Override + public void onFail(String msg) { + + } + }); + } + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java index ef09ead..0fc0f0e 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java @@ -48,6 +48,7 @@ import com.umeng.socialize.media.UMWeb; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.BeibeiVideoApplication; import com.weikou.beibeivideo.db.WatchHistoryTable; import com.weikou.beibeivideo.entity.Follow; import com.weikou.beibeivideo.entity.Play; @@ -446,6 +447,8 @@ .optString("Aid")); info.setVid(jsonObject.getJSONObject("Data") .optString("Vid")); + info.setCode(jsonObject.getJSONObject("Data") + .optString("Code")); Play play = new Play(); play.setPlayUrl(info); EventBus.getDefault().post(play); @@ -838,9 +841,9 @@ new TypeToken<VideoInfo>() { }.getType()); if (videoInfo != null) { - VideoUtil.videoEpisodeList.clear(); - if (videoInfo.getVideoDetailList() != null) - VideoUtil.videoEpisodeList.addAll(videoInfo.getVideoDetailList()); + + VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,videoInfo.getVideoDetailList(),false); + } // 闄勫姞瀛楁 if (jsonObject.optJSONObject("Extra1") != null) { @@ -871,8 +874,8 @@ rv_episode.getAdapter().notifyDataSetChanged(); // videoInfo.setSave(jsonObject.getJSONObject("Data").optBoolean("Save")); if (isSetup) { - VideoUtil.videoEpisodeList.clear(); - VideoUtil.videoEpisodeList.addAll(videoInfo.getVideoDetailList()); + VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,videoInfo.getVideoDetailList(),false); + EventBus.getDefault().post(videoInfo); int position = 0; // boolean isFromWatchHistory = false; @@ -997,7 +1000,7 @@ }.getType()); if (list != null && list.size() > 0) { episodePage++; - VideoUtil.videoEpisodeList.addAll(list); + VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,list,true); rv_episode.getAdapter().notifyDataSetChanged(); } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/IQYVideoFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/IQYVideoFragment.java index 7ac2fdf..0b4c1ff 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/IQYVideoFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/IQYVideoFragment.java @@ -26,7 +26,7 @@ import com.umeng.analytics.MobclickAgent; import com.weikou.beibeivideo.entity.AccumulateRule; import com.weikou.beibeivideo.entity.PlayUrl; -import com.weikou.beibeivideo.ui.media.VideoDetailActivity.ChangeVideoEvent; +import com.weikou.beibeivideo.entity.video.ChangeVideoEvent; import com.weikou.beibeivideo.util.downutil.DownFiles; import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; import com.weikou.beibeivideo.util.x5.X5WebView; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity.java index 37a0774..0c7b8a5 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity.java @@ -56,10 +56,11 @@ import com.weikou.beibeivideo.entity.VideoDetailInfo; import com.weikou.beibeivideo.entity.VideoInfo; import com.weikou.beibeivideo.entity.VideoResource; +import com.weikou.beibeivideo.entity.video.ChangeVideoEvent; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.ui.ad.PlayVideoPreADFragment; import com.weikou.beibeivideo.ui.common.ShareActivity; -import com.weikou.beibeivideo.ui.mine.FXBrowserActivity; +import com.weikou.beibeivideo.ui.video.VideoPlayerBrowserActivity; import com.weikou.beibeivideo.ui.video.VideoPlayerActivity; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.VideoUtil; @@ -132,7 +133,7 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.video_detail_activity); - VideoUtil.videoEpisodeList.clear(); + VideoUtil.clearVideoEpisodeList(this); /* * 璁$畻鐘舵�佹爮楂樺害骞惰缃� */ @@ -386,7 +387,7 @@ return; } else if (playUrl.getPlayType() == 1) { Intent intent = new Intent(VideoDetailActivity.this, - FXBrowserActivity.class); + VideoPlayerBrowserActivity.class); intent.putExtra("url", playUrl.getUrl()); startActivity(intent); saveWatchHistory("椋庤"); @@ -694,8 +695,7 @@ new TypeToken<VideoInfo>() { }.getType()); if (videoInfo != null) { - VideoUtil.videoEpisodeList.clear(); - VideoUtil.videoEpisodeList.addAll(videoInfo.getVideoDetailList()); + VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,videoInfo.getVideoDetailList(),false); } // 闄勫姞瀛楁 if (jsonObject.optJSONObject("Extra1") != null) { @@ -849,6 +849,8 @@ .optString("Aid")); info.setVid(jsonObject.getJSONObject("Data") .optString("Vid")); + info.setCode(jsonObject.getJSONObject("Data") + .optString("Code")); playUrl = info; if (videoInfo == null) { return; @@ -880,28 +882,7 @@ checkConfiguration(getResources().getConfiguration()); } - public static class ChangeVideoEvent { - private VideoInfo videoInfo; - private String tag; - - public VideoInfo getVideoInfo() { - return videoInfo; - } - - public void setVideoInfo(VideoInfo videoInfo) { - this.videoInfo = videoInfo; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - } @Override public void onClick(View v) { diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java index f7673c2..c46f74e 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java @@ -34,6 +34,7 @@ import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.transition.Transition; +import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd; import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -59,10 +60,11 @@ import com.weikou.beibeivideo.entity.VideoDetailInfo; import com.weikou.beibeivideo.entity.VideoInfo; import com.weikou.beibeivideo.entity.VideoResource; +import com.weikou.beibeivideo.entity.video.ChangeVideoEvent; import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.ui.ad.PlayVideoPreADFragment; import com.weikou.beibeivideo.ui.common.ShareActivity; -import com.weikou.beibeivideo.ui.mine.FXBrowserActivity; +import com.weikou.beibeivideo.ui.video.VideoPlayerBrowserActivity; import com.weikou.beibeivideo.ui.video.FunshionPlayerFragment; import com.weikou.beibeivideo.ui.video.VideoPlayerActivity; import com.weikou.beibeivideo.util.BeibeiConstant; @@ -89,7 +91,7 @@ public class VideoDetailActivity2 extends BaseActivity implements OnClickListener { - private final String TAG = "VideoDetailActivity2"; + private final String TAG = VideoDetailActivity2.class.getName(); // private boolean mLandscape; private VideoInfo videoInfo; @@ -142,7 +144,7 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.video_detail_activity); - VideoUtil.videoEpisodeList.clear(); + VideoUtil.clearVideoEpisodeList(this); /* * 璁$畻鐘舵�佹爮楂樺害骞惰缃� */ @@ -279,6 +281,13 @@ if (BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) { if (FullVideoAdManager.getInstance().isCacahed()) { FullVideoAdManager.getInstance().showAd(this); + } else { + FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, new FullVideoAdManager.IFullVideoAdListener() { + @Override + public void onSuccess(TTFullScreenVideoAd ad) { + FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); + } + }); } } } @@ -312,7 +321,7 @@ if (BeibeiConstant.IS_TEST) BeibeiConstant.AD_TYPE = null; //闇�瑕佸姞杞藉箍鍛� - if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd()) { + if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd() && playUrl.getPlayType() != 2) { mVideoDetailVideoAdFragment = new PlayVideoPreADFragment(); mVideoDetailVideoAdFragment.setPageEventListener(new IPageEventListener() { @Override @@ -363,6 +372,15 @@ videoInfo.getResourceList().get(i).setChecked(false); } } + + //鎾斁缁熻 + BeibeiVideoAPI.playStatistic(BeibeiVideoApplication.application, videoInfo.getId(), playUrl.getResource().getId() + "", new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + }); + if (playUrl.getResource().getName().contains("鐖卞鑹�")) { if (playUrl != null) { if (playUrl.getPlayType() == 0) { @@ -371,7 +389,7 @@ return; } else if (playUrl.getPlayType() == 1) { Intent intent = new Intent(VideoDetailActivity2.this, - VideoPlayerActivity.class); + VideoPlayerBrowserActivity.class); intent.putExtra("url", playUrl.getUrl()); startActivity(intent); initPlayer(); @@ -404,7 +422,7 @@ return; } else if (playUrl.getPlayType() == 1) { Intent intent = new Intent(VideoDetailActivity2.this, - FXBrowserActivity.class); + VideoPlayerBrowserActivity.class); intent.putExtra("url", playUrl.getUrl()); startActivity(intent); saveWatchHistory("椋庤"); @@ -433,7 +451,7 @@ return; } else if (playUrl.getPlayType() == 1) { Intent intent = new Intent(VideoDetailActivity2.this, - VideoPlayerActivity.class); + VideoPlayerBrowserActivity.class); intent.putExtra("url", playUrl.getUrl()); startActivity(intent); saveWatchHistory(playUrl.getResource().getName()); @@ -659,6 +677,7 @@ @Override public void onResume() { + Log.i(TAG, "onResume"); super.onResume(); EventBus.getDefault().register(this); if (fl_ad.getVisibility() == View.GONE) { @@ -668,6 +687,7 @@ @Override public void onPause() { + Log.i(TAG, "onPause"); super.onPause(); EventBus.getDefault().unregister(this); } @@ -692,7 +712,6 @@ } catch (IndexOutOfBoundsException e) { e.printStackTrace(); } - } public void onEventMainThread(VideoInfo info) { @@ -771,8 +790,7 @@ new TypeToken<VideoInfo>() { }.getType()); if (videoInfo != null) { - VideoUtil.videoEpisodeList.clear(); - VideoUtil.videoEpisodeList.addAll(videoInfo.getVideoDetailList()); + VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application, videoInfo.getVideoDetailList(), false); } // 闄勫姞瀛楁 if (jsonObject.optJSONObject("Extra1") != null) { @@ -854,7 +872,7 @@ } } getUrl(VideoUtil.videoEpisodeList.get(0), - isSetup); + true); findViewById(android.R.id.content).postDelayed( new Runnable() { @@ -923,6 +941,8 @@ .optString("Params")); info.setAid(data.optString("Aid")); info.setVid(data.optString("Vid")); + info.setCode(jsonObject.getJSONObject("Data") + .optString("Code")); playUrl = info; if (videoInfo == null) { return; @@ -953,29 +973,6 @@ transaction.commitAllowingStateLoss(); checkConfiguration(getResources().getConfiguration()); Log.i(TAG, "update"); - } - - public static class ChangeVideoEvent { - private VideoInfo videoInfo; - - private String tag; - - public VideoInfo getVideoInfo() { - return videoInfo; - } - - public void setVideoInfo(VideoInfo videoInfo) { - this.videoInfo = videoInfo; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - } @Override diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java index 43c6e78..4ab868f 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java @@ -1,13 +1,11 @@ package com.weikou.beibeivideo.ui.media; -import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Rect; import android.os.Bundle; import android.support.v4.view.ViewPager; -import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.Html; import android.util.Log; @@ -16,10 +14,7 @@ import android.view.animation.Animation; import android.view.animation.RotateAnimation; import android.view.animation.Transformation; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; import android.widget.FrameLayout; -import android.widget.GridView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ScrollView; @@ -32,27 +27,18 @@ import com.lcjian.library.RetainViewFragment; import com.lcjian.library.util.common.DimenUtils; import com.lcjian.library.util.common.StringUtils; -import com.qq.e.ads.cfg.VideoOption; -import com.qq.e.ads.nativ.ADSize; -import com.qq.e.ads.nativ.NativeExpressAD; -import com.qq.e.ads.nativ.NativeExpressADView; -import com.qq.e.comm.util.AdError; import com.umeng.analytics.MobclickAgent; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.entity.PushEpisode; import com.weikou.beibeivideo.entity.VideoInfo; import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; -import com.weikou.beibeivideo.entity.video.FunshionPlayInfo; -import com.weikou.beibeivideo.ui.common.GridVideoAdapter1; -import com.weikou.beibeivideo.ui.media.VideoDetailActivity.ChangeVideoEvent; +import com.weikou.beibeivideo.entity.video.ChangeVideoEvent; import com.weikou.beibeivideo.ui.video.IVideoClickListener; import com.weikou.beibeivideo.ui.video.VideoColumn2Adapter; -import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.ad.AdUtil; import com.weikou.beibeivideo.util.ad.ExpressAdManager; -import com.weikou.beibeivideo.widget.FullyGridLayoutManager; -import com.weikou.beibeivideo.R; import org.apache.http.Header; import org.json.JSONObject; @@ -373,6 +359,7 @@ super.onResume(); EventBus.getDefault().register(this); MobclickAgent.onPageStart("鎾斁璇︽儏鈥旈�夐泦"); + Log.i(TAG,"onResume"); } @Override @@ -382,6 +369,7 @@ isShowMore = false; page_varietyshow = 0; MobclickAgent.onPageEnd("鎾斁璇︽儏鈥旈�夐泦"); + Log.i(TAG,"onPause"); } public void onEventMainThread(VideoInfo info) { @@ -511,5 +499,12 @@ if (rv_video_related_video != null && adRunnable != null) rv_video_related_video.removeCallbacks(adRunnable); super.onDestroy(); + Log.i(TAG,"onDestroy"); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + Log.i(TAG,"onDestroyView"); } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment2.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment2.java index 8f7752b..33c9afb 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment2.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment2.java @@ -163,6 +163,8 @@ .optString("Aid")); info.setVid(jsonObject.getJSONObject("Data") .optString("Vid")); + info.setCode(jsonObject.getJSONObject("Data") + .optString("Code")); Play play = new Play(); play.setPlayUrl(info); EventBus.getDefault().post(play); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/BrowserActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/BrowserActivity.java index 47e158e..2402e89 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/BrowserActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/BrowserActivity.java @@ -1,8 +1,10 @@ package com.weikou.beibeivideo.ui.mine; +import android.app.AlertDialog; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; +import android.content.DialogInterface; import android.content.Intent; import android.graphics.BitmapFactory; import android.graphics.Color; @@ -24,6 +26,7 @@ import android.widget.Toast; import com.lcjian.library.util.ManifestDataUtil; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; import com.tencent.smtt.export.external.interfaces.SslError; import com.tencent.smtt.export.external.interfaces.SslErrorHandler; import com.tencent.smtt.export.external.interfaces.WebResourceRequest; @@ -39,6 +42,7 @@ import com.weikou.beibeivideo.ui.media.VideoDetailActivity; import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; import com.weikou.beibeivideo.util.browser.BWJavaInterface; +import com.weikou.beibeivideo.util.browser.PPJavaInterface; import com.weikou.beibeivideo.util.downutil.DownFiles; import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; import com.weikou.beibeivideo.util.x5.X5WebView; @@ -46,6 +50,7 @@ import java.util.Map; public class BrowserActivity extends BaseActivity implements OnClickListener { + private final static String TAG = "BrowserActivity"; private TextView tv_top_bar_left; private TextView tv_top_bar_left2; @@ -63,6 +68,22 @@ if (url != null && url.startsWith("weixin://")) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); + return true; + } else if (url.startsWith("alipays:") || url.startsWith("alipay")) { + try { + startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url))); + } catch (Exception e) { + new AlertDialog.Builder(BrowserActivity.this) + .setMessage("鏈娴嬪埌鏀粯瀹濆鎴风锛岃瀹夎鍚庨噸璇曘��") + .setPositiveButton("绔嬪嵆瀹夎", new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + Uri alipayUrl = Uri.parse("https://d.alipay.com"); + startActivity(new Intent("android.intent.action.VIEW", alipayUrl)); + } + }).setNegativeButton("鍙栨秷", null).show(); + } return true; } else if (url != null && url.startsWith("buwanprotocol://")) { String murl = url.split("buwanprotocol://")[1]; @@ -119,6 +140,12 @@ } super.onProgressChanged(webView, i); } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + Log.i(TAG, consoleMessage.message()); + return super.onConsoleMessage(consoleMessage); + } }); WebSettings webSetting = webview.getSettings(); webSetting.setJavaScriptEnabled(true); @@ -157,13 +184,16 @@ tv_top_bar_left.setOnClickListener(this); tv_top_bar_left2.setOnClickListener(this); - progressBar = (ProgressBar) findViewById(R.id.myProgressBar); + progressBar = findViewById(R.id.myProgressBar); progressBar.setMax(100); progressBar.setProgressDrawable(this.getResources() .getDrawable(R.drawable.color_progressbar)); initX5WebView(); - webview.loadUrl(getIntent().getStringExtra("url")); + String url = getIntent().getStringExtra("url"); +// String url="http://192.168.3.122:8848/buwan-web/BuWanWeb/vip/index.html"; + webview.loadUrl(url); } + // 鏂囦欢涓嬭浇鐩戝惉 private class MyWebViewDownLoadListener implements DownloadListener { @@ -273,6 +303,9 @@ super.onResume(); MobclickAgent.onPageStart("缃戦〉"); // webview.reload(); + if(webview!=null){ + webview.loadUrl("javascript:onResume()"); + } } @Override diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayActivity.java new file mode 100644 index 0000000..347b559 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayActivity.java @@ -0,0 +1,467 @@ +package com.weikou.beibeivideo.ui.mine; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.content.DialogInterface; +import android.content.Intent; +import android.graphics.BitmapFactory; +import android.graphics.Color; +import android.graphics.PixelFormat; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.support.v4.app.NotificationCompat; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.LinearLayout.LayoutParams; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import com.lcjian.library.util.ManifestDataUtil; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.SslError; +import com.tencent.smtt.export.external.interfaces.SslErrorHandler; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; +import com.umeng.analytics.MobclickAgent; +import com.weikou.beibeivideo.R; +import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; +import com.weikou.beibeivideo.entity.ad.PlayVideoPreADSetting; +import com.weikou.beibeivideo.ui.BaseActivity; +import com.weikou.beibeivideo.ui.ad.PlayVideoPreADFragment; +import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; +import com.weikou.beibeivideo.ui.login.LoginActivity; +import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; +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.ExpressAdManager; +import com.weikou.beibeivideo.util.ad.GDTConstant; +import com.weikou.beibeivideo.util.browser.BWJavaInterface; +import com.weikou.beibeivideo.util.browser.PPJavaInterface; +import com.weikou.beibeivideo.util.downutil.DownFiles; +import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; +import com.weikou.beibeivideo.util.ui.IPageEventListener; +import com.weikou.beibeivideo.util.x5.X5WebView; + +import java.util.List; + +public class PPTVPlayActivity extends BaseActivity implements OnClickListener { + private static int REQUEST_CODE_LOGIN = 1001; + + + private final static String TAG = PPTVPlayActivity.class.getSimpleName(); + + private TextView tv_top_bar_left; + private TextView tv_top_bar_left2; + private TextView tv_top_bar_middle; + private X5WebView webview; + ProgressBar progressBar; + FrameLayout fl_ad; + + + private void initX5WebView() { + fl_ad = findViewById(R.id.fl_ad); + webview = findViewById(R.id.webview); + webview.setDownloadListener(new MyWebViewDownLoadListener()); + webview.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (url != null && url.startsWith("weixin://")) { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + startActivity(intent); + return true; + } else if (url.startsWith("alipays:") || url.startsWith("alipay")) { + try { + startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url))); + } catch (Exception e) { + new AlertDialog.Builder(PPTVPlayActivity.this) + .setMessage("鏈娴嬪埌鏀粯瀹濆鎴风锛岃瀹夎鍚庨噸璇曘��") + .setPositiveButton("绔嬪嵆瀹夎", new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + Uri alipayUrl = Uri.parse("https://d.alipay.com"); + startActivity(new Intent("android.intent.action.VIEW", alipayUrl)); + } + }).setNegativeButton("鍙栨秷", null).show(); + } + return true; + } else if (url != null && url.startsWith("buwanprotocol://")) { + String murl = url.split("buwanprotocol://")[1]; + String[] params = murl.split("#"); + if (params[0].equalsIgnoreCase("playvideo")) { + Intent intent = new Intent(PPTVPlayActivity.this, VideoDetailActivity2.class); + Bundle bundle = new Bundle(); + bundle.putString("Id", params[1]); + bundle.putString("ResourceId", params[2]); + bundle.putString("DetailId", params[3]); + bundle.putString("Share", "0"); + bundle.putString("ThirdType", "0"); + intent.putExtras(bundle); + startActivity(intent); + } + return true; + } else if (url != null && (!url.startsWith("http"))) { + return true; + } + return super.shouldOverrideUrlLoading(view, url); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + return super.shouldOverrideUrlLoading(webView, webResourceRequest); + } + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + playAd(); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { + } + }); + + webview.setWebChromeClient(new WebChromeClient() { + + @Override + public void onReceivedTitle(WebView view, String title) { + tv_top_bar_middle.setText(title); + } + + @Override + public void onProgressChanged(WebView webView, int i) { + if (i == 100) { + progressBar.setVisibility(View.GONE); + } else { + if (View.INVISIBLE == progressBar.getVisibility()) { + progressBar.setVisibility(View.VISIBLE); + } + progressBar.setProgress(i); + } + super.onProgressChanged(webView, i); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + Log.i(TAG, consoleMessage.message()); + return super.onConsoleMessage(consoleMessage); + } + }); + WebSettings webSetting = webview.getSettings(); + webSetting.setJavaScriptEnabled(true); + webSetting.setTextZoom(100); + webview.addJavascriptInterface(new PPJavaInterface(this, new PPJavaInterface.IEventListener() { + @Override + public void onLogin() { + runOnUiThread(new Runnable() { + @Override + public void run() { + Intent intent = new Intent(PPTVPlayActivity.this, LoginActivity.class); + intent.putExtra("result", true); + startActivityForResult(intent, REQUEST_CODE_LOGIN); + } + }); + } + + @Override + public void onTryPlayFinish() { + Log.i(TAG, "onTryPlayFinish"); + runOnUiThread(new Runnable() { + @Override + public void run() { + //TODO 鎻愰啋涔颁細鍛� + startActivity(new Intent(PPTVPlayActivity.this,BrowserActivity.class).putExtra("url","http://vip.ysdq.yeshitv.com/")); + } + }); + + } + + @Override + public void onPlayFinish() { + runOnUiThread(new Runnable() { + @Override + public void run() { + new AlertDialog.Builder(PPTVPlayActivity.this).setMessage("playFinish鏂规硶琚皟鐢�").create().show(); + } + }); + + } + }), "ppyestv"); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getWindow().setFormat(PixelFormat.TRANSLUCENT); + setContentView(R.layout.browser_pptv_activity); + /* + * 璁$畻鐘舵�佹爮楂樺害骞惰缃� + */ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + int result = 0; + int resourceId = getResources().getIdentifier("status_bar_height", + "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, + result); + findViewById(R.id.v_status_bar).setLayoutParams(params); + findViewById(R.id.v_status_bar).setVisibility(View.VISIBLE); + } else { + findViewById(R.id.v_status_bar).setVisibility(View.GONE); + } + tv_top_bar_left = findViewById(R.id.tv_top_bar_left); + tv_top_bar_left2 = findViewById(R.id.tv_top_bar_left2); + tv_top_bar_left2.setVisibility(View.VISIBLE); + tv_top_bar_middle = findViewById(R.id.tv_top_bar_middle); + + tv_top_bar_left2.setText("鍏抽棴"); + tv_top_bar_left.setOnClickListener(this); + tv_top_bar_left2.setOnClickListener(this); + + progressBar = findViewById(R.id.myProgressBar); + progressBar.setMax(100); + progressBar.setProgressDrawable(this.getResources() + .getDrawable(R.drawable.color_progressbar)); + initX5WebView(); + String url = getIntent().getStringExtra("url"); + url = "http://vip.pptv.com/activity/2021/pg_bwysdqmovie?cid=32159127&vid=32159127&programtype=3"; +// url = "http://192.168.3.122:8848/buwan-web/test.html"; + webview.loadUrl(url); + +// loadingDialog = LoadingDialogUtil.getLoadingDialog(this,"姝e湪鍔犺浇"); +// loadingDialog.show(); + } + + Dialog loadingDialog; + + PlayVideoPreADFragment mVideoDetailVideoAdFragment; + + + // 鏂囦欢涓嬭浇鐩戝惉 + + private class MyWebViewDownLoadListener implements DownloadListener { + + @Override + public void onDownloadStart(String url, String userAgent, + String contentDisposition, String mimetype, long contentLength) { + startDownLoadFile(url); + } + } + + private NotificationManager manager; + private Notification notif; + private Notification.Builder oBuilder; + private NotificationCompat.Builder builder; + int j = -1; + + private void startDownLoadFile(String url) { + + new DownFiles(this, new IProgress() { + + @Override + public void getProgress(int p) { + // stub + if (p > 99) { + handler.sendEmptyMessage(1); + Log.i("DownFiles", "getProgress涓嬭浇杩涘害:" + p); + } else { + if (manager == null) { + Toast.makeText(PPTVPlayActivity.this, "鏂囦欢宸茬粡寮�濮嬩笅杞�", + Toast.LENGTH_SHORT).show(); + manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + String id = "UMENG_CHANNEL"; + String description = ManifestDataUtil.getAppMetaData(PPTVPlayActivity.this, id); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + int importance = NotificationManager.IMPORTANCE_HIGH; + NotificationChannel mChannel = new NotificationChannel(id, "123", importance); + mChannel.setDescription(description); + mChannel.enableLights(true); + mChannel.setLightColor(Color.RED); + mChannel.enableVibration(true); + mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); + manager.createNotificationChannel(mChannel); + oBuilder = new Notification.Builder(PPTVPlayActivity.this, id); + oBuilder.setContentTitle("褰辫澶у叏") + .setSmallIcon(R.drawable.ic_launcher) + .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) + .setContentText("鐑棬搴旂敤涓嬭浇") + .setAutoCancel(true) + .build(); + } else { + builder = new NotificationCompat.Builder(PPTVPlayActivity.this); + builder.setContentTitle("褰辫澶у叏") + .setContentText("鐑棬搴旂敤涓嬭浇") + .setSmallIcon(R.drawable.ic_launcher) + .setOngoing(true);//鏃犳晥 + } + } + + Message msg = handler.obtainMessage(); + if (j != p) { + msg.what = 0; + msg.arg1 = p; + handler.sendMessage(msg); + } + j = p; + } + } + }).execute(url); + } + + private Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + switch (msg.what) { + case 0: + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + oBuilder.setContentText(msg.arg1 + "%"); + notif = oBuilder.build(); + } else { + builder.setContentText(msg.arg1 + "%"); + notif = builder.build(); + } + manager.notify(0, notif); + break; + case 1: + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + oBuilder.setContentText("涓嬭浇瀹屾垚"); + notif = oBuilder.build(); + } else { + builder.setContentText("涓嬭浇瀹屾垚"); + notif = builder.build(); + } + manager.notify(0, notif); + j = 100; + manager.cancelAll(); + break; + default: + break; + } + } + }; + + @Override + public void onResume() { + super.onResume(); + MobclickAgent.onPageStart("缃戦〉"); +// webview.reload(); + } + + @Override + public void onPause() { + super.onPause(); + MobclickAgent.onPageEnd("缃戦〉"); + } + + @Override + protected void onDestroy() { + if (webview != null) { + webview.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + webview.clearHistory(); + + ((ViewGroup) webview.getParent()).removeView(webview); + webview.destroy(); + webview = null; + } + super.onDestroy(); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.tv_top_bar_left: { + if (!webview.canGoBack()) + finish(); + else { + webview.goBack(); + } + } + break; + case R.id.tv_top_bar_left2: { + finish(); + } + break; + default: + break; + } + } + + // 璁剧疆鍥為�� + // 瑕嗙洊Activity绫荤殑onKeyDown(int keyCoder,KeyEvent event)鏂规硶 + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) { + webview.goBack(); // goBack()琛ㄧず杩斿洖WebView鐨勪笂涓�椤甸潰 + return true; + } + return super.onKeyDown(keyCode, event); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + Log.d(TAG, "onActivityResdult:" + requestCode); + //浠庣櫥褰曡繑鍥炴潵鐨� + if (requestCode == REQUEST_CODE_LOGIN && resultCode == RESULT_OK) { + Log.d(TAG, "鐧诲綍鎴愬姛"); + webview.reload(); + } + super.onActivityResult(requestCode, resultCode, data); + } + + private synchronized void playAd() { + fl_ad.setVisibility(View.VISIBLE); + mVideoDetailVideoAdFragment = new PlayVideoPreADFragment(); + mVideoDetailVideoAdFragment.setPageEventListener(new IPageEventListener() { + @Override + public void onCreateView() { + mVideoDetailVideoAdFragment.loadVideoAD(new PlayVideoPreADFragment.IVideoAdListener() { + @Override + public void finishPlay() { + getSupportFragmentManager().beginTransaction().remove(mVideoDetailVideoAdFragment).commitAllowingStateLoss(); + fl_ad.setVisibility(View.GONE); + adPlayFinish(); + } + + @Override + public void startPlay() { + + } + + @Override + public void noAd() { + fl_ad.setVisibility(View.GONE); + getSupportFragmentManager().beginTransaction().remove(mVideoDetailVideoAdFragment).commitAllowingStateLoss(); + adPlayFinish(); + } + }, new PlayVideoPreADSetting(AdUtil.AD_TYPE.gdt, BeibeiConstant.GDT_ID, "5061928359494942", null)); + + } + }); + getSupportFragmentManager().beginTransaction().replace(R.id.fl_ad, mVideoDetailVideoAdFragment).commit(); + } + + + private void adPlayFinish() { + webview.loadUrl("javascript:adPlayFinish()"); + } +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/SettingsActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/SettingsActivity.java index acd7fe7..e7c9bc5 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/SettingsActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/SettingsActivity.java @@ -37,6 +37,7 @@ import com.weikou.beibeivideo.ui.main.MineFragment; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.SDCardUtil; +import com.weikou.beibeivideo.util.UserUtil; import com.weikou.beibeivideo.util.XGPush; import com.weikou.beibeivideo.widget.BadgeView; import com.yeshi.appupdate.AppUpdate; @@ -244,12 +245,7 @@ int which) { if (UMShareAPI.get(SettingsActivity.this).isAuthorize(SettingsActivity.this, SHARE_MEDIA.QQ)) UMShareAPI.get(SettingsActivity.this).deleteOauth(SettingsActivity.this, SHARE_MEDIA.QQ, authListener); - - Editor edit = getSharedPreferences("user", - Context.MODE_PRIVATE).edit(); - edit.putString("LoginUid", ""); - edit.putBoolean("PushType", false); - edit.commit(); + UserUtil.logout(getApplicationContext()); MineFragment.isLogin = false;// 鏀逛负鏈櫥褰曠姸鎬� XGPush.unRegisterPush(SettingsActivity.this); finish(); @@ -311,7 +307,7 @@ break; case R.id.rl_about_us: { Intent intent = new Intent(this, BrowserActivity.class); - intent.putExtra("url", "http://bwweb.yeshitv.com/abountOur/index.html"); + intent.putExtra("url", BeibeiConstant.ABOUT_US); startActivity(intent); } break; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/NovelJNZFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/NovelJNZFragment.java deleted file mode 100644 index 6fec1ab..0000000 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/NovelJNZFragment.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.weikou.beibeivideo.ui.recommend; - -import android.content.res.Configuration; -import android.content.res.Resources; -import android.os.Bundle; -import android.view.View; -import android.widget.FrameLayout; - -import com.iBookStar.views.YmWebView; -import com.lcjian.library.RetainViewFragment; -import com.weikou.beibeivideo.R; - -/** - * 鑱氳兘璧氬皬璇磃ragment - */ -public class NovelJNZFragment extends RetainViewFragment { - - private FrameLayout fl_container; - - - public static NovelJNZFragment newInstance() { - NovelJNZFragment fragment = new NovelJNZFragment(); - return fragment; - } - - @Override - public void onCreateView(View contentView, Bundle savedInstanceState) { - fl_container = contentView.findViewById(R.id.fl_container); - YmWebView wv = new YmWebView(getContext()); - fl_container.removeAllViews(); - fl_container.addView(wv); - wv.openBookStore(); - } - - - @Override - public int getContentResource() { - return R.layout.fragment_novel; - } - - @Override - public void onResume() { - super.onResume(); - } -} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java index cb35fd1..3797b3f 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/RecommendFragment.java @@ -136,6 +136,8 @@ } + + } @Override diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java index 0f506f4..3be524a 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java @@ -41,10 +41,9 @@ import com.fun.xm.ad.FSThirdAd; import com.fun.xm.ad.adloader.FSSRFeedAdLoader; import com.fun.xm.ad.adview.FSFeedAD; -import com.fun.xm.ad.adview.FSPreMediaView; import com.fun.xm.ad.callback.FSFeedAdCallBack; +import com.fun.xm.ad.listener.FSADMediaListener; import com.funshion.video.logger.FSLogcat; -import com.funshion.video.util.FSError; import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,10 +52,11 @@ import com.lcjian.library.widget.RatioLayout; import com.qq.e.ads.cfg.VideoOption; import com.qq.e.ads.nativ.MediaView; -import com.qq.e.ads.nativ.NativeADMediaListener; +import com.qq.e.ads.nativ.NativeADEventListener; import com.qq.e.ads.nativ.NativeUnifiedADData; import com.qq.e.comm.constants.AdPatternType; import com.qq.e.comm.util.AdError; +import com.umeng.analytics.MobclickAgent; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; import com.weikou.beibeivideo.BeibeiVideoApplication; @@ -71,9 +71,9 @@ import com.weikou.beibeivideo.util.VideoUtil; import com.weikou.beibeivideo.util.downutil.StringUtils; import com.weikou.beibeivideo.util.ui.IPageEventListener; -import com.yeshi.video.player.VideoDefinition; -import com.yeshi.video.player.VideoEpisode; -import com.yeshi.video.player.VideoPlayerController; +import com.yeshi.video.player.common.VideoDefinition; +import com.yeshi.video.player.common.VideoEpisode; +import com.yeshi.video.player.common.VideoPlayerController; import org.apache.http.Header; import org.json.JSONObject; @@ -83,6 +83,7 @@ import java.math.RoundingMode; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import de.greenrobot.event.EventBus; @@ -119,8 +120,6 @@ //椋庤骞垮憡鍔犺浇鍣� private FSSRFeedAdLoader fssrFeedAdLoader; - - private FSPreMediaView mFSVideoAD; private FunshionPlayInfo playInfo; @@ -192,6 +191,7 @@ @Override public void onAdLoadedFail(int i, String s) { Log.i(TAG, "onAdLoadedFail:" + s); + iadLoadListener.finishAd(); } @Override @@ -249,7 +249,8 @@ fsADView.bindAdToView(imageView, clickableViews, null); } else if (fsad.isVideo()) { MediaView mediaView = new MediaView(getContext()); - fsADView.bindMediaView(mediaView, getVideoOption(), new NativeADMediaListener() { + + fsADView.bindMediaView(mediaView, getVideoOption(), new FSADMediaListener() { @Override public void onVideoClicked() { @@ -262,7 +263,7 @@ } @Override - public void onVideoError(AdError adError) { + public void onVideoError(int i, String s) { iadLoadListener.finishAd(); } @@ -373,6 +374,28 @@ if (mLayoutInflater == null) return; gdtAd = ad; + gdtAd.setNativeAdEventListener(new NativeADEventListener() { + @Override + public void onADClicked() { + Log.v(TAG, "onADClicked"); + } + + @Override + public void onADError(AdError adError) { + Log.v(TAG, "onADError"); + } + + @Override + public void onADExposed() { + Log.v(TAG, "onADExposed"); + } + + @Override + public void onADStatusChanged() { + Log.v(TAG, "onADStatusChanged"); + } + }); + final View mContainer = mLayoutInflater.inflate(R.layout.item_funshion_gdt_ad_view, null); mDownloadButton = mContainer.findViewById(R.id.btn_download); mMediaView = mContainer.findViewById(R.id.gdt_media_view); @@ -443,6 +466,7 @@ } //浣滀负customClickableViews浼犲叆锛岀偣鍑讳笉杩涘叆璇︽儏椤碉紝鐩存帴涓嬭浇鎴栬繘鍏ヨ惤鍦伴〉锛屽彧鏈夎棰戝箍鍛婄敓鏁堬紝 // 濡傛灉鏄浘鏂囷紝clickableViews鍜宑ustomClickableViews鐐瑰嚮閫昏緫涓�鑷� + fsADView.bindAdToView(mContainer, clickableViews, mDownloadButton); if (ad.getAdPatternType() == AdPatternType.NATIVE_VIDEO) { @@ -453,14 +477,13 @@ Log.v(TAG, "showAd type video 2"); mImagePoster.setVisibility(View.GONE); mMediaView.setVisibility(View.VISIBLE); -// ad.startVideo(); } }); //4绉掑唴瑙嗛杩樻病鍔犺浇瀹屾垚鐨勮瘽灏辫烦杩� tv_skip.removeCallbacks(playADErrorRunnable); - tv_skip.postDelayed(playADErrorRunnable, 4000); - fsADView.bindMediaView(mMediaView, getVideoOption(), new NativeADMediaListener() { + tv_skip.postDelayed(playADErrorRunnable, 10000); + fsADView.bindMediaView(mMediaView, getVideoOption(), new FSADMediaListener() { @Override public void onVideoInit() { Log.d(TAG, "onVideoInit: "); @@ -527,12 +550,17 @@ } @Override - public void onVideoError(AdError error) { + public void onVideoError(int i, String s) { iadLoadListener.finishAd(); } - }); - ad.startVideo(); +// mMediaView.post(new Runnable() { +// @Override +// public void run() { +// ad.startVideo(); +// } +// }); + } else if (ad.getAdPatternType() == AdPatternType.NATIVE_2IMAGE_2TEXT || ad.getAdPatternType() == AdPatternType.NATIVE_1IMAGE_2TEXT) { @@ -562,16 +590,12 @@ private void adShowFinish(FunshionPlayInfo info) { fl_ad.setVisibility(View.GONE); fl_ad.removeAllViews(); - mFSVideoAD = null; //鎾斁瑙嗛 mVideoSurfView.postDelayed(new Runnable() { @Override public void run() { //鎾斁瑙嗛 - if (!StringUtils.isNullOrEmpty(info.getPlayUrl().getAid())) - playMedia(info.getPlayUrl().getAid(), (info.getPosition() + 1) + ""); - else - playVideo(info.getPlayUrl().getVid()); + playVideo(info.getPlayUrl().getCode()); } }, 1000); } @@ -626,7 +650,7 @@ /** * 鎾斁瑙嗛 */ - public synchronized void playVideo(String videoID) { + public synchronized void playVideo(String code) { createPlayer(); if (mVideoPlayer.isPlaying()) { FSLogcat.e(TAG, "Call player to stop"); @@ -635,36 +659,15 @@ } //锛侊紒锛佹敞鎰忔挱鏀鹃暱鐭棰戞瀯寤虹殑FSVideoReqData鏈夊尯鍒�傜煭瑙嗛娌℃湁epso鍒嗛泦ID銆傞暱瑙嗛鏈夈�傚~鍐欓敊璇皢鏃犳硶姝e父鎾斁 //FSVideoReqData鏋勫缓闇�瑕佺殑鏁版嵁闇�瑕佷粠鏈嶅姟鍣ㄨ幏鍙栥�備富瑕佹槸濯掍綋璧勬簮videoID锛氣�淰IDEO_ID鈥� 榛樿 娓呮櫚搴︼細new Definition(Definition.CLARITY_LOW) 浠ュ強Accesstoken锛欰ccesstoken - mFSVideoReqData = new FSVideoReqData(videoID, new Definition(Definition.CLARITY_LOW), FunshionConstant.ACCESS_TOKEN); + mFSVideoReqData = new FSVideoReqData(code, new Definition(Definition.CLARITY_SUPPER)); try { Log.d(TAG, "request"); - mFunshionIVideoPlayer.requestAndPrepare(mFSVideoReqData, FunshionConstant.APICODE); + mFunshionIVideoPlayer.requestAndPrepare(mFSVideoReqData); } catch (Exception e) { e.printStackTrace(); } } - - /** - * 鎾斁濯掍綋 - */ - public synchronized void playMedia(String mediaID, String epso) { - createPlayer(); - if (mVideoPlayer.isPlaying()) { - FSLogcat.e(TAG, "Call player to stop"); - mVideoPlayer.stop(); - mVideoPlayer.reset(); - } - //锛侊紒锛佹敞鎰忔挱鏀鹃暱鐭棰戞瀯寤虹殑FSVideoReqData鏈夊尯鍒�傜煭瑙嗛娌℃湁epso鍒嗛泦ID銆傞暱瑙嗛鏈夈�傚~鍐欓敊璇皢鏃犳硶姝e父鎾斁 - //FSVideoReqData鏋勫缓闇�瑕佺殑鏁版嵁闇�瑕佷粠鏈嶅姟鍣ㄨ幏鍙栥�備富瑕佹槸濯掍綋璧勬簮videoID锛氣�淰IDEO_ID鈥漞pso 濯掍綋鍒嗛泦ID 榛樿 娓呮櫚搴︼細new Definition(Definition.CLARITY_LOW) 浠ュ強Accesstoken锛欰ccesstoken - mFSVideoReqData = new FSVideoReqData(mediaID, epso, new Definition(Definition.CLARITY_LOW), FunshionConstant.ACCESS_TOKEN); - try { - Log.d(TAG, "request"); - mFunshionIVideoPlayer.requestAndPrepare(mFSVideoReqData, FunshionConstant.APICODE); - } catch (Exception e) { - e.printStackTrace(); - } - } public synchronized void stopPlay() { if (mVideoPlayer != null && mVideoPlayer.isPlaying()) { @@ -711,6 +714,11 @@ FSCallback mFSCall = new FSCallback() { @Override + public void onFailed(com.funshion.playsdk.constant.FSError fsError) { + Log.d(TAG, fsError.errorMessage); + } + + @Override public void onDefinition(List<Definition> definitions, Definition currDefinition) { for (Definition definition : definitions) { Log.e("FE", "get Definition " + definition); @@ -731,11 +739,6 @@ vdf.setClarity(mCurrDefinition.getStringDefinition()); vdf.setName(getDefinitionName(mCurrDefinition.getStringDefinition())); vpc_funshion.setDefinition(vdfList, vdf); - } - - @Override - public void onFailed(FSError arg0) { - Log.d(TAG, "onFailed" + arg0); } public void onReceiveUrl(String url) { @@ -936,7 +939,8 @@ autoReSize(mediaPlayer); else autoReSize(mVideoPlayer); - vpc_funshion.changeOrien(getActivity().getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + if (getActivity() != null) + vpc_funshion.changeOrien(getActivity().getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } //鐢垫睜鐢甸噺鐩戞帶 @@ -972,6 +976,13 @@ public void onEventMainThread(FunshionPlayInfo info) { + if (VideoUtil.videoEpisodeList == null || VideoUtil.videoEpisodeList.size() == 0) { + //鍔犺浇缂撳瓨鍐呭 + VideoUtil.loadVideoEpisodeListCache(BeibeiVideoApplication.application); + } + //椋庤瑙嗛鎾斁 + MobclickAgent.onEventObject(BeibeiVideoApplication.application, "funtv-play", new HashMap<>()); + Log.i(TAG, "onEventMainThread:FunshionPlayInfo"); mCurrentPosition = info.getPosition(); List<VideoEpisode> episodes = new ArrayList<>(); @@ -987,19 +998,23 @@ episodes.add(es); } - vpc_funshion.setContentView(fl_container).setVideoInfo(episodes, info.getPosition(), mVideoInfo.getShowType(), "椋庤").setVideoPlayerListener(this).build(getActivity(), FunshionPlayerFragment.this); - loadAD(new IADLoadListener() { - @Override - public void finishAd() { - vpc_funshion.post(new Runnable() { - @Override - public void run() { - tv_skip.setVisibility(View.GONE); - adShowFinish(info); - } - }); - } - }); + try { + vpc_funshion.setContentView(fl_container).setVideoInfo(episodes, info.getPosition(), mVideoInfo.getShowType(), "椋庤").setVideoPlayerListener(this).build(getActivity(), FunshionPlayerFragment.this); + loadAD(new IADLoadListener() { + @Override + public void finishAd() { + vpc_funshion.post(new Runnable() { + @Override + public void run() { + tv_skip.setVisibility(View.GONE); + adShowFinish(info); + } + }); + } + }); + } catch (Exception e) { + Log.i(TAG, "鍑洪敊浜嗭細" + e.getMessage()); + } } @@ -1054,6 +1069,14 @@ if (mVideoPlayer != null && mVideoPlayer.isPlaying()) mVideoPlayer.pause(); + //鎾斁缁熻 + BeibeiVideoAPI.playStatistic(BeibeiVideoApplication.application, mVideoInfo.getId(), videoResource.getId() + "", new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + }); + BeibeiVideoAPI.getPlayUrl(BeibeiVideoApplication.application, uid, detailInfo.getType(), mVideoInfo.getId(), detailInfo.getId(), videoResource.getId(), detailInfo.geteId(), new BasicTextHttpResponseHandler() { @@ -1083,6 +1106,8 @@ .optString("Params")); info.setAid(data.optString("Aid")); info.setVid(data.optString("Vid")); + info.setCode(jsonObject.getJSONObject("Data") + .optString("Code")); playInfo.setPlayUrl(info); mShowAd = false; EventBus.getDefault().post(playInfo); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/FXBrowserActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java similarity index 79% rename from BuWanVideo/src/com/weikou/beibeivideo/ui/mine/FXBrowserActivity.java rename to BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java index 7c4bc23..6eb2142 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/FXBrowserActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java @@ -1,11 +1,13 @@ -package com.weikou.beibeivideo.ui.mine; +package com.weikou.beibeivideo.ui.video; +import android.app.Instrumentation; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.res.Configuration; +import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.PixelFormat; @@ -23,8 +25,10 @@ import android.view.WindowManager; import android.webkit.ConsoleMessage; import android.webkit.DownloadListener; +import android.webkit.JavascriptInterface; import android.webkit.SslErrorHandler; import android.webkit.WebChromeClient; +import android.webkit.WebResourceRequest; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; @@ -35,27 +39,30 @@ import android.widget.Toast; import com.lcjian.library.util.ManifestDataUtil; -import com.tencent.smtt.export.external.interfaces.IX5WebChromeClient; +import com.lcjian.library.util.common.StringUtils; import com.umeng.analytics.MobclickAgent; import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.ui.BaseActivity; -import com.weikou.beibeivideo.ui.media.VideoDetailActivity; import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; +import com.weikou.beibeivideo.util.browser.BWJavaInterface; import com.weikou.beibeivideo.util.downutil.DownFiles; import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; import com.weikou.beibeivideo.widget.CustomWebView; +import com.yeshi.video.player.util.PlayerFullScreenUtil; -public class FXBrowserActivity extends BaseActivity implements OnClickListener { +public class VideoPlayerBrowserActivity extends BaseActivity implements OnClickListener { private TextView tv_top_bar_left; private TextView tv_url; private TextView tv_title; private TextView tv_right; - private CustomWebView webview; + private WebView webview; private FrameLayout fl_webview; ProgressBar progressBar; private final String TAG = "FXBrowserActivity"; + + private Runnable playerJSRunnable = null; @Override protected void onCreate(Bundle savedInstanceState) { @@ -88,14 +95,16 @@ fl_webview = findViewById(R.id.fl_webview); tv_top_bar_left.setOnClickListener(this); - webview = new CustomWebView(FXBrowserActivity.this); - fl_webview.addView(webview, new FrameLayout.LayoutParams( - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT)); + webview = findViewById(R.id.webView); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setPluginState(WebSettings.PluginState.ON); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + + webview.addJavascriptInterface(new YeshiPlayerJavascriptInterface(), "yeshiPlayer"); webview.setDrawingCacheBackgroundColor(0x00000000); webview.setFocusableInTouchMode(true); @@ -111,11 +120,19 @@ webview.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { + Log.i(TAG, "shouldOverrideUrlLoading:" + url); + return super.shouldOverrideUrlLoading(view, url); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + String url = request.getUrl().toString(); + Log.i(TAG, "shouldOverrideUrlLoading:" + url); if (url != null && url.startsWith("buwanprotocol://")) { String murl = url.split("buwanprotocol://")[1]; String[] params = murl.split("#"); if (params[0].equalsIgnoreCase("playvideo")) { - Intent intent = new Intent(FXBrowserActivity.this, VideoDetailActivity2.class); + Intent intent = new Intent(VideoPlayerBrowserActivity.this, VideoDetailActivity2.class); Bundle bundle = new Bundle(); bundle.putString("Id", params[1]); bundle.putString("ResourceId", params[2]); @@ -130,33 +147,42 @@ return true; } else if (!url.startsWith("http")) return true; - return super.shouldOverrideUrlLoading(view, url); + + return super.shouldOverrideUrlLoading(view, request); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + Log.i(TAG, "onPageStarted:" + url); + super.onPageStarted(view, url, favicon); } @Override public void onPageFinished(WebView webView, String s) { super.onPageFinished(webView, s); - - webView.postDelayed(new Runnable() { + Log.i(TAG, "onPageFinished:" + s); + if (playerJSRunnable != null) + webview.removeCallbacks(playerJSRunnable); + playerJSRunnable = new Runnable() { @Override public void run() { - String js = "setInterval(function(){ $('.full-btn').click(function(){"; - js += "var el= document.getElementById('j-player-layout');"; - js += "if (el.requestFullscreen) {\n" + - "el.requestFullscreen();\n" + - "} else if (el.msRequestFullscreen) {\n" + - "el.msRequestFullscreen();\n" + - "} else if (el.mozRequestFullScreen) {\n" + - "el.mozRequestFullScreen();\n" + - "} else if (el.webkitRequestFullscreen) {\n" + - "el.webkitRequestFullscreen();\n" + - "}"; - js += "});},2000);"; - if (webView != null) - webView.loadUrl("javascript:" + js); + if (webview == null || webView == null) + return; + String js = null; + String url = webview.getUrl(); + if (webView != null && !StringUtils.isEmpty(url)) { + if (url.contains(".fun.tv")) {//椋庤 + js = PlayerFullScreenUtil.getFunShionFullScreenJS(getApplicationContext()); + } else if (url.contains("m.acfun.cn")) {//Acfun + js = PlayerFullScreenUtil.getAcfunFullScreenJS(getApplicationContext()); + } + if (!StringUtils.isEmpty(js)) + webView.loadUrl("javascript:" + js); + } } - }, 1000); - + }; + if (playerJSRunnable != null) + webview.postDelayed(playerJSRunnable, 1000); } @Override @@ -222,18 +248,11 @@ progressBar.setMax(100); progressBar.setProgressDrawable(this.getResources() .getDrawable(R.drawable.color_progressbar)); - loadHander.sendEmptyMessage(0); +// loadHander.sendEmptyMessage(0); + String url = getIntent().getStringExtra("url"); + webview.loadUrl(url); + tv_url.setText(url); } - - Handler loadHander = new Handler() { - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - String url = getIntent().getStringExtra("url"); - webview.loadUrl(url); - tv_url.setText(url); - } - }; // 鏂囦欢涓嬭浇鐩戝惉 @@ -269,11 +288,11 @@ Log.i("DownFiles", "getProgress涓嬭浇杩涘害:" + p); } else { if (manager == null) { - Toast.makeText(FXBrowserActivity.this, "鏂囦欢宸茬粡寮�濮嬩笅杞�", + Toast.makeText(VideoPlayerBrowserActivity.this, "鏂囦欢宸茬粡寮�濮嬩笅杞�", Toast.LENGTH_SHORT).show(); manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); String id = "UMENG_CHANNEL"; - String description = ManifestDataUtil.getAppMetaData(FXBrowserActivity.this, id); + String description = ManifestDataUtil.getAppMetaData(VideoPlayerBrowserActivity.this, id); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { int importance = NotificationManager.IMPORTANCE_HIGH; NotificationChannel mChannel = new NotificationChannel(id, "123", importance); @@ -283,7 +302,7 @@ mChannel.enableVibration(true); mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); manager.createNotificationChannel(mChannel); - oBuilder = new Notification.Builder(FXBrowserActivity.this, id); + oBuilder = new Notification.Builder(VideoPlayerBrowserActivity.this, id); oBuilder.setContentTitle("褰辫澶у叏") .setSmallIcon(R.drawable.ic_launcher) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) @@ -291,7 +310,7 @@ .setAutoCancel(true) .build(); } else { - builder = new NotificationCompat.Builder(FXBrowserActivity.this); + builder = new NotificationCompat.Builder(VideoPlayerBrowserActivity.this); builder.setContentTitle("褰辫澶у叏") .setContentText("鐑棬搴旂敤涓嬭浇") .setSmallIcon(R.drawable.ic_launcher) @@ -358,6 +377,8 @@ @Override protected void onDestroy() { + if (playerJSRunnable != null) + webview.removeCallbacks(playerJSRunnable); if (webview != null) { webview.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); webview.clearHistory(); @@ -366,6 +387,8 @@ webview.destroy(); webview = null; } + + super.onDestroy(); } @@ -431,4 +454,32 @@ findViewById(R.id.top).setVisibility(View.VISIBLE); } } + + class YeshiPlayerJavascriptInterface { + + @JavascriptInterface + public boolean isFullScreen() { + if ((VideoPlayerBrowserActivity.this.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) + == WindowManager.LayoutParams.FLAG_FULLSCREEN) { + return true; + } + return false; + } + + @JavascriptInterface + public void setPortrait() { + if (isFullScreen()) { + //妯℃嫙杩斿洖鎸夐挳 + new Thread(new Runnable() { + @Override + public void run() { + Instrumentation inst = new Instrumentation(); + inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK); + } + }).start(); + + } + } + + } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/AlibcTradeUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/AlibcTradeUtil.java index 097633b..2516ac0 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/AlibcTradeUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/AlibcTradeUtil.java @@ -75,7 +75,7 @@ } }); } catch (Error e) { - + e.printStackTrace(); } //濡傛灉鏈畨瑁呮墜鏈烘窐瀹� if (!ApkUtil.checkAPP(context, "com.taobao.taobao")) { diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java b/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java index bb37957..a499fb8 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java @@ -4,15 +4,19 @@ public class BeibeiConstant { - public final static boolean IS_TEST = true; + 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 final static boolean AD_SETTING_RECOMMEND_FIRST = true; //鏄惁鏈夊紑灞忓箍鍛� public final static boolean AD_SETTING_KAIPIN = true; - public static final String USER_AGREEMENT = "http://ysdq.yeshitv.com:8089/BuWan/api_control_ios.jsp"; - public static final String PRIVACY_POLICY = "http://ysdq.yeshitv.com:8089/BuWan/user_protocol.jsp"; + public static final String USER_AGREEMENT = "http://ysdq.yeshitv.com:8089/BuWan/api_control_ios_bw.jsp"; + public static final String PRIVACY_POLICY = "http://ysdq.yeshitv.com:8089/BuWan/user_protocol_bw.jsp"; + + public static final String ABOUT_US = "http://bwweb.yeshitv.com/abountOur/index.html"; public static final String HOST = "http://api.ysdq.yeshitv.com:8089";//姝e紡涓婄嚎鐗堟湰 diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java new file mode 100644 index 0000000..216d10b --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java @@ -0,0 +1,29 @@ +package com.weikou.beibeivideo.util; + +import android.content.Context; +import android.content.SharedPreferences; + +public class ConfigUtil { + + public static void saveVipLink(Context context, String link) { + saveConfig("vipLink", link, context); + } + + public static String getVipLink(Context context) { + return getConfig("vipLink", context); + } + + private static void saveConfig(String key, String value, Context context) { + SharedPreferences.Editor editor = context.getSharedPreferences("config", Context.MODE_PRIVATE).edit(); + editor.putString(key, value); + editor.commit(); + } + + + private static String getConfig(String key, Context context) { + SharedPreferences share = context.getSharedPreferences("config", Context.MODE_PRIVATE); + return share.getString(key, ""); + } + + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/FunshionConstant.java b/BuWanVideo/src/com/weikou/beibeivideo/util/FunshionConstant.java index 514fd3f..da15806 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/FunshionConstant.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/FunshionConstant.java @@ -3,7 +3,7 @@ public class FunshionConstant { public static String ACCESS_TOKEN = "Zms4NHZseSwxNjAwODQ5NjI3LDU2ZjNhZDJjNTE5YTBiMDE5YzU3OTAxZmE0YjgyMjVi"; - public final static String APICODE = "fk84vly"; + public final static String APP_ID = "b22whcwhkc4uczk7"; public final static String AD_PARTENER = "bfys"; public final static String AD_ADP = "bfys_a_qt"; public final static String AD_TOKEN = "0104c93918044fe79f8a6ff2af6827b0"; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java index ae80b98..50fa2fe 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java @@ -2,10 +2,20 @@ import android.content.Context; import android.content.SharedPreferences; +import android.view.View; +import com.bumptech.glide.Glide; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.R; +import com.weikou.beibeivideo.entity.UserInfo; +import com.weikou.beibeivideo.entity.vo.UserInfoVO; import com.weikou.beibeivideo.util.downutil.StringUtils; + +import org.apache.http.Header; +import org.json.JSONObject; import static android.content.Context.MODE_PRIVATE; @@ -53,4 +63,138 @@ String uid = preferences.getString("LoginUid", ""); return uid; } + + + public static boolean isLogin(Context context) { + String uid = getLoginUid(context); + return !StringUtils.isNullOrEmpty(uid); + } + + public static UserInfo getLoginUserInfo(Context context) { + + UserInfoVO vo = getLoginUserInfoDetail(context); + if (vo != null) { + UserInfo userInfo = new UserInfo(); + userInfo.setId(vo.getId()); + userInfo.setNickname(vo.getNickName()); + userInfo.setPortrait(vo.getPortrait()); + return userInfo; + } + + SharedPreferences sp_user = context.getSharedPreferences("user", + Context.MODE_PRIVATE); + String uid = sp_user.getString("LoginUid", ""); + boolean isLogin = !com.lcjian.library.util.common.StringUtils.isEmpty(uid);// 鑾峰彇鐧诲綍鐘舵�� + if (isLogin) { + UserInfo userInfo = new UserInfo(); + userInfo.setId(uid); + String portrait = sp_user.getString("portrait", "");// 鐢ㄦ埛澶村儚 + String name = sp_user.getString("name", "");// 鐢ㄦ埛鍚嶇О + userInfo.setNickname(name); + userInfo.setPortrait(portrait); + return userInfo; + } else { + return null; + } + } + + + /** + * 鑾峰彇鐢ㄦ埛璇︽儏(鏂扮増鏈�) + * + * @param context + * @return + */ + public static UserInfoVO getLoginUserInfoDetail(Context context) { + SharedPreferences sp_user = context.getSharedPreferences("user", + Context.MODE_PRIVATE); + String detail = sp_user.getString("detail", ""); + + if (StringUtils.isNullOrEmpty(detail)) { + return null; + } else { + return new Gson().fromJson(detail, UserInfoVO.class); + } + } + + /** + * 淇濆瓨鐢ㄦ埛璇︽儏 + * + * @param context + * @param vo + */ + public static void saveLoginUserDetail(Context context, UserInfoVO vo) { + if (context == null || vo == null) + return; + SharedPreferences.Editor editor = context.getSharedPreferences("user", + Context.MODE_PRIVATE).edit(); + editor.putString("detail", new Gson().toJson(vo)); + editor.commit(); + } + + + /** + * 閫�鍑虹櫥褰� + * + * @param context + */ + public static void logout(Context context) { + SharedPreferences.Editor editor = context.getSharedPreferences("user", + Context.MODE_PRIVATE).edit(); + editor.remove("detail"); + editor.remove("LoginUid"); + editor.remove("portrait"); + editor.remove("name"); + editor.putBoolean("PushType", false); + editor.commit(); + } + + + public static void updateUserInfo(Context context, IUserInfoUpdateListener listener) { + if (context == null) + return; + String loginUid = UserUtil.getLoginUid(context); + if (com.lcjian.library.util.common.StringUtils.isEmpty(loginUid)) { + if (listener != null) + listener.noLogin(); + return; + } + BeibeiVideoAPI.getPersonInfo(context, UserUtil.getUid(context), loginUid, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + if (jsonObject.optBoolean("IsPost")) { + JSONObject data = jsonObject.optJSONObject("Data"); + UserInfoVO userInfoVO = new Gson().fromJson(data.toString(), UserInfoVO.class); + //缂撳瓨璧锋潵 + if (userInfoVO != null && userInfoVO.getId() != null) { + UserUtil.saveLoginUserDetail(context, userInfoVO); + } + if (listener != null) + listener.onSuccess(); + } else { + if (listener != null) + listener.onFail(jsonObject.optString("Error")); + } + } + + @Override + public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { + super.onFailure(statusCode, headers, responseString, throwable); + if (listener != null) + listener.onFail(responseString); + } + }); + + } + + public interface IUserInfoUpdateListener { + public void noLogin(); + + public void onSuccess(); + + public void onFail(String msg); + + } + + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/VideoUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/VideoUtil.java index 3549382..2cf9d43 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/VideoUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/VideoUtil.java @@ -1,5 +1,10 @@ package com.weikou.beibeivideo.util; +import android.content.Context; +import android.content.SharedPreferences; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import com.lcjian.library.util.common.StringUtils; import com.weikou.beibeivideo.entity.VideoDetailInfo; @@ -11,6 +16,32 @@ public final static List<VideoDetailInfo> videoEpisodeList = new ArrayList<>(); + /** + * 淇濆瓨涓存椂鍓ч泦 + * + * @param context + * @param episodeList + * @param append + */ + public static void saveVideoEpisodeList(Context context, List<VideoDetailInfo> episodeList, boolean append) { + if (episodeList == null) + episodeList = new ArrayList<>(); + if (!append) + videoEpisodeList.clear(); + videoEpisodeList.addAll(episodeList); + saveTempVideoDetailList(context, videoEpisodeList); + } + + /** + * 娓呴櫎涓存椂鍓ч泦 + * + * @param context + */ + public static void clearVideoEpisodeList(Context context) { + videoEpisodeList.clear(); + saveTempVideoDetailList(context, new ArrayList<>()); + } + public static String getWatchCountShortName(String watchCount) { DecimalFormat df = new DecimalFormat("###.0"); @@ -22,4 +53,41 @@ } + private static void saveTempVideoDetailList(Context context, List<VideoDetailInfo> detailInfos) { + SharedPreferences sharedPreferences = context.getSharedPreferences("videoTempInfo", Context.MODE_PRIVATE); + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.putString("videoDetailInfoList", new Gson().toJson(detailInfos)); + editor.commit(); + } + + + /** + * 鑾峰彇涓存椂鍓ч泦 + * + * @param context + * @return + */ + private static List<VideoDetailInfo> getTempVideoDetailList(Context context) { + SharedPreferences sharedPreferences = context.getSharedPreferences("videoTempInfo", Context.MODE_PRIVATE); + String content = sharedPreferences.getString("videoDetailInfoList", ""); + if (!StringUtils.isEmpty(content)) { + return new Gson().fromJson(content, new TypeToken<List<VideoDetailInfo>>() { + }.getType()); + } + return new ArrayList<>(); + } + + /** + * 浠庣紦瀛樹腑鍔犺浇 + * + * @param context + */ + public static void loadVideoEpisodeListCache(Context context) { + List<VideoDetailInfo> detailList = getTempVideoDetailList(context); + VideoUtil.videoEpisodeList.clear(); + if (detailList != null && detailList.size() > 0) + VideoUtil.videoEpisodeList.addAll(detailList); + } + + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/AdUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/AdUtil.java index 4065590..144f247 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/AdUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/AdUtil.java @@ -28,6 +28,7 @@ public final static String POSITION_VIDEO_PLAY_PRE = "videoPlayPre";//瑙嗛鎾斁鍓嶈创 public final static String POSITION_EXIT_APP = "exitApp";//APP閫�鍑哄箍鍛� public final static String POSITION_SEARCH = "videoSearch";//鎼滅储椤靛箍鍛� + public final static String POSITION_VIDEO_DETAIL_FULL_VIDEO = "videoDetailFullVideo";//瑙嗛鍏ㄥ睆骞垮憡 public static AD_TYPE getSmallExpressAdType() { if (BeibeiConstant.AD_TYPE != null && AdTypeVO.TYPE_CSJ.equalsIgnoreCase(BeibeiConstant.AD_TYPE.getExpressSmallType())) { diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/ExpressAdManager.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/ExpressAdManager.java index 3ecb41d..4b8c757 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/ExpressAdManager.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/ExpressAdManager.java @@ -180,6 +180,8 @@ } else if (sourceType == AdUtil.AD_TYPE.gdt2) { pid = GDTConstant.PID_2_VIDEO_DETAIL_PLAY_EXPRESS1; } + if (mContext == null) + return; //鑾峰彇灞忓箷鐨勫 int deviceWidth = DimenUtils.getScreenWidth(mContext); deviceWidth = DimenUtils.px2dip(mContext, deviceWidth); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BWJavaInterface.java b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BWJavaInterface.java index ad53d28..5e92578 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BWJavaInterface.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BWJavaInterface.java @@ -1,6 +1,7 @@ package com.weikou.beibeivideo.util.browser; import android.app.Activity; +import android.app.Dialog; import android.content.Intent; import android.content.pm.PackageManager; import android.support.v4.content.ContextCompat; @@ -10,6 +11,9 @@ import com.lcjian.library.util.common.StringUtils; import com.tencent.smtt.sdk.WebView; +import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; +import com.weikou.beibeivideo.ui.login.LoginActivity; +import com.weikou.beibeivideo.ui.login.PhoneLoginActivity; import com.weikou.beibeivideo.util.AlibcTradeUtil; import com.weikou.beibeivideo.util.JumpActivityUtil; @@ -24,12 +28,15 @@ TextView tv_top_bar_middle, tv_top_bar_left2, tv_top_bar_right; ImageView iv_right; WebView webview; + private Dialog loadingDialog; public BWJavaInterface(Activity activity, WebView webview) { super(activity); mContext = activity; this.webview = webview; + loadingDialog = LoadingDialogUtil.getLoadingDialog(activity, ""); } + public BWJavaInterface(Activity activity, TextView tv_top_bar_middle , TextView tv_top_bar_left2, TextView tv_top_bar_right @@ -41,6 +48,33 @@ this.tv_top_bar_right = tv_top_bar_right; this.iv_right = iv_right; this.webview = webview; + loadingDialog = LoadingDialogUtil.getLoadingDialog(activity, ""); + } + + + @JavascriptInterface + public void showLoading() { + if (loadingDialog != null && !loadingDialog.isShowing() && mContext != null) { + + mContext.runOnUiThread(new Runnable() { + @Override + public void run() { + loadingDialog.show(); + } + }); + } + } + + @JavascriptInterface + public void hideLoading() { + if (loadingDialog != null && loadingDialog.isShowing() && mContext != null) { + mContext.runOnUiThread(new Runnable() { + @Override + public void run() { + loadingDialog.dismiss(); + } + }); + } } @JavascriptInterface @@ -115,6 +149,27 @@ AlibcTradeUtil.openAuthLink(mContext, url); } + /** + * 鐧诲綍 + */ + @JavascriptInterface + public void login() { + Intent intent = new Intent(mContext, LoginActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + mContext.startActivity(intent); + } + + /** + * 鐢佃瘽鍙风爜缁戝畾 + */ + @JavascriptInterface + public void bindPhone() { + Intent intent = new Intent(mContext, PhoneLoginActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra("login", false); + mContext.startActivity(intent); + } + // 鍒ゆ柇鏉冮檺闆嗗悎 鏄惁鎺堟潈 false鎺堟潈 true鏈巿鏉� public boolean lacksPermissions(String... permissions) { for (String permission : permissions) { @@ -130,4 +185,6 @@ //鏉冮檺鏈巿鏉� return ContextCompat.checkSelfPermission(mContext, permission) == PackageManager.PERMISSION_DENIED; } + + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BaseBWJavaInterface.java b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BaseBWJavaInterface.java index e352280..df408f0 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BaseBWJavaInterface.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/BaseBWJavaInterface.java @@ -9,11 +9,11 @@ import com.alibaba.baichuan.android.trade.model.OpenType; import com.alibaba.fastjson.JSON; import com.google.gson.Gson; -import com.iBookStar.views.YmConfig; import com.lcjian.library.util.SystemCommon; 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.DEScrypt; import com.lcjian.library.util.security.MD5Utils; import com.umeng.analytics.MobclickAgent; import com.weikou.beibeivideo.BeibeiVideoAPI; @@ -155,11 +155,11 @@ ClipboardUtil.emptyClipboard(mContext); } - - //杩涘叆灏忚 @JavascriptInterface - public void openNovel() { - YmConfig.openReader(); + public String apiDecode(String result) { + + return DEScrypt.decode(result); + } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java new file mode 100644 index 0000000..bf6d299 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java @@ -0,0 +1,115 @@ +package com.weikou.beibeivideo.util.browser; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.webkit.JavascriptInterface; +import android.widget.Toast; + +import com.alibaba.baichuan.android.trade.model.AlibcShowParams; +import com.alibaba.baichuan.android.trade.model.OpenType; +import com.alibaba.fastjson.JSON; +import com.google.gson.Gson; +import com.lcjian.library.util.SystemCommon; +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.DEScrypt; +import com.lcjian.library.util.security.MD5Utils; +import com.umeng.analytics.MobclickAgent; +import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.entity.UserInfo; +import com.weikou.beibeivideo.entity.vo.UserInfoVO; +import com.weikou.beibeivideo.ui.login.LoginActivity; +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; + +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; + +import static android.content.Context.MODE_PRIVATE; + +public class PPJavaInterface { + private Context mContext; + private IEventListener eventListener; + + public PPJavaInterface(Context context, IEventListener eventListener) { + mContext = context; + this.eventListener = eventListener; + } + + + /** + * 璺宠浆鐧诲綍椤� + */ + @JavascriptInterface + public void login() { + eventListener.onLogin(); + } + + + /** + * 杩斿洖鐢ㄦ埛淇℃伅锛圝SON鏍煎紡锛夈�� + * code涓�0鏍囪瘑鐢ㄦ埛鏈櫥褰曪紝data鐨勫�间负绌猴紱 + * code涓�1琛ㄧず鐢ㄦ埛宸茬粡鐧诲綍锛宒ata涓虹敤鎴蜂俊鎭� + * 濡傦細 {"code":1,"data":{"code":"123","nickname":"鏄电О","isSVip":false,"isCoupon":false}} + * + * @return + */ + @JavascriptInterface + public String getUserInfo() { + try { + JSONObject root = new JSONObject(); + UserInfoVO user = UserUtil.getLoginUserInfoDetail(mContext); + if (user == null) { + root.put("code", 0); + UserUtil.updateUserInfo(mContext != null ? mContext.getApplicationContext() : mContext, null); + } else { + root.put("code", 1); + JSONObject data = new JSONObject(); + data.put("code", user.getPptvUid()); + data.put("nickname", user.getNickName()); + data.put("isSVip", (user.getVipExpireTime() != null && user.getVipExpireTime() > System.currentTimeMillis())); + data.put("isCoupon", false); + root.put("data", data); + } + return root.toString(); + } catch (Exception e) { + + } + return null; + } + + + /** + * 璇曠湅缁撴潫 + */ + @JavascriptInterface + public void tryPlayFinish() { + eventListener.onTryPlayFinish(); + } + + /** + * 瑙嗛鎾斁瀹屾垚 + */ + @JavascriptInterface + public void playFinish() { + eventListener.onPlayFinish(); + } + + public interface IEventListener { + public void onLogin(); + + public void onTryPlayFinish(); + + public void onPlayFinish(); + + + } + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/novel/NovelJNZUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/novel/NovelJNZUtil.java deleted file mode 100644 index dbd667f..0000000 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/novel/NovelJNZUtil.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.weikou.beibeivideo.util.novel; - -import android.content.Context; - -import com.iBookStar.views.YmConfig; -import com.weikou.beibeivideo.util.UserUtil; -import com.weikou.beibeivideo.util.downutil.StringUtils; - -public class NovelJNZUtil { - - public static void setUid(Context context) { - String uid = UserUtil.getLoginUid(context); - if (!StringUtils.isNullOrEmpty(uid)) - YmConfig.setOutUserId(uid); - } -} diff --git a/build.gradle b/build.gradle index a9b6a8b..b2dcdb6 100644 --- a/build.gradle +++ b/build.gradle @@ -4,10 +4,13 @@ jcenter() mavenCentral() google() + maven { + url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" + } } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:4.1.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b5da585..d537198 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 19 09:32:23 CST 2019 +#Tue Dec 15 10:16:03 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/library-BaiduCPU/src/main/java/com/yeshi/ec/library_baiducpu/fragment/BaiDuCPUContentFragment.java b/library-BaiduCPU/src/main/java/com/yeshi/ec/library_baiducpu/fragment/BaiDuCPUContentFragment.java index 9be7994..da6adc6 100644 --- a/library-BaiduCPU/src/main/java/com/yeshi/ec/library_baiducpu/fragment/BaiDuCPUContentFragment.java +++ b/library-BaiduCPU/src/main/java/com/yeshi/ec/library_baiducpu/fragment/BaiDuCPUContentFragment.java @@ -163,6 +163,8 @@ private void initData() { Bundle bundle = getArguments(); BaiDuCPUType item = (BaiDuCPUType) bundle.getSerializable("item"); + if (item == null) + return; viewType = bundle.getInt("viewType"); bundle.clear(); mChannelId = item.getId(); diff --git a/library-VideoPlayer/src/main/assets/player_acfun.js b/library-VideoPlayer/src/main/assets/player_acfun.js new file mode 100644 index 0000000..842df34 --- /dev/null +++ b/library-VideoPlayer/src/main/assets/player_acfun.js @@ -0,0 +1,25 @@ +setInterval(function () { + console.log('acfun锛�'); + $('.acmplayer-fullscreen-btn').unbind("click"); + $('.acmplayer-fullscreen-btn').click(function () { + if(!yeshiPlayer.isFullScreen()) + { + console.log('acfun鍏ㄥ睆'); + var el = document.getElementById('mPlayer'); + if (el.requestFullscreen) { + el.requestFullscreen(); + } else if (el.msRequestFullscreen) { + el.msRequestFullscreen(); + } else if (el.mozRequestFullScreen) { + el.mozRequestFullScreen(); + } else if (el.webkitRequestFullscreen) { + el.webkitRequestFullscreen(); + } + }else{ + console.log('acfun灏忓睆'); + yeshiPlayer.setPortrait(); + } + + return false; + }); +}, 2000); \ No newline at end of file diff --git a/library-VideoPlayer/src/main/assets/player_funshion.js b/library-VideoPlayer/src/main/assets/player_funshion.js new file mode 100644 index 0000000..a0162d3 --- /dev/null +++ b/library-VideoPlayer/src/main/assets/player_funshion.js @@ -0,0 +1,25 @@ +setInterval(function () { + for(var i=0;i<$('.full-btn').length;i++){ + $('.full-btn').eq(i).unbind("click"); + } + $('.full-btn').click(function () { + if(!yeshiPlayer.isFullScreen()) + { + console.log('椋庤鍏ㄥ睆'); + var el = document.getElementById('j-player-layout'); + if (el.requestFullscreen) { + el.requestFullscreen(); + } else if (el.msRequestFullscreen) { + el.msRequestFullscreen(); + } else if (el.mozRequestFullScreen) { + el.mozRequestFullScreen(); + } else if (el.webkitRequestFullscreen) { + el.webkitRequestFullscreen(); + } + }else{ + console.log('椋庤灏忓睆'); + yeshiPlayer.setPortrait(); + } + return false; + }); +}, 2000); \ No newline at end of file diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDataNotifyDialog.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDataNotifyDialog.java similarity index 97% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDataNotifyDialog.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDataNotifyDialog.java index e7ba847..d363498 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDataNotifyDialog.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDataNotifyDialog.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; import android.app.Activity; import android.app.Dialog; @@ -9,6 +9,7 @@ import android.view.WindowManager; import com.lcjian.library.util.common.DimenUtils; +import com.yeshi.video.player.R; public class VideoDataNotifyDialog extends Dialog { diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDefinition.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDefinition.java similarity index 91% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDefinition.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDefinition.java index d1f25eb..3ae42db 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDefinition.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoDefinition.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; //瑙嗛娓呮櫚搴� public class VideoDefinition { diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisode.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisode.java similarity index 95% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisode.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisode.java index 566c500..5a39af9 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisode.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisode.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; public class VideoEpisode { private String id; diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisodeDialog.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisodeDialog.java similarity index 98% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisodeDialog.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisodeDialog.java index 1c8dc57..8397a5e 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisodeDialog.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoEpisodeDialog.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; import android.app.Activity; import android.app.Dialog; @@ -17,6 +17,7 @@ import android.widget.TextView; import com.lcjian.library.util.common.DimenUtils; +import com.yeshi.video.player.R; import java.util.List; diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoPlayerController.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoPlayerController.java similarity index 98% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoPlayerController.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoPlayerController.java index 0c73a92..b2ef168 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoPlayerController.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoPlayerController.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; import android.app.Activity; import android.content.Context; @@ -36,6 +36,7 @@ import com.lcjian.library.entity.eventbus.PlayerLock; import com.lcjian.library.util.common.DimenUtils; import com.lcjian.library.util.common.TimeUtil; +import com.yeshi.video.player.R; import java.util.List; import java.util.Timer; @@ -193,7 +194,10 @@ * @param resourceName * @return */ - public VideoPlayerController setVideoInfo(List<VideoEpisode> episodeList, int playingPosition, int showType, String resourceName) { + public VideoPlayerController setVideoInfo(List<VideoEpisode> episodeList, int playingPosition, int showType, String resourceName) throws Exception { + if (playingPosition >= episodeList.size()) { + throw new Exception("闆嗘暟鏁扮粍瓒婄晫"); + } VideoEpisode currentVideoEpisode = episodeList.get(playingPosition); this.videoName = currentVideoEpisode.getName(); this.videoUrl = currentVideoEpisode.getVideoUrl(); @@ -704,7 +708,7 @@ aq.id(R.id.view_bottom_fill).visibility(View.GONE); aq.id(R.id.tv_time_cutline).visibility(View.GONE); - aq.id(R.id.seekBar).getSeekBar().setProgress(seekBar.getProgress()); + aq.id(R.id.seekBar_portrait).getSeekBar().setProgress(seekBar.getProgress()); } VideoResourceUtil.setPlayImage(iv_play, mediaPlayer != null ? mediaPlayer.isPlaying() : false, isLand); } diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoResourceUtil.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoResourceUtil.java similarity index 97% rename from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoResourceUtil.java rename to library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoResourceUtil.java index f43c4c5..f786a3a 100644 --- a/library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoResourceUtil.java +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/common/VideoResourceUtil.java @@ -1,4 +1,4 @@ -package com.yeshi.video.player; +package com.yeshi.video.player.common; import android.view.ViewGroup; import android.widget.ImageView; diff --git a/library-VideoPlayer/src/main/java/com/yeshi/video/player/util/PlayerFullScreenUtil.java b/library-VideoPlayer/src/main/java/com/yeshi/video/player/util/PlayerFullScreenUtil.java new file mode 100644 index 0000000..406e6fc --- /dev/null +++ b/library-VideoPlayer/src/main/java/com/yeshi/video/player/util/PlayerFullScreenUtil.java @@ -0,0 +1,46 @@ +package com.yeshi.video.player.util; + +import android.content.Context; + +import com.lcjian.library.util.common.FileUtils; +import com.lcjian.library.util.common.StringUtils; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 鎾斁鍣ㄥ叏灞� + */ +public class PlayerFullScreenUtil { + + private static String getJSContent(Context context, String name) { + try { + InputStream inputStream = context.getAssets().open(name); + return StringUtils.convertStreamToString(inputStream); + } catch (IOException e) { + e.printStackTrace(); + } + return ""; + } + + /** + * 椋庤鍏ㄥ睆JS浠g爜 + * + * @return + */ + public static String getFunShionFullScreenJS(Context context) { + return getJSContent(context, "player_funshion.js"); + } + + + /** + * 鑾峰彇Acfun鍏ㄥ睆浠g爜 + * + * @return + */ + public static String getAcfunFullScreenJS(Context context) { + return getJSContent(context, "player_acfun.js"); + } + + +} diff --git a/library-common/build.gradle b/library-common/build.gradle index cbe398e..bcd7bc7 100644 --- a/library-common/build.gradle +++ b/library-common/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'android-library' +apply plugin: 'com.android.library' dependencies { // api fileTree(include: '*.jar', dir: 'libs') diff --git a/library-common/src/com/lcjian/library/upgrade/UpdateService.java b/library-common/src/com/lcjian/library/upgrade/UpdateService.java index 1375841..e9d998c 100644 --- a/library-common/src/com/lcjian/library/upgrade/UpdateService.java +++ b/library-common/src/com/lcjian/library/upgrade/UpdateService.java @@ -81,7 +81,7 @@ //鍒ゆ柇鏄惁鏄疉ndroidN浠ュ強鏇撮珮鐨勭増鏈� if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - Uri contentUri = FileProvider.getUriForFile(context.getApplicationContext(), BuildConfig.APPLICATION_ID + ".fileprovider", file); + Uri contentUri = FileProvider.getUriForFile(context.getApplicationContext(), context.getPackageName() + ".fileprovider", file); intent.setDataAndType(contentUri, "application/vnd.android.package-archive"); } else { Uri uri = Uri.fromFile(file); diff --git a/library-common/src/com/lcjian/library/util/common/StringUtils.java b/library-common/src/com/lcjian/library/util/common/StringUtils.java index 0b23980..d110d99 100644 --- a/library-common/src/com/lcjian/library/util/common/StringUtils.java +++ b/library-common/src/com/lcjian/library/util/common/StringUtils.java @@ -145,7 +145,7 @@ // 鍒ゆ柇瀛楃涓叉槸鍚︿负鎵嬫満鍙风爜 public static boolean isMobileNumber(String aTelNumber) { - Pattern p = Pattern.compile("(^1((((3[5-9])|(47)|(5[0-2])|(5[7-9])|(82)|(8[7-8]))\\d{8})|((34[0-8])\\d{7}))$)|(^1((3[0-2])|(5[5-6])|(8[0-6]))\\d{8}$)|(^1((33[0-9])|(349)|(53[0-9])|(80[0-9])|(89[0-9]))\\d{7}$)"); + Pattern p = Pattern.compile("^((13[0-9])|(14[0-9])|(16[0-9])|(17[0-9])|(15[0-9])|(18[0-9])|(19[0-9]))\\d{8}$"); Matcher m = p.matcher(aTelNumber); return m.matches(); } -- Gitblit v1.8.0