6个文件已删除
7 文件已重命名
53个文件已修改
40个文件已添加
| | |
| | | android:label="@string/app_name" |
| | | android:largeHeap="true" |
| | | android:theme="@style/AppTheme" |
| | | android:usesCleartextTraffic="true" |
| | | tools:replace="android:allowBackup"> |
| | | |
| | | <activity |
| | |
| | | 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"> |
| | |
| | | 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" |
| | |
| | | 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" |
| | |
| | | |
| | | |
| | | <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" /> |
| | | |
| | | |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="vivo"></meta-data> |
| | | android:value="qq"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | |
| | | <activity android:name="com.weikou.wpc.superad.BrowserActivity" /> |
| | | |
| | | <!-- 【必须】 信鸽receiver广播接收 --> |
| | | <receiver |
| | |
| | | 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') |
| | |
| | | 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 |
| | |
| | | //微信SDK |
| | | api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' |
| | | |
| | | //加载动画库 |
| | | implementation 'com.github.ybq:Android-SpinKit:1.4.0' |
| | | |
| | | |
| | | } |
| | | android { |
| | | signingConfigs { |
| | |
| | | } |
| | | 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 |
| | |
| | | } |
| | | 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 { |
| | |
| | | flatDir { |
| | | dirs 'libs' |
| | | } |
| | | mavenCentral() |
| | | maven { |
| | | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | } |
| | | } |
| | |
| | | <?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> |
New file |
| | |
| | | <?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> |
New file |
| | |
| | | <?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> |
New file |
| | |
| | | <?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> |
| | |
| | | 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 |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/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> |
| | |
| | | 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 |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/top" |
| | | android:layout_width="match_parent" |
| | |
| | | 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" |
| | |
| | | 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> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/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> |
New file |
| | |
| | | <?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> |
| | |
| | | </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> |
| | | |
| | |
| | | <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"> |
| | |
| | | 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> |
| | |
| | | </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 |
| | |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical" |
| | | android:padding="8dp"> |
| | |
| | | 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" |
| | |
| | | |
| | | </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="开通VIP,看蓝光院线大片!" |
| | | 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" |
| | |
| | | <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> |
| | | |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全布丸</string> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="recommend">推荐</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
| | |
| | | <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> |
| | |
| | | package com.doudou.ysvideo.wxapi; |
| | | |
| | | |
| | | import android.app.Activity; |
| | | import android.app.ProgressDialog; |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | |
| | | 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; |
| | |
| | | edit.putString("sex", |
| | | user.optString("sex")); |
| | | edit.commit(); |
| | | |
| | | NovelJNZUtil.setUid(getApplicationContext()); |
| | | |
| | | SingleToast.showToast(getApplicationContext(), |
| | | "登录成功"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 电话号码绑定 |
| | | * |
| | | * @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 |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | //播放统计 |
| | | 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>(); |
| | |
| | | } |
| | | |
| | | |
| | | 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<>(); |
| | |
| | | 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; |
| | |
| | | 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 { |
| | | |
| | |
| | | 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() { |
| | |
| | | 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) { |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void onFailure(int code, String msg) { |
| | | Log.i(TAG,"百川初始化失败:"+code+"-"+msg); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | SDCardUtil.initStorage(this); |
| | | //初始化一次Banner,否则后面Banner使用时会出现卡顿 |
| | | // 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、您可以随时查询、更正、删除您的个人信息,我们也提供账户注销的渠道。<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() { |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ConfigUtil.saveVipLink(getApplicationContext(), vipLink); |
| | | loadSplashAd(splash, pid); |
| | | } |
| | | } else { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | * @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() { |
| | |
| | | |
| | | @Override |
| | | public void onADLoaded(List<NativeUnifiedADData> list) { |
| | | Log.i(TAG,"onADLoaded"); |
| | | Log.i(TAG, "onADLoaded"); |
| | | final NativeUnifiedADData ad = list.get(0); |
| | | //填充内容 |
| | | mGDTAdData = ad; |
| | |
| | | @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(); |
| | |
| | | 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; |
| | | |
New file |
| | |
| | | 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 |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | findViewById(R.id.login_tv_cancel).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | finish(); |
| | | onResult(RESULT_CANCELED); |
| | | } |
| | | }); |
| | | |
| | |
| | | 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登录逻辑处理 点击登录后需要暂时锁定返回键和返回功能 不然会报错 |
| | |
| | | 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(); |
| | |
| | | data.get("gender")); |
| | | edit.commit(); |
| | | |
| | | NovelJNZUtil.setUid(getApplicationContext()); |
| | | |
| | | SingleToast.showToast(LoginActivity.this, |
| | | "登录成功"); |
| | | XGPush.registerPush(LoginActivity.this); |
| | | finish(); |
| | | onResult(RESULT_OK); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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, "登录失败"); |
| | | } |
| | |
| | | public void onResume() { |
| | | super.onResume(); |
| | | if (!StringUtils.isEmpty(getSharedPreferences("user", Context.MODE_PRIVATE).getString("LoginUid", ""))) { |
| | | finish(); |
| | | onResult(RESULT_OK); |
| | | } |
| | | MobclickAgent.onPageStart("登录页"); |
| | | } |
| | |
| | | response.getString("gender")); |
| | | edit.commit(); |
| | | |
| | | NovelJNZUtil.setUid(getApplicationContext()); |
| | | |
| | | SingleToast.showToast(LoginActivity.this, |
| | | "登录成功"); |
| | | XGPush.registerPush(LoginActivity.this); |
| | | finish(); |
| | | onResult(RESULT_OK); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | private void onResult(int resultCode) { |
| | | boolean result = getIntent().getBooleanExtra("result", false); |
| | | if (result) { |
| | | Intent intent = new Intent(); |
| | | //把返回数据存入Intent |
| | | setResult(resultCode, intent); |
| | | //关闭Activity |
| | | finish(); |
| | | } else { |
| | | //关闭Activity |
| | | finish(); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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", |
| | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | }); |
| | |
| | | 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(); |
| | | } |
| | | }) |
| | |
| | | return; |
| | | } else { |
| | | tv_autograph.setText(str); |
| | | updatePersonInfo(null, null, str, null, null); |
| | | alertDialog.dismiss(); |
| | | } |
| | | } |
| | |
| | | SingleToast.showToast(PersonInfoActivity.this, "昵称不能为空"); |
| | | } else { |
| | | tv_nickName.setText(str); |
| | | updatePersonInfo(null, null, null, null, str); |
| | | dialog.dismiss(); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | tv_birthday.setText(date); |
| | | updatePersonInfo(null, date, null, null, null); |
| | | alertDialog.dismiss(); |
| | | } |
| | | }); |
New file |
| | |
| | | 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())) { |
| | | //模拟的是必须登录 否则直接退出app的场景 |
| | | // 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; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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、您可以随时查询、更正、删除您的个人信息,我们也提供账户注销的渠道。<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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 展示悬浮广告 |
| | |
| | | fl_indicator.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | builder.create().show(); |
| | | try { |
| | | builder.create().show(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | }, 2000); |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | }.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(); |
| | | |
| | |
| | | |
| | | @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 |
| | |
| | | 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; |
| | |
| | | }); |
| | | 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)); |
| | | } |
| | | |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | 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; |
| | | /** |
| | | * 用于表示登录状态 |
| | | */ |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | //书架 |
| | | case R.id.ll_mine_novel: |
| | | YmConfig.openReader(); |
| | | break; |
| | | case R.id.rl_mine_message: |
| | | openMsg(); |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | * 初始化用户登录信息 |
| | | */ |
| | | 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())) |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | 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( |
| | |
| | | } else { |
| | | mUpdateBadgeView.hide(); |
| | | } |
| | | |
| | | getPersonInfo(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | private void getPersonInfo() { |
| | | UserUtil.updateUserInfo(getContext(), new UserUtil.IUserInfoUpdateListener() { |
| | | @Override |
| | | public void noLogin() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFail(String msg) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | .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); |
| | |
| | | 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) { |
| | |
| | | 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; |
| | |
| | | }.getType()); |
| | | if (list != null && list.size() > 0) { |
| | | episodePage++; |
| | | VideoUtil.videoEpisodeList.addAll(list); |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,list,true); |
| | | rv_episode.getAdapter().notifyDataSetChanged(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | public void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.video_detail_activity); |
| | | VideoUtil.videoEpisodeList.clear(); |
| | | VideoUtil.clearVideoEpisodeList(this); |
| | | /* |
| | | * 计算状态栏高度并设置 |
| | | */ |
| | |
| | | return; |
| | | } else if (playUrl.getPlayType() == 1) { |
| | | Intent intent = new Intent(VideoDetailActivity.this, |
| | | FXBrowserActivity.class); |
| | | VideoPlayerBrowserActivity.class); |
| | | intent.putExtra("url", playUrl.getUrl()); |
| | | startActivity(intent); |
| | | saveWatchHistory("风行"); |
| | |
| | | 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) { |
| | |
| | | .optString("Aid")); |
| | | info.setVid(jsonObject.getJSONObject("Data") |
| | | .optString("Vid")); |
| | | info.setCode(jsonObject.getJSONObject("Data") |
| | | .optString("Code")); |
| | | playUrl = info; |
| | | if (videoInfo == null) { |
| | | return; |
| | |
| | | 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) { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | public void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.video_detail_activity); |
| | | VideoUtil.videoEpisodeList.clear(); |
| | | VideoUtil.clearVideoEpisodeList(this); |
| | | /* |
| | | * 计算状态栏高度并设置 |
| | | */ |
| | |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | 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) { |
| | |
| | | return; |
| | | } else if (playUrl.getPlayType() == 1) { |
| | | Intent intent = new Intent(VideoDetailActivity2.this, |
| | | VideoPlayerActivity.class); |
| | | VideoPlayerBrowserActivity.class); |
| | | intent.putExtra("url", playUrl.getUrl()); |
| | | startActivity(intent); |
| | | initPlayer(); |
| | |
| | | return; |
| | | } else if (playUrl.getPlayType() == 1) { |
| | | Intent intent = new Intent(VideoDetailActivity2.this, |
| | | FXBrowserActivity.class); |
| | | VideoPlayerBrowserActivity.class); |
| | | intent.putExtra("url", playUrl.getUrl()); |
| | | startActivity(intent); |
| | | saveWatchHistory("风行"); |
| | |
| | | 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()); |
| | |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | Log.i(TAG, "onResume"); |
| | | super.onResume(); |
| | | EventBus.getDefault().register(this); |
| | | if (fl_ad.getVisibility() == View.GONE) { |
| | |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | Log.i(TAG, "onPause"); |
| | | super.onPause(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | |
| | | } catch (IndexOutOfBoundsException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void onEventMainThread(VideoInfo info) { |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | getUrl(VideoUtil.videoEpisodeList.get(0), |
| | | isSetup); |
| | | true); |
| | | findViewById(android.R.id.content).postDelayed( |
| | | new Runnable() { |
| | | |
| | |
| | | .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; |
| | |
| | | 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 |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | super.onResume(); |
| | | EventBus.getDefault().register(this); |
| | | MobclickAgent.onPageStart("播放详情—选集"); |
| | | Log.i(TAG,"onResume"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | isShowMore = false; |
| | | page_varietyshow = 0; |
| | | MobclickAgent.onPageEnd("播放详情—选集"); |
| | | Log.i(TAG,"onPause"); |
| | | } |
| | | |
| | | public void onEventMainThread(VideoInfo info) { |
| | |
| | | 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"); |
| | | } |
| | | } |
| | |
| | | .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); |
| | |
| | | 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; |
| | |
| | | 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.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; |
| | |
| | | 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; |
| | |
| | | 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]; |
| | |
| | | } |
| | | 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); |
| | |
| | | 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 { |
| | |
| | | super.onResume(); |
| | | MobclickAgent.onPageStart("网页"); |
| | | // webview.reload(); |
| | | if(webview!=null){ |
| | | webview.loadUrl("javascript:onResume()"); |
| | | } |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | 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,"正在加载"); |
| | | // 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()"); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | //风行广告加载器 |
| | | private FSSRFeedAdLoader fssrFeedAdLoader; |
| | | |
| | | private FSPreMediaView mFSVideoAD; |
| | | |
| | | private FunshionPlayInfo playInfo; |
| | | |
| | |
| | | @Override |
| | | public void onAdLoadedFail(int i, String s) { |
| | | Log.i(TAG, "onAdLoadedFail:" + s); |
| | | iadLoadListener.finishAd(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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() { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError(AdError adError) { |
| | | public void onVideoError(int i, String s) { |
| | | iadLoadListener.finishAd(); |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | } |
| | | //作为customClickableViews传入,点击不进入详情页,直接下载或进入落地页,只有视频广告生效, |
| | | // 如果是图文,clickableViews和customClickableViews点击逻辑一致 |
| | | |
| | | fsADView.bindAdToView(mContainer, clickableViews, mDownloadButton); |
| | | |
| | | if (ad.getAdPatternType() == AdPatternType.NATIVE_VIDEO) { |
| | |
| | | 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: "); |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | 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); |
| | | } |
| | |
| | | /** |
| | | * 播放视频 |
| | | */ |
| | | public synchronized void playVideo(String videoID) { |
| | | public synchronized void playVideo(String code) { |
| | | createPlayer(); |
| | | if (mVideoPlayer.isPlaying()) { |
| | | FSLogcat.e(TAG, "Call player to stop"); |
| | |
| | | } |
| | | //!!!注意播放长短视频构建的FSVideoReqData有区别。短视频没有epso分集ID。长视频有。填写错误将无法正常播放 |
| | | //FSVideoReqData构建需要的数据需要从服务器获取。主要是媒体资源videoID:“VIDEO_ID” 默认 清晰度:new Definition(Definition.CLARITY_LOW) 以及Accesstoken:Accesstoken |
| | | 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。长视频有。填写错误将无法正常播放 |
| | | //FSVideoReqData构建需要的数据需要从服务器获取。主要是媒体资源videoID:“VIDEO_ID”epso 媒体分集ID 默认 清晰度:new Definition(Definition.CLARITY_LOW) 以及Accesstoken:Accesstoken |
| | | 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()) { |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | 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); |
| | | } |
| | | |
| | | //电池电量监控 |
| | |
| | | |
| | | |
| | | 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<>(); |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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() { |
| | |
| | | .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); |
File was renamed from BuWanVideo/src/com/weikou/beibeivideo/ui/mine/FXBrowserActivity.java |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | |
| | | 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); |
| | |
| | | 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]); |
| | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | }; |
| | | |
| | | // 文件下载监听 |
| | | |
| | |
| | | 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); |
| | |
| | | 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)) |
| | |
| | | .setAutoCancel(true) |
| | | .build(); |
| | | } else { |
| | | builder = new NotificationCompat.Builder(FXBrowserActivity.this); |
| | | builder = new NotificationCompat.Builder(VideoPlayerBrowserActivity.this); |
| | | builder.setContentTitle("影视大全") |
| | | .setContentText("热门应用下载") |
| | | .setSmallIcon(R.drawable.ic_launcher) |
| | |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | if (playerJSRunnable != null) |
| | | webview.removeCallbacks(playerJSRunnable); |
| | | if (webview != null) { |
| | | webview.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); |
| | | webview.clearHistory(); |
| | |
| | | webview.destroy(); |
| | | webview = null; |
| | | } |
| | | |
| | | |
| | | super.onDestroy(); |
| | | } |
| | | |
| | |
| | | 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(); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | } catch (Error e) { |
| | | |
| | | e.printStackTrace(); |
| | | } |
| | | //如果未安装手机淘宝 |
| | | if (!ApkUtil.checkAPP(context, "com.taobao.taobao")) { |
| | |
| | | |
| | | 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";//正式上线版本 |
| | | |
New file |
| | |
| | | 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, ""); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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"; |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | 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); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | 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"); |
| | |
| | | } |
| | | |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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())) { |
| | |
| | | } 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); |
| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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) { |
| | |
| | | //权限未授权 |
| | | return ContextCompat.checkSelfPermission(mContext, permission) == PackageManager.PERMISSION_DENIED; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | ClipboardUtil.emptyClipboard(mContext); |
| | | } |
| | | |
| | | |
| | | //进入小说 |
| | | @JavascriptInterface |
| | | public void openNovel() { |
| | | YmConfig.openReader(); |
| | | public String apiDecode(String result) { |
| | | |
| | | return DEScrypt.decode(result); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 返回用户信息(JSON格式)。 |
| | | * code为0标识用户未登录,data的值为空; |
| | | * code为1表示用户已经登录,data为用户信息 |
| | | * 如: {"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(); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 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' |
| | | } |
| | | } |
| | | |
| | |
| | | #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 |
| | |
| | | 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(); |
New file |
| | |
| | | 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); |
New file |
| | |
| | | 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); |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDataNotifyDialog.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | |
| | | import android.view.WindowManager; |
| | | |
| | | import com.lcjian.library.util.common.DimenUtils; |
| | | import com.yeshi.video.player.R; |
| | | |
| | | public class VideoDataNotifyDialog extends Dialog { |
| | | |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoDefinition.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | //视频清晰度 |
| | | public class VideoDefinition { |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisode.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | public class VideoEpisode { |
| | | private String id; |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoEpisodeDialog.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.lcjian.library.util.common.DimenUtils; |
| | | import com.yeshi.video.player.R; |
| | | |
| | | import java.util.List; |
| | | |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoPlayerController.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | |
| | | 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; |
| | |
| | | * @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(); |
| | |
| | | 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); |
| | | } |
File was renamed from library-VideoPlayer/src/main/java/com/yeshi/video/player/VideoResourceUtil.java |
| | |
| | | package com.yeshi.video.player; |
| | | package com.yeshi.video.player.common; |
| | | |
| | | import android.view.ViewGroup; |
| | | import android.widget.ImageView; |
New file |
| | |
| | | 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代码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getFunShionFullScreenJS(Context context) { |
| | | return getJSContent(context, "player_funshion.js"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取Acfun全屏代码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getAcfunFullScreenJS(Context context) { |
| | | return getJSContent(context, "player_acfun.js"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | apply plugin: 'android-library' |
| | | apply plugin: 'com.android.library' |
| | | |
| | | dependencies { |
| | | // api fileTree(include: '*.jar', dir: 'libs') |
| | |
| | | //判断是否是AndroidN以及更高的版本 |
| | | 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); |
| | |
| | | |
| | | // 判断字符串是否为手机号码 |
| | | 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(); |
| | | } |