| | |
| | | android:exported="false" |
| | | android:launchMode="singleTop" |
| | | android:screenOrientation="behind" /> |
| | | |
| | | <activity |
| | | android:name="com.cmic.sso.sdk.activity.LoginAuthActivity" |
| | | android:configChanges="orientation|keyboardHidden|screenSize" |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="huawei"></meta-data> |
| | | android:value="QQ"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | </intent-filter> |
| | | </receiver> |
| | | |
| | | <!-- 【必须】 信鸽receiver广播接收 --> |
| | | <receiver |
| | | android:name="com.tencent.android.tpush.XGPushReceiver" |
| | | android:process=":xg_service_v2"> |
| | | <intent-filter android:priority="0x7fffffff"> |
| | | <!-- 【必须】 信鸽SDK的内部广播 --> |
| | | <action android:name="com.tencent.android.tpush.action.SDK" /> |
| | | <action android:name="com.tencent.android.tpush.action.INTERNAL_PUSH_MESSAGE" /> |
| | | <!-- 【必须】 系统广播:开屏和网络切换 --> |
| | | <action android:name="android.intent.action.USER_PRESENT" /> |
| | | <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
| | | |
| | | <!-- 【可选】 一些常用的系统广播,增强信鸽service的复活机会,请根据需要选择。当然,你也可以添加APP自定义的一些广播让启动service --> |
| | | <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> |
| | | <action android:name="android.intent.action.ACTION_POWER_CONNECTED" /> |
| | | <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <receiver |
| | | android:name="com.weikou.beibeivideo.BeibeiMessageHandler" |
| | | android:exported="true"> |
| | | <intent-filter> |
| | | |
| | | <!-- 接收消息透传 --> |
| | | <action android:name="com.tencent.android.tpush.action.PUSH_MESSAGE" /> |
| | | <!-- 监听注册、反注册、设置/删除标签、通知被点击等处理结果 --> |
| | | <action android:name="com.tencent.android.tpush.action.FEEDBACK" /> |
| | | </intent-filter> |
| | | </receiver> |
| | | <!-- 【必须】 (2.30及以上版新增)展示通知的activity --> |
| | | <!-- 【注意】 如果被打开的activity是启动模式为SingleTop,SingleTask或SingleInstance,请根据通知的异常自查列表第8点处理--> |
| | | <activity |
| | | android:name="com.tencent.android.tpush.XGPushActivity" |
| | | android:exported="false"> |
| | | <intent-filter> |
| | | <!-- 若使用AndroidStudio,请设置android:name="android.intent.action"--> |
| | | <action android:name="android.intent.action" /> |
| | | </intent-filter> |
| | | </activity> |
| | | |
| | | <!-- 【必须】 信鸽service --> |
| | | <service |
| | | android:name="com.tencent.android.tpush.service.XGPushService" |
| | | android:exported="true" |
| | | android:persistent="true" |
| | | android:process=":xg_service_v2" /> |
| | | |
| | | <!-- 【必须】 通知service,此选项有助于提高抵达率 --> |
| | | <service |
| | | android:name="com.tencent.android.tpush.rpc.XGRemoteService" |
| | | android:exported="true"> |
| | | <intent-filter> |
| | | <action android:name="com.doudou.ysvideo.PUSH_ACTION" /> |
| | | </intent-filter> |
| | | </service> |
| | | |
| | | <!-- 【必须】 请将YOUR_ACCESS_ID修改为APP的AccessId,“21”开头的10位数字,中间没空格 --> |
| | | <meta-data |
| | | android:name="XG_V2_ACCESS_ID" |
| | | android:value="2100218527" /> |
| | | <!-- 【必须】 请将YOUR_ACCESS_KEY修改为APP的AccessKey,“A”开头的12位字符串,中间没空格 --> |
| | | <meta-data |
| | | android:name="XG_V2_ACCESS_KEY" |
| | | android:value="A5H4W4C3RG8T" /> |
| | | |
| | | |
| | | <!--PPTV--> |
| | | <!-- 必须配置action,否则无法跨进程启动 --> |
| | | <!--<service android:name="com.pplive.sdk.PPTVSdkService">--> |
| | |
| | | android:grantUriPermissions="true"> |
| | | <meta-data |
| | | android:name="android.support.FILE_PROVIDER_PATHS" |
| | | android:resource="@xml/gdt_file_path" /> |
| | | android:resource="@xml/gdt_file_path" |
| | | tools:replace="android:resource" /> |
| | | </provider> |
| | | |
| | | |
| | |
| | | |
| | | |
| | | <!-- 华为推送自动初始化 --> |
| | | |
| | | <meta-data |
| | | android:name="push_kit_auto_init_enabled" |
| | | android:value="true" /> |
| | | android:value="false" /> |
| | | <!-- 华为推送服务注册 --> |
| | | <service android:name=".service.HWPushService"> |
| | | <intent-filter> |
| | |
| | | implementation 'androidx.appcompat:appcompat:1.0.0' |
| | | 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.16.aar') |
| | | // implementation files('libs/FunshionBase-1.6.1.aar') |
| | | implementation files('libs/FunshionBase-2.0.0.0.aar') |
| | |
| | | implementation project(path: ':library-GDTSDK') |
| | | implementation project(path: ':library-SocialSdk') |
| | | implementation project(path: ':library-APPUpdate') |
| | | //穿山甲广告 |
| | | implementation(name: 'open_ad_sdk', ext: 'aar') |
| | | //阿里百川 |
| | | |
| | | //穿山甲广告 |
| | | implementation files('libs/open_ad_sdk_3.9.0.2.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 'com.alibaba.sdk.android:AlibcTradeCommon:4.0.0.15@aar' |
| | | implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.15@aar' |
| | | implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.15@aar' |
| | | |
| | | |
| | | implementation 'androidx.cardview:cardview:1.0.0' |
| | | |
| | | |
| | | //权限请求 |
| | | implementation 'com.github.jokermonn:permissions4m:2.1.2-lib' |
| | | implementation project(path: ':library-EventBus') |
| | | // implementation project(path: ':library-EventBus') |
| | | implementation project(path: ':library-VideoPlayer') |
| | | implementation project(path: ':library-common') |
| | | implementation project(path: ':library-push') |
| | |
| | | } |
| | | } |
| | | useLibrary 'org.apache.http.legacy' |
| | | compileSdkVersion 28 |
| | | compileSdkVersion 29 |
| | | buildToolsVersion '29.0.2' |
| | | compileOptions { |
| | | sourceCompatibility JavaVersion.VERSION_1_7 |
| | |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 114 |
| | | versionName "3.9.5" |
| | | versionCode 118 |
| | | versionName "3.9.9" |
| | | multiDexEnabled = true |
| | | minSdkVersion 17 |
| | | targetSdkVersion 27 |
| | | targetSdkVersion 29 |
| | | ndk { |
| | | abiFilters "armeabi" |
| | | //兼容64位与32位系统 |
| | | abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' |
| | | } |
| | | |
| | | manifestPlaceholders = [ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | project.afterEvaluate { |
| | | project.android.applicationVariants.all { variant -> |
| | | variant.outputs.each { output -> |
| | | output.processResources.doFirst { pm -> |
| | | String manifestPath = output.processResources.manifestFile; |
| | | def manifestContent = file(manifestPath).getText() |
| | | //删除注释,防止注释里面的中文乱码导致更改后的内容系统无法正常解析 |
| | | manifestContent = manifestContent.replaceAll("<!--[\\s\\S]*?-->", "") |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.CAMERA" />', '') |
| | | manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.BLUETOOTH" />', '') |
| | | |
| | | println "AndroidManifest-Content:" |
| | | println manifestContent |
| | | file(manifestPath).write(manifestContent) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | repositories { |
| | | flatDir { |
| | | dirs 'libs' |
| | |
| | | android:layout_gravity="center_vertical" |
| | | android:background="@drawable/selector_user_agreement_checkbox" |
| | | android:button="@null" |
| | | android:checked="true" |
| | | android:checked="false" |
| | | android:gravity="center" |
| | | android:visibility="gone" /> |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="登录即表示同意" |
| | | android:text="勾选即代表同意" |
| | | android:textColor="#B3B8D3" |
| | | android:textSize="11sp" /> |
| | | |
| | |
| | | android:orientation="horizontal"> |
| | | |
| | | <CheckBox |
| | | android:visibility="gone" |
| | | android:visibility="visible" |
| | | 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="true" |
| | | android:checked="false" |
| | | android:gravity="center" /> |
| | | |
| | | |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="注册即表示同意" |
| | | android:text="勾选即代表同意" |
| | | android:textColor="@color/login_protocol_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | |
| | | <FrameLayout |
| | | android:id="@+id/fl_advertisement" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_ad_pic" |
| | |
| | | <ImageView |
| | | android:id="@+id/iv_search_ad" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" /> |
| | | android:layout_height="match_parent" /> |
| | | |
| | | </FrameLayout> |
| | | |
| | |
| | | private static AsyncHttpClient sortTimeAsyncHttpClient = new AsyncHttpClient(); |
| | | |
| | | static { |
| | | |
| | | mOkHttpClient = new OkHttpClient().newBuilder() |
| | | .connectTimeout(10 * 1000, TimeUnit.SECONDS)//设置超时时间 |
| | | .readTimeout(10 * 1000, TimeUnit.SECONDS)//设置读取超时时间 |
| | |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | |
| | | import androidx.multidex.MultiDex; |
| | | |
| | | import android.util.Log; |
| | | |
| | | 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.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.weikou.beibeivideo.ui.push.PushOpenClickActivity; |
| | | 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.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.CSJConstant; |
| | | import com.weikou.beibeivideo.util.ad.GDTConstant; |
| | | import com.weikou.beibeivideo.util.ad.TTAdManagerHolder; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.yeshi.push.PushUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import androidx.multidex.MultiDex; |
| | | |
| | | |
| | | |
| | | public class BeibeiVideoApplication extends Application { |
| | | |
| | | private final String TAG = BeibeiVideoApplication.class.getName(); |
| | | private final static String TAG = BeibeiVideoApplication.class.getName(); |
| | | |
| | | public static BeibeiVideoApplication application = null; |
| | | public static String deviceName = null; |
| | |
| | | return instance; |
| | | } |
| | | |
| | | private Handler handler = new Handler() { |
| | | private static Handler handler = new Handler() { |
| | | @Override |
| | | public void handleMessage(Message msg) { |
| | | super.handleMessage(msg); |
| | |
| | | }; |
| | | |
| | | |
| | | private IAuthCodeGetter.AuthCodeCallBack authCodeCallBack; |
| | | private static IAuthCodeGetter.AuthCodeCallBack authCodeCallBack; |
| | | |
| | | @Override |
| | | public void onCreate() { |
| | |
| | | CrashHandler crashHandler = CrashHandler.getInstance(); |
| | | crashHandler.init(getApplicationContext()); |
| | | } |
| | | //取消热启动开屏广告 |
| | | // this.registerActivityLifecycleCallbacks(new MyActivityLifecycleCallbacks()); |
| | | application = this; |
| | | instance = this; |
| | | MultiDex.install(this); |
| | | if (UserUtil.isAgreeUserProtocol(this)||BeibeiConstant.IS_TEST) { |
| | | //如果同意了用户协议 |
| | | init(application); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 静态初始化 |
| | | * |
| | | * @param application |
| | | */ |
| | | public static void init(final Application application) { |
| | | //友盟初始化 |
| | | String description = ManifestDataUtil.getAppMetaData(this, "UMENG_CHANNEL"); |
| | | UMConfigure.init(this, getResources().getString(R.string.umeng_key), description, UMConfigure.DEVICE_TYPE_PHONE, null); |
| | | String description = ManifestDataUtil.getAppMetaData(application, "UMENG_CHANNEL"); |
| | | UMConfigure.init(application, application.getResources().getString(R.string.umeng_key), description, UMConfigure.DEVICE_TYPE_PHONE, null); |
| | | // 选用AUTO页面采集模式 |
| | | MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); |
| | | |
| | | |
| | | UMShareAPI.get(this); |
| | | UMShareAPI.get(application); |
| | | PlatformConfig.setWeixin(BeibeiConstant.WECHAT_ID, BeibeiConstant.WECHAT_KEY); |
| | | PlatformConfig.setQQZone(BeibeiConstant.QQ_ID, BeibeiConstant.QQ_KEY); |
| | | PlatformConfig.setSinaWeibo(BeibeiConstant.SINA_ID, BeibeiConstant.SINA_KEY, "http://sns.whalecloud.com/sina2/callback"); |
| | | super.onCreate(); |
| | | instance = this; |
| | | ImageLoader.getInstance().init(buildDefaultILC(this)); |
| | | |
| | | ImageLoader.getInstance().init(buildDefaultILC(application)); |
| | | // initX5(); |
| | | initCSJAd(); |
| | | GDTADManager.getInstance().initWith(this, BeibeiConstant.GDT_ID); |
| | | initWX(); |
| | | initTaoKe(); |
| | | try { |
| | | //初始化播放插件 |
| | | FSPlayer.init(this, FunshionConstant.APP_ID, new IAuthCodeGetter() { |
| | | @Override |
| | | public void getAuthCode(AuthCodeCallBack authCodeCallBack) { |
| | | BeibeiVideoApplication.this.authCodeCallBack = authCodeCallBack; |
| | | handler.sendEmptyMessage(0); |
| | | } |
| | | }, new FunshionPlayInitCallback() { |
| | | initCSJAd(application); |
| | | GDTADManager.getInstance().initWith(application, BeibeiConstant.GDT_ID); |
| | | initWX(application); |
| | | initTaoKe(application); |
| | | |
| | | @Override |
| | | public void onSuccess() { |
| | | Log.i(TAG, "风行播放器初始化成功"); |
| | | } |
| | | |
| | | @Override |
| | | public void onFail(int i, String s) { |
| | | Log.i(TAG, "风行播放器初始化失败:" + i + "-" + s); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // try { |
| | | // //初始化播放插件 |
| | | // FSPlayer.init(application, FunshionConstant.APP_ID, new IAuthCodeGetter() { |
| | | // @Override |
| | | // public void getAuthCode(AuthCodeCallBack authCodeCallBack) { |
| | | // BeibeiVideoApplication.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_WHITE_THEME); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | //推送 |
| | | PushUtil.inintPush(this, new PushUtil.ITokenListener() { |
| | | |
| | | @Override |
| | | public void onToken(String romType, String regId) { |
| | | BeibeiVideoAPI.pushBindToken(application, romType, regId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | |
| | | } |
| | | }, true); |
| | | } |
| | | }); |
| | | |
| | | Intent intent = new Intent(this, PushOpenClickActivity.class); |
| | | Intent intent = new Intent(application, PushOpenClickActivity.class); |
| | | intent.putExtra("activity", "test"); |
| | | JSONObject params = new JSONObject(); |
| | | try { |
| | |
| | | } |
| | | |
| | | |
| | | private void initWX() { |
| | | private static void initWX(Context context) { |
| | | //AppConst.WEIXIN.APP_ID是指你应用在微信开放平台上的AppID,记得替换 |
| | | mWxApi = WXAPIFactory.createWXAPI(this, BeibeiConstant.WECHAT_ID, true); |
| | | mWxApi = WXAPIFactory.createWXAPI(context, BeibeiConstant.WECHAT_ID, true); |
| | | // 将该app注册到微信 |
| | | mWxApi.registerApp(BeibeiConstant.WECHAT_ID); |
| | | registerReceiver(new BroadcastReceiver() { |
| | | context.registerReceiver(new BroadcastReceiver() { |
| | | @Override |
| | | public void onReceive(Context context, Intent intent) { |
| | | // 将该app注册到微信 |
| | |
| | | } |
| | | |
| | | |
| | | private void initTaoKe() { |
| | | AlibcTradeSDK.asyncInit(this, new AlibcTradeInitCallback() { |
| | | private static void initTaoKe(Application application) { |
| | | AlibcTradeSDK.asyncInit(application, new AlibcTradeInitCallback() { |
| | | @Override |
| | | public void onSuccess() { |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private ImageLoaderConfiguration buildDefaultILC(Context context) { |
| | | private static ImageLoaderConfiguration buildDefaultILC(Context context) { |
| | | // This configuration tuning is custom. You can tune every option, you may tune some of them, |
| | | // or you can create default configuration by |
| | | // ImageLoaderConfiguration.createDefault(this); method. |
| | |
| | | /** |
| | | * 穿山甲广告初始化 |
| | | */ |
| | | private void initCSJAd() { |
| | | TTAdManagerHolder.init(this); |
| | | private static void initCSJAd(Context context) { |
| | | TTAdManagerHolder.init(context); |
| | | } |
| | | |
| | | |
| | |
| | | @Expose |
| | | private boolean fullVideo; |
| | | |
| | | //全屏视频广告比例 |
| | | @Expose |
| | | private int fullVideoWeight; |
| | | |
| | | //插屏广告比例 |
| | | @Expose |
| | | private int interstitialWeight; |
| | | |
| | | public boolean isPlayVideo() { |
| | | return playVideo; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public int getFullVideoWeight() { |
| | | return fullVideoWeight; |
| | | } |
| | | |
| | | public void setFullVideoWeight(int fullVideoWeight) { |
| | | this.fullVideoWeight = fullVideoWeight; |
| | | } |
| | | |
| | | public int getInterstitialWeight() { |
| | | return interstitialWeight; |
| | | } |
| | | |
| | | public void setInterstitialWeight(int interstitialWeight) { |
| | | this.interstitialWeight = interstitialWeight; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.File; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class DownLoadFileService extends Service { |
| | | private NotificationManager manager; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import static android.content.pm.PackageManager.PERMISSION_DENIED; |
| | | import static android.content.pm.PackageManager.PERMISSION_GRANTED; |
| | | |
| | | public class SplashActivity extends BaseActivity { |
| | |
| | | vg_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | //初始化 |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application); |
| | | myRequetPermission(); |
| | | } |
| | | }); |
| | |
| | | |
| | | private void myRequetPermission() { |
| | | if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PERMISSION_GRANTED) { |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE); |
| | | //是否需要再次请求权限 |
| | | if (sharedPreferences.getBoolean("show", true)) |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | else |
| | | next(); |
| | | } else { |
| | | //百度内容联盟 |
| | | next(); |
| | | } |
| | | } |
| | | |
| | | private void next() { |
| | | //百度内容联盟 |
| | | // MobadsPermissionSettings.setPermissionReadDeviceID(true); |
| | | getUid(); |
| | | vg_ad.postDelayed(new Runnable() { |
| | | getUid(); |
| | | vg_ad.postDelayed(new Runnable() { |
| | | |
| | | @Override |
| | | public void run() { |
| | | if (!BeibeiConstant.AD_SETTING_KAIPIN) |
| | | toMainActivity(); |
| | | BeibeiVideoAPI.getConfig(getApplicationContext(), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void run() { |
| | | if (!BeibeiConstant.AD_SETTING_KAIPIN) |
| | | toMainActivity(); |
| | | BeibeiVideoAPI.getConfig(getApplicationContext(), new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject != null) { |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | JSONObject data = jsonObject.getJSONObject("Data"); |
| | | JSONObject ad = data.optJSONObject("adNew"); |
| | | String vipLink = data.optString("vipLink"); |
| | | int pptvNoAdRewardHour = data.optInt("pptvNoAdRewardHour", 3); |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject != null) { |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | JSONObject data = jsonObject.getJSONObject("Data"); |
| | | JSONObject ad = data.optJSONObject("adNew"); |
| | | String vipLink = data.optString("vipLink"); |
| | | int pptvNoAdRewardHour = data.optInt("pptvNoAdRewardHour", 3); |
| | | |
| | | //网页加速域名 |
| | | String webSpeedUpHost = data.optString("webSpeedUpHost"); |
| | | ConfigUtil.saveWebSpeedUpHost(getApplicationContext(), webSpeedUpHost); |
| | | //设置我的页面banner |
| | | ConfigUtil.saveMinePageBanner(getApplicationContext(), data.optString("minePageBanner")); |
| | | //网页加速域名 |
| | | String webSpeedUpHost = data.optString("webSpeedUpHost"); |
| | | ConfigUtil.saveWebSpeedUpHost(getApplicationContext(), webSpeedUpHost); |
| | | //设置我的页面banner |
| | | ConfigUtil.saveMinePageBanner(getApplicationContext(), data.optString("minePageBanner")); |
| | | |
| | | ConfigUtil.savePlayerJumpOutProtocolPrefix(getApplicationContext(), data.optString("jumpAppProtocolPrefix")); |
| | | ConfigUtil.savePlayerJumpOutProtocolPrefix(getApplicationContext(), data.optString("jumpAppProtocolPrefix")); |
| | | |
| | | //保存购买记录 |
| | | ConfigUtil.saveBuyRecordUrl(getApplicationContext(), data.optString("buyRecordUrl")); |
| | | //保存购买记录 |
| | | ConfigUtil.saveBuyRecordUrl(getApplicationContext(), data.optString("buyRecordUrl")); |
| | | |
| | | //保存免广告权益持续时间 |
| | | AdUtil.setPPTVNoAdRewardHour(getApplicationContext(), pptvNoAdRewardHour); |
| | | //保存免广告权益持续时间 |
| | | AdUtil.setPPTVNoAdRewardHour(getApplicationContext(), pptvNoAdRewardHour); |
| | | |
| | | AdUtil.saveAdConfig(getApplicationContext(), ad); |
| | | AdUtil.AD_TYPE splash = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.splash); |
| | | String pid = AdUtil.getAdPid(getApplicationContext(), AdPositionEnum.splash); |
| | | if (StringUtils.isBlank(pid)) { |
| | | if (splash != null) { |
| | | if (splash == AdUtil.AD_TYPE.csj) { |
| | | pid = CSJConstant.SPLASH_AD; |
| | | } else if (splash == AdUtil.AD_TYPE.gdt) { |
| | | pid = BeibeiConstant.GDT_SPLASH_POSITION_ID; |
| | | } |
| | | AdUtil.saveAdConfig(getApplicationContext(), ad); |
| | | AdUtil.AD_TYPE splash = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.splash); |
| | | String pid = AdUtil.getAdPid(getApplicationContext(), AdPositionEnum.splash); |
| | | if (StringUtils.isBlank(pid)) { |
| | | if (splash != null) { |
| | | if (splash == AdUtil.AD_TYPE.csj) { |
| | | pid = CSJConstant.SPLASH_AD; |
| | | } else if (splash == AdUtil.AD_TYPE.gdt) { |
| | | pid = BeibeiConstant.GDT_SPLASH_POSITION_ID; |
| | | } |
| | | } |
| | | ConfigUtil.saveVipLink(getApplicationContext(), vipLink); |
| | | loadSplashAd(splash, pid); |
| | | } |
| | | } else { |
| | | loadSplashAd(AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD); |
| | | ConfigUtil.saveVipLink(getApplicationContext(), vipLink); |
| | | loadSplashAd(splash, pid); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccess(int statusCode, Header[] headers, String responseString) { |
| | | super.onSuccess(statusCode, headers, responseString); |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { |
| | | super.onFailure(statusCode, headers, responseString, throwable); |
| | | } else { |
| | | loadSplashAd(AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccess(int statusCode, Header[] headers, String responseString) { |
| | | super.onSuccess(statusCode, headers, responseString); |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { |
| | | super.onFailure(statusCode, headers, responseString, throwable); |
| | | loadSplashAd(AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | }, 1000); |
| | | } |
| | | } |
| | | }, 1000); |
| | | |
| | | } |
| | | |
| | | Dialog mDialog; |
| | |
| | | if (grantResults[i] == PERMISSION_GRANTED) {//选择了“始终允许” |
| | | myRequetPermission(); |
| | | } else { |
| | | if (!ActivityCompat.shouldShowRequestPermissionRationale(this, permissions[i])) {//用户选择了禁止不再询问 |
| | | AlertDialog.Builder builder = new AlertDialog.Builder(SplashActivity.this); |
| | | builder.setTitle("权限请求") |
| | | .setMessage("当前应用缺少必要的权限\n请点击设置-权限 打开电话和存储权限,以正常使用APP的功能") |
| | | .setPositiveButton("去设置", new DialogInterface.OnClickListener() { |
| | | public void onClick(DialogInterface dialog, int id) { |
| | | if (mDialog != null && mDialog.isShowing()) { |
| | | mDialog.dismiss(); |
| | | } |
| | | Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); |
| | | Uri uri = Uri.fromParts("package", getPackageName(), null);//注意就是"package",不用改成自己的包名 |
| | | intent.setData(uri); |
| | | startActivityForResult(intent, REQUEST_CODE); |
| | | } |
| | | }); |
| | | mDialog = builder.create(); |
| | | mDialog.setCanceledOnTouchOutside(false); |
| | | mDialog.show(); |
| | | } else {//选择禁止 |
| | | AlertDialog.Builder builder = new AlertDialog.Builder(this); |
| | | builder.setTitle("权限请求") |
| | | .setMessage("点击允许才可以使用哦") |
| | | .setPositiveButton("去允许", new DialogInterface.OnClickListener() { |
| | | public void onClick(DialogInterface dialog, int id) { |
| | | if (alertDialog != null && alertDialog.isShowing()) { |
| | | alertDialog.dismiss(); |
| | | } |
| | | ActivityCompat.requestPermissions(SplashActivity.this, |
| | | new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | } |
| | | }); |
| | | alertDialog = builder.create(); |
| | | alertDialog.setCanceledOnTouchOutside(false); |
| | | alertDialog.show(); |
| | | //拒绝了授权 |
| | | if (grantResults[i] == PERMISSION_DENIED) { |
| | | SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putBoolean("show", false); |
| | | editor.commit(); |
| | | } |
| | | |
| | | next(); |
| | | // if (!ActivityCompat.shouldShowRequestPermissionRationale(this, permissions[i])) {//用户选择了禁止不再询问 |
| | | // AlertDialog.Builder builder = new AlertDialog.Builder(SplashActivity.this); |
| | | // builder.setTitle("权限请求") |
| | | // .setMessage("当前应用缺少必要的权限\n请点击设置-权限 打开电话和存储权限,以正常使用APP的功能") |
| | | // .setPositiveButton("去设置", new DialogInterface.OnClickListener() { |
| | | // public void onClick(DialogInterface dialog, int id) { |
| | | // if (mDialog != null && mDialog.isShowing()) { |
| | | // mDialog.dismiss(); |
| | | // } |
| | | // Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); |
| | | // Uri uri = Uri.fromParts("package", getPackageName(), null);//注意就是"package",不用改成自己的包名 |
| | | // intent.setData(uri); |
| | | // startActivityForResult(intent, REQUEST_CODE); |
| | | // } |
| | | // }); |
| | | // mDialog = builder.create(); |
| | | // mDialog.setCanceledOnTouchOutside(false); |
| | | // mDialog.show(); |
| | | // } else {//选择禁止 |
| | | // AlertDialog.Builder builder = new AlertDialog.Builder(this); |
| | | // builder.setTitle("权限请求") |
| | | // .setMessage("点击允许才可以使用哦") |
| | | // .setPositiveButton("去允许", new DialogInterface.OnClickListener() { |
| | | // public void onClick(DialogInterface dialog, int id) { |
| | | // if (alertDialog != null && alertDialog.isShowing()) { |
| | | // alertDialog.dismiss(); |
| | | // } |
| | | // ActivityCompat.requestPermissions(SplashActivity.this, |
| | | // new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | // } |
| | | // }); |
| | | // alertDialog = builder.create(); |
| | | // alertDialog.setCanceledOnTouchOutside(false); |
| | | // alertDialog.show(); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | |
| | | |
| | | public class SplashAdActivity extends BaseActivity { |
| | |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(SplashAdLoadInfo adLoadInfo) { |
| | | finish(); |
| | | } |
| | |
| | | dialog.setCanceledOnTouchOutside(true); |
| | | final View layout = inflater.inflate(R.layout.dialog_user_protocol, null); |
| | | dialog.addContentView(layout, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | TextView tv_title = layout.findViewById(R.id.tv_title); |
| | | TextView tv_content = layout.findViewById(R.id.tv_content); |
| | | tv_content.setText(TextViewUtil.getClickableHtml(webviewData, context, Color.rgb(23,106,230))); |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class GoodsReviewPopupWindow extends PopupWindow { |
| | | private LayoutInflater mInflater; |
| | |
| | | package com.weikou.beibeivideo.ui.login; |
| | | |
| | | 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.os.Build; |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | |
| | | import android.widget.CheckBox; |
| | | import android.widget.EditText; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.LinearLayout.LayoutParams; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | 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.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.XGPush; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | |
| | | SingleToast.showToast(LoginActivity.this, |
| | | "登录成功"); |
| | | XGPush.registerPush(LoginActivity.this); |
| | | onResult(RESULT_OK); |
| | | } |
| | | |
| | |
| | | |
| | | SingleToast.showToast(LoginActivity.this, |
| | | "登录成功"); |
| | | XGPush.registerPush(LoginActivity.this); |
| | | onResult(RESULT_OK); |
| | | } |
| | | |
| | |
| | | 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.dialog.DialogUtil; |
| | | 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 com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | 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 { |
| | | |
| | |
| | | |
| | | case R.id.tv_confirm: |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(RegisterActivity.this, "请同意《用户使用协议》"); |
| | | SingleToast.showToast(RegisterActivity.this, "请同意《用户使用协议》与《隐私政策》"); |
| | | break; |
| | | } |
| | | |
| | |
| | | import com.weikou.beibeivideo.util.cache.DiskLruCacheManager; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * Created by weikou2015 on 2017/9/14. |
| | |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoType type) { |
| | | getCategories(); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(HomeTabChangeInfo changeInfo) { |
| | | if (changeInfo == null) |
| | | return; |
| | |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.mozillaonline.providers.downloads.DownloadService; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.tencent.android.tpush.XGPushTextMessage; |
| | | import com.umeng.socialize.UMShareAPI; |
| | | import com.umeng.socialize.UMShareListener; |
| | | import com.umeng.socialize.bean.SHARE_MEDIA; |
| | |
| | | import com.weikou.beibeivideo.util.ad.manager.SearchResultAdManager; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.yeshi.appupdate.AppUpdate; |
| | | import com.yeshi.push.PushUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONArray; |
| | |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | //import com.umeng.message.PushAgent; |
| | | |
| | |
| | | }); |
| | | 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, SearchActivity.class); |
| | | intent.putExtra("video_info", videoInfo); |
| | | startActivity(intent); |
| | | } |
| | | }, 2000); |
| | | } |
| | | |
| | | //拉取详情问题 |
| | | UserUtil.updateUserInfo(getApplicationContext(), null); |
| | | |
| | | //推送 |
| | | PushUtil.inintPush(getApplication(), new PushUtil.ITokenListener() { |
| | | |
| | | @Override |
| | | public void onToken(String romType, String regId) { |
| | | runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | BeibeiVideoAPI.pushBindToken(getApplication(), romType, regId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | |
| | | } |
| | | }, true); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private boolean isLogin = false; |
| | | |
| | | /** |
| | | * 初始化用户登录信息 |
| | | */ |
| | | |
| | | public void onEventMainThread(XGPushTextMessage text) { |
| | | SharedPreferences preferences1 = getSharedPreferences("user", |
| | | Context.MODE_PRIVATE); |
| | | isLogin = StringUtils.isEmpty(preferences1.getString("LoginUid", "")) ? false |
| | | : true; |
| | | if (text != null && isLogin) { |
| | | if (preferences1.getBoolean("PushType", false)) { |
| | | iv_msg_dot.setVisibility(View.VISIBLE); |
| | | } else { |
| | | iv_msg_dot.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | |
| | | if (!StringUtils.isEmpty(preferences.getString("shopurl", "")) && !preferences.getBoolean("isDown", false)) { |
| | | addDownloadBuxin(preferences.getString("shopurl", "")); |
| | | } |
| | | EventBus.getDefault().register(this); |
| | | |
| | | PushOpenClickActivity.resumeJumpActivity(this); |
| | | } |
| | |
| | | public void onPause() { |
| | | super.onPause(); |
| | | AppUpdate.destoryAppUpdate(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | |
| | |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.widget.BadgeView; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 原主页--我的-----3.2.4版本后已经放弃此页面 |
| | |
| | | import android.graphics.drawable.Drawable; |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.AdapterView; |
| | | import android.widget.AdapterView.OnItemClickListener; |
| | | import android.widget.BaseAdapter; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.ListView; |
| | | import android.widget.PopupWindow; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | /** |
| | | * 节目选集列表,可设置电视剧6列;电影,综艺1列 |
| | |
| | | EventBus.getDefault().register(this); |
| | | } |
| | | |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(Playlocation playlocation) { |
| | | mPlayingPosition = playlocation.getPosition(); |
| | | // loadEpisode(); |
| | | refresh(); |
| | | } |
| | | |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(FunshionPlayInfo info) { |
| | | Log.i(TAG, "风行选集:" + info.getPosition()); |
| | | mPlayingPosition = info.getPosition(); |
| | |
| | | List<VideoResource> urlList; |
| | | VideoResource selectedUrl = null; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoInfo videoInfo) { |
| | | mVideoInfo = videoInfo; |
| | | if (VideoUtil.videoEpisodeList != null && VideoUtil.videoEpisodeList.size() > 1) { |
| | |
| | | import com.weikou.beibeivideo.util.x5.X5WebView; |
| | | import com.weikou.beibeivideo.R; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | |
| | | /** |
| | | * 网页加载页面 |
| | |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(ChangeVideoEvent changeVideoEvent) { |
| | | if ("VideoPlayerFragment".equals(changeVideoEvent.getTag())) { |
| | | changeVideoEvent.setTag("VideoDetailActivity"); |
| | |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | private int mPosition = 0; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(Playlocation location) { |
| | | Log.i(TAG, "onEventMainThread:Playlocation"); |
| | | fl_ad.setVisibility(View.VISIBLE); |
| | |
| | | |
| | | private PlayUrl info; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(PlayUrl info) { |
| | | this.info = info; |
| | | Toast.makeText(this, "播放", Toast.LENGTH_SHORT).show(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(AccumulateRule info) {// 播放界面返回替代使用 |
| | | clickBack(); |
| | | } |
| | |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(ChangeVideoEvent changeVideoEvent) { |
| | | VideoInfo videoInfo = changeVideoEvent.getVideoInfo(); |
| | | resourceId = ""; |
| | |
| | | getVideoDetail(this, videoInfo.getId(), videoInfo.getThirdType(), false); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(Play info) { |
| | | Log.i("mResult", "VideoDetailActivity-----onEventMainThread----开始播放"); |
| | | playUrl = info.getPlayUrl(); |
| | |
| | | |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoInfo info) { |
| | | videoInfo = info; |
| | | } |
| | |
| | | |
| | | private VideoResource resource; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoResource resource) { |
| | | this.resource = resource; |
| | | } |
| | |
| | | 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.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd; |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.UmengEventUtil; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | import com.weikou.beibeivideo.util.ad.CSJConstant; |
| | | import com.weikou.beibeivideo.util.ad.FullVideoAdManager; |
| | | import com.weikou.beibeivideo.util.goldcorn.GoldCornUtil; |
| | | import com.weikou.beibeivideo.util.ui.IPageEventListener; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | |
| | | /** |
| | |
| | | return; |
| | | //加载广告 |
| | | if (BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | | FullVideoAdManager.getInstance().showAd(this); |
| | | |
| | | //判断加载广告的类型 |
| | | |
| | | int fullvideo = adInfo.getFullVideoWeight(); |
| | | int interstitial = adInfo.getInterstitialWeight(); |
| | | int random = (int) ((fullvideo + interstitial) * Math.random()); |
| | | if (random <= fullvideo) { |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onSuccess(TTFullScreenVideoAd ad) { |
| | | FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); |
| | | } |
| | | }); |
| | | showInterstitialAd(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 穿山甲插屏广告 |
| | | */ |
| | | private TTFullScreenVideoAd mTTFullScreenVideoAd; |
| | | |
| | | private void showInterstitialAd() { |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(VideoDetailActivity2.this); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId("946608275") |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 500) |
| | | .setSupportDeepLink(true) |
| | | .setOrientation(TTAdConstant.VERTICAL)//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL |
| | | .build(); |
| | | mTTAdNative.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() { |
| | | |
| | | |
| | | @Override |
| | | public void onError(int i, String s) { |
| | | |
| | | Log.i(TAG, s); |
| | | } |
| | | |
| | | @Override |
| | | public void onFullScreenVideoAdLoad(TTFullScreenVideoAd ttFullScreenVideoAd) { |
| | | mTTFullScreenVideoAd = ttFullScreenVideoAd; |
| | | } |
| | | |
| | | @Override |
| | | public void onFullScreenVideoCached() { |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onFullScreenVideoCached(TTFullScreenVideoAd ttFullScreenVideoAd) { |
| | | if (ttFullScreenVideoAd != null) { |
| | | ttFullScreenVideoAd.setFullScreenVideoAdInteractionListener(new TTFullScreenVideoAd.FullScreenVideoAdInteractionListener() { |
| | | @Override |
| | | public void onAdShow() { |
| | | Log.i(TAG, "广告展示----"); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdVideoBarClick() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdClose() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoComplete() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSkippedVideo() { |
| | | |
| | | } |
| | | }); |
| | | //展示广告,并传入广告展示的场景 |
| | | ttFullScreenVideoAd.showFullScreenVideoAd(VideoDetailActivity2.this, TTAdConstant.RitScenes.GAME_GIFT_BONUS, null); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | private static FrameLayout fl_video_play_background; |
| | | |
| | |
| | | |
| | | private PlayUrl info; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(Playlocation location) { |
| | | fl_ad.setVisibility(View.VISIBLE); |
| | | mPosition = location.getPosition(); |
| | |
| | | } |
| | | |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(PlayUrl info) { |
| | | this.info = info; |
| | | Toast.makeText(this, "播放", Toast.LENGTH_SHORT).show(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(AccumulateRule info) {// 播放界面返回替代使用 |
| | | clickBack(); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(PlayerLock info) {//播放器锁屏 |
| | | playerLock = info.isLock(); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(PlayerControllerShow show) {//播放控制器显示 |
| | | if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { |
| | | tv_back.setVisibility(View.GONE); |
| | |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(ChangeVideoEvent changeVideoEvent) { |
| | | VideoInfo videoInfo = changeVideoEvent.getVideoInfo(); |
| | | resourceId = ""; |
| | |
| | | getVideoDetail(this, videoInfo.getId(), videoInfo.getThirdType(), false, changeVideoEvent.getFrom()); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(Play info) { |
| | | Log.i("mResult", "VideoDetailActivity-----onEventMainThread----开始播放"); |
| | | playUrl = info.getPlayUrl(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoInfo info) { |
| | | Log.i(TAG, "onEventMainThread-videoInfo"); |
| | | videoInfo = info; |
| | |
| | | |
| | | private VideoResource resource; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoResource resource) { |
| | | this.resource = resource; |
| | | } |
| | |
| | | GoldCornUtil.removeCallbacks(fl_video_play_background, makeGoldCornRunnable); |
| | | //屏幕常亮 |
| | | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); |
| | | if (mTTFullScreenVideoAd != null) |
| | | mTTFullScreenVideoAd = null; |
| | | super.onDestroy(); |
| | | } |
| | | } |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | |
| | | /** |
| | | * 视频详情 |
| | |
| | | } |
| | | |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoInfo videoInfo) { |
| | | |
| | | mVideoInfo = videoInfo; |
| | |
| | | |
| | | VideoDetailInfo mVideoDetailInfo; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoDetailInfo videoDetailInfo) { |
| | | mVideoDetailInfo = videoDetailInfo; |
| | | int playingPosition = 0; |
| | |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 播放详情--选集页面 |
| | |
| | | Log.i(TAG, "onPause"); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoInfo info) { |
| | | int playingPosition = 0; |
| | | if (mPlayingPosition != playingPosition) { |
| | |
| | | vp_episode.setAdapter(mEpisodePagerAdapter); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(PushEpisode info) { |
| | | if (mVideoInfo == null) |
| | | return; |
| | |
| | | package com.weikou.beibeivideo.ui.media; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONObject; |
| | | |
| | | import android.app.Dialog; |
| | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 全屏播放-选集页面 |
| | |
| | | super.onDismiss(dialog); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoDetailInfo videoDetailInfo) { |
| | | int playingPosition = 0; |
| | | for (int i = 0; i < VideoUtil.videoEpisodeList.size(); i++) { |
| | |
| | | import com.weikou.beibeivideo.util.SDCardUtil; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 播放页小屏底部下载详情页面,也是多集下载详情页面点击下载更多 弹出页面 |
| | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 全屏播放-下载页面 |
| | |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * 小屏播放-评论 |
| | |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(VideoDetailInfo videoDetailInfo) { |
| | | for (int i = 0; i < VideoUtil.videoEpisodeList.size(); i++) { |
| | | if (videoDetailInfo.getId().equals( |
| | |
| | | } |
| | | |
| | | // EventBus事件响应 |
| | | @Subscribe |
| | | public void onEventMainThread(Boolean e) { |
| | | if (e) { |
| | | getReviewList(); |
| | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class VideoReviewPopupWindow extends PopupWindow { |
| | | private LayoutInflater mInflater; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class CommentMessageAdapter extends BaseAdapter { |
| | | |
| | |
| | | |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(getContext()); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(CSJConstant.PPTV_INTERSTITIALAD) |
| | | .setCodeId(CSJConstant.VIDEO_DETAIL_INTERSTITIALAD) |
| | | //模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可 |
| | | .setExpressViewAcceptedSize(300, 500) |
| | | .setSupportDeepLink(true) |
| | |
| | | mttFullVideoAd = null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFullScreenVideoCached(TTFullScreenVideoAd ttFullScreenVideoAd) { |
| | | if (ttFullScreenVideoAd != null) { |
| | | //展示广告,并传入广告展示的场景 |
| | | if (getActivity() != null) |
| | | ttFullScreenVideoAd.showFullScreenVideoAd(getActivity(), TTAdConstant.RitScenes.GAME_GIFT_BONUS, null); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | |
| | | 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.util.ui.TopStatusSettings; |
| | | import com.weikou.beibeivideo.widget.BadgeView; |
| | | import com.yeshi.appupdate.AppUpdate; |
| | |
| | | UMShareAPI.get(SettingsActivity.this).deleteOauth(SettingsActivity.this, SHARE_MEDIA.QQ, authListener); |
| | | UserUtil.logout(getApplicationContext()); |
| | | MineFragment.isLogin = false;// 改为未登录状态 |
| | | XGPush.unRegisterPush(SettingsActivity.this); |
| | | finish(); |
| | | } |
| | | }); |
| | |
| | | } else { |
| | | mCurrentKey = et_search_key.getEditableText().toString(); |
| | | } |
| | | |
| | | SoftKeyboardUtils.hideSoftInput(SearchResultActivity.this); |
| | | mCurrentPage = 1; |
| | | rl_search_result.setRefreshing(true); |
| | |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | import com.weikou.beibeivideo.util.ui.IPageEventListener; |
| | | import com.yeshi.video.player.common.IVideoPlayerListener; |
| | | 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.greenrobot.eventbus.Subscribe; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.IOException; |
| | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class FunshionPlayerFragment extends RetainViewFragment implements OnClickListener, VideoPlayerController.IVideoPlayerListener { |
| | | public class FunshionPlayerFragment extends RetainViewFragment implements OnClickListener, IVideoPlayerListener { |
| | | private final static String TAG = FunshionPlayerFragment.class.getName(); |
| | | |
| | | //媒体视频播放器 |
| | |
| | | } |
| | | |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(FunshionPlayInfo info) { |
| | | if (VideoUtil.videoEpisodeList == null || VideoUtil.videoEpisodeList.size() == 0) { |
| | | //加载缓存内容 |
| | |
| | | |
| | | @Override |
| | | public boolean onConsoleMessage(ConsoleMessage consoleMessage) { |
| | | Log.i(TAG, consoleMessage.message()); |
| | | return super.onConsoleMessage(consoleMessage); |
| | | } |
| | | }); |
| | |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.content.DialogInterface; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.lcjian.library.util.SystemCommon; |
| | |
| | | View layout = inflater.inflate(R.layout.item_exit, null); |
| | | fl_advertisement = layout.findViewById(R.id.fl_advertisement); |
| | | dialog.addContentView(layout, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | // set the confirm button |
| | | layout.findViewById(R.id.tv_login) |
| | | .setOnClickListener(new View.OnClickListener() { |
| | |
| | | fl_advertisement.removeAllViews(); |
| | | } |
| | | }); |
| | | if (adList.get(0).getGdt2() != null) { |
| | | if (adList.get(0).getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) adList.get(0).getGdt2().getAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_advertisement.addView(adList.get(0).getGdt2().getAdView()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail(List<ExpressAdContainer> adList) { |
| | | |
| | | } |
| | | }, null); |
| | | |
| | |
| | | |
| | | public static String PPTV_INTERSTITIALAD="946078773"; |
| | | |
| | | |
| | | public static String VIDEO_DETAIL_INTERSTITIALAD="946608275"; |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | if (ad.getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getGdt2().getAdView().getParent()).removeAllViews(); |
| | | try { |
| | | if (ad.getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getGdt2().getAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_ad.addView(ad.getGdt2().getAdView()); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | fl_ad.addView(ad.getGdt2().getAdView()); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | |
| | | Log.i(TAG, "onRenderFail"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | }); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onFullScreenVideoCached() { |
| | | } |
| | | |
| | | @Override |
| | | public void onFullScreenVideoCached(TTFullScreenVideoAd ttFullScreenVideoAd) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | adLoadListener.onSuccess(mTTRewardVideoAd); |
| | | } |
| | | |
| | | @Override |
| | | public void onRewardVideoCached(TTRewardVideoAd ttRewardVideoAd) { |
| | | adLoadListener.onSuccess(mTTRewardVideoAd); |
| | | } |
| | | |
| | | //视频广告的素材加载完毕,比如视频url等,在此回调后,可以播放在线视频,网络不好可能出现加载缓冲,影响体验。 |
| | | @Override |
| | | public void onRewardVideoAdLoad(TTRewardVideoAd ad) { |
| | |
| | | import com.lcjian.library.util.security.MD5Utils; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.JumpActivityUtil; |
| | | |
| | |
| | | public String getUid() { |
| | | return mContext.getSharedPreferences("user", MODE_PRIVATE).getString("LoginUid", ""); |
| | | } |
| | | @JavascriptInterface |
| | | public String getAppName(){ |
| | | return mContext.getString(R.string.app_name); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getVersion() { |
| | |
| | | import android.net.Uri; |
| | | import android.os.AsyncTask; |
| | | import android.os.Build; |
| | | import androidx.core.content.FileProvider; |
| | | import android.util.Log; |
| | | |
| | | import com.weikou.beibeivideo.BuildConfig; |
| | | import com.weikou.beibeivideo.entity.AdType; |
| | | import com.weikou.beibeivideo.service.DownLoadFileService; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.io.File; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | import androidx.core.content.FileProvider; |
| | | |
| | | /** |
| | | * @author weikou2015 下载工具类 |
| | |
| | | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| | | buildscript { |
| | | repositories { |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | |
| | | jcenter() |
| | | mavenCentral() |
| | | google() |
| | | maven { |
| | | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | } |
| | | maven { url 'http://developer.huawei.com/repo/'} |
| | | maven { url 'http://developer.huawei.com/repo/' } |
| | | |
| | | maven { url 'https://artifact.bytedance.com/repository/pangle'} |
| | | } |
| | | |
| | | dependencies { |
| | |
| | | |
| | | allprojects { |
| | | repositories { |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | |
| | | jcenter() |
| | | google() |
| | | maven { |
| | | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | } |
| | | |
| | | maven { url 'https://jitpack.io' } |
| | | maven { url 'https://dl.bintray.com/umsdk/release' } |
| | | maven { url "https://dl.bintray.com/thelasterstar/maven/" } |
| | | maven { url 'http://developer.huawei.com/repo/'} |
| | | maven { url 'http://developer.huawei.com/repo/' } |
| | | maven { url 'https://artifact.bytedance.com/repository/pangle'} |
| | | } |
| | | } |
| | |
| | | dependencies { |
| | | api fileTree(include: '*.jar', dir: 'libs') |
| | | api 'androidx.legacy:legacy-support-v4:1.0.0' |
| | | implementation project(path: ':library-EventBus') |
| | | // implementation project(path: ':library-EventBus') |
| | | implementation project(path: ':library-common') |
| | | } |
| | | |
| | |
| | | import android.net.ConnectivityManager; |
| | | import android.net.NetworkInfo; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.core.content.ContextCompat; |
| | | |
| | | import android.telephony.TelephonyManager; |
| | | import android.text.Html; |
| | | import android.widget.Toast; |
| | |
| | | private void getUpdateInfo() { |
| | | TelephonyManager manager = (TelephonyManager) mActivity |
| | | .getSystemService(Activity.TELEPHONY_SERVICE); |
| | | String deviceId=""; |
| | | String deviceId = ""; |
| | | if (ContextCompat.checkSelfPermission(mActivity, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED |
| | | || ContextCompat.checkSelfPermission(mActivity, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { |
| | | deviceId = manager.getDeviceId();// 获取deviceId |
| | | try { |
| | | deviceId = manager.getDeviceId();// 获取deviceId |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | int versionCode = 1;// 版本号 |
| | | int versionCode = 1;// 版本号 |
| | | try { |
| | | versionCode = mActivity.getPackageManager().getPackageInfo( |
| | | mActivity.getPackageName(), |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (jsonObject == null) |
| | | return; |
| | | if (Integer.parseInt(jsonObject.optString("code")) == 0) { |
| | | Gson gson = new GsonBuilder().setPrettyPrinting() |
| | | .create(); |
| | |
| | | import com.yeshi.appupdate.api.AppUpdateAPI; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.json.JSONObject; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | |
| | | /** |
| | | * Created by weikou2015 on 2017/9/15. |
| | |
| | | import android.net.ConnectivityManager; |
| | | import android.net.NetworkInfo; |
| | | import android.net.Uri; |
| | | import android.os.Build; |
| | | import android.util.Log; |
| | | |
| | | /** |
| | |
| | | String action = intent.getAction(); |
| | | /*if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { |
| | | startService(context); |
| | | } else */if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { |
| | | } else */ |
| | | if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { |
| | | NetworkInfo info = (NetworkInfo) |
| | | intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); |
| | | if (info != null && info.isConnected()) { |
| | |
| | | |
| | | /** |
| | | * Hide a system notification for a download. |
| | | * @param uri URI to update the download |
| | | * |
| | | * @param uri URI to update the download |
| | | * @param cursor Cursor for reading the download's fields |
| | | */ |
| | | private void hideNotification(Context context, Uri uri, Cursor cursor) { |
| | |
| | | private void openDownload(Context context, Cursor cursor) { |
| | | String filename = cursor.getString(cursor.getColumnIndexOrThrow(Downloads._DATA)); |
| | | String mimetype = |
| | | cursor.getString(cursor.getColumnIndexOrThrow(Downloads.COLUMN_MIME_TYPE)); |
| | | cursor.getString(cursor.getColumnIndexOrThrow(Downloads.COLUMN_MIME_TYPE)); |
| | | Uri path = Uri.parse(filename); |
| | | // If there is no scheme, then it must be a file |
| | | if (path.getScheme() == null) { |
| | |
| | | |
| | | /** |
| | | * Notify the owner of a running download that its notification was clicked. |
| | | * |
| | | * @param intent the broadcast intent sent by the notification manager |
| | | * @param cursor Cursor for reading the download's fields |
| | | */ |
| | |
| | | } |
| | | |
| | | private void startService(Context context) { |
| | | context.startService(new Intent(context, DownloadService.class)); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| | | context.startForegroundService(new Intent(context, DownloadService.class)); |
| | | } else { |
| | | context.startService(new Intent(context, DownloadService.class)); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import android.app.Activity; |
| | | import android.util.Log; |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * Executes an {@link RunnableEx} using a thread pool. Thrown exceptions are propagated by posting failure events of any |
| | |
| | | |
| | | import android.content.res.Resources; |
| | | import android.util.Log; |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class ErrorDialogConfig { |
| | | final Resources resources; |
| | |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import androidx.fragment.app.DialogFragment; |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | public class ErrorDialogFragments { |
| | | /** TODO Use config: Icon res ID to use for all error dialogs. May be configured by each app (optional). */ |
| | |
| | | import androidx.fragment.app.FragmentActivity; |
| | | import androidx.fragment.app.FragmentManager; |
| | | import android.util.Log; |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | /** |
| | | * Central class for app that want to use event based error dialogs.<br/> |
| | |
| | | super.onPause(); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(ThrowableFailureEvent event) { |
| | | if (!isInExecutionScope(executionScope, event)) { |
| | | return; |
| | |
| | | super.onPause(); |
| | | } |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(ThrowableFailureEvent event) { |
| | | if (!isInExecutionScope(executionScope, event)) { |
| | | return; |
| | |
| | | import java.util.Set; |
| | | |
| | | import android.util.Log; |
| | | import de.greenrobot.event.EventBus; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | |
| | | /** |
| | |
| | | dependencies { |
| | | api fileTree(include: '*', dir: 'libs') |
| | | |
| | | api 'com.sina.weibo.sdk:core:4.4.3:openDefaultRelease@aar' |
| | | api 'com.umeng.umsdk:asms:1.2.3' //必选 |
| | | |
| | | api files('libs/umeng-asms-armeabi-v1.1.3.aar') |
| | | api files('libs/umeng-common-9.2.4.jar') |
| | | api files('libs/umeng-crash-armeabi-v0.0.4.aar') |
| | | api files('libs/umeng-common-9.4.2.jar') |
| | | |
| | | api files('libs/open_sdk_r8353806_lite.jar') |
| | | api files('libs/umeng-share-core-7.1.1.jar') |
| | | api files('libs/umeng-share-QQ-full-7.1.1.jar') |
| | | api files('libs/umeng-share-sina-full-7.1.1.jar') |
| | | api files('libs/umeng-share-wechat-full-7.1.1.jar') |
| | | api files('libs/umeng-sharetool-7.1.1.jar') |
| | | // api files('libs/core-4.1.0-openDefaultRelease.aar') |
| | | api files('libs/sina-weibo-openDefault-10.10.0.aar') |
| | | api files('libs/umeng-share-core-7.1.6.jar') |
| | | api files('libs/umeng-sharetool-7.1.6.jar') |
| | | api files('libs/umeng-shareboard-widget-7.1.6.jar') |
| | | |
| | | api files('libs/umeng-share-QQ-full-7.1.6.jar') |
| | | api files('libs/umeng-share-sina-full-7.1.6.jar') |
| | | api files('libs/umeng-share-wechat-full-7.1.6.jar') |
| | | |
| | | } |
| | | |
| | | android { |
| | |
| | | dependencies { |
| | | implementation fileTree(dir: "libs", include: ["*.jar"]) |
| | | implementation project(path: ':library-common') |
| | | implementation project(path: ':library-EventBus') |
| | | // implementation project(path: ':library-EventBus') |
| | | testImplementation 'junit:junit:4.12' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.1' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' |
| | |
| | | import android.media.MediaPlayer; |
| | | import android.net.ConnectivityManager; |
| | | import android.net.NetworkInfo; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | import android.util.AttributeSet; |
| | | import android.util.Log; |
| | | import android.view.GestureDetector; |
| | |
| | | import com.lcjian.library.util.common.TimeUtil; |
| | | import com.yeshi.video.player.R; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.util.List; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | |
| | | import static android.content.Context.AUDIO_SERVICE; |
| | | |
| | |
| | | @Override |
| | | public void onStartTrackingTouch(SeekBar seekBar) { |
| | | isTouch = true; |
| | | mediaPlayer.pause(); |
| | | if (mediaPlayer != null) |
| | | mediaPlayer.pause(); |
| | | canHiddenController = false; |
| | | } |
| | | |
| | | @Override |
| | | public void onStopTrackingTouch(SeekBar seekBar) { |
| | | isTouch = false; |
| | | mediaPlayer.start(); |
| | | if (mediaPlayer != null) |
| | | mediaPlayer.start(); |
| | | int currentPosition = getSeconds(mediaPlayer.getCurrentPosition()); |
| | | tv_progress.setText(TimeUtil.getTimeDesc(currentPosition)); |
| | | canHiddenController = true; |
| | |
| | | } |
| | | |
| | | |
| | | public interface IVideoPlayerListener { |
| | | //暂停 |
| | | public void onVideoPause(); |
| | | |
| | | //播放 |
| | | public void onVideoPlay(); |
| | | |
| | | //下一集 |
| | | public void onNext(); |
| | | |
| | | //返回 |
| | | public void onBack(); |
| | | |
| | | //选集 |
| | | public void selectEpisode(int p, VideoEpisode episode); |
| | | |
| | | //搜藏 |
| | | public void collect(boolean collect); |
| | | |
| | | //切换清晰度 |
| | | public void changeDefinition(int p, VideoDefinition definition); |
| | | } |
| | | |
| | | //手势处理 |
| | | private class MSimpleGestureDectListener extends GestureDetector.SimpleOnGestureListener { |
| | |
| | | // api files('libs/android-async-http-1.4.8.jar') |
| | | |
| | | api 'com.taobao.android:utdid4all:1.5.2' |
| | | api files('libs/eventbus-3.1.1.jar') |
| | | api files('libs/fastjson-1.2.7.jar') |
| | | } |
| | | |
| | | android { |
| | |
| | | |
| | | public class DialogUtil { |
| | | public static void show(Dialog dialog) { |
| | | if (dialog != null && !dialog.isShowing()) { |
| | | dialog.show(); |
| | | try { |
| | | if (dialog != null && !dialog.isShowing()) { |
| | | dialog.show(); |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | public static void dismiss(Dialog dialog) { |
| | | if (dialog != null && dialog.isShowing()) { |
| | | dialog.dismiss(); |
| | | try { |
| | | if (dialog != null && dialog.isShowing()) { |
| | | dialog.dismiss(); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | * @param context Activity |
| | | */ |
| | | public static void hideSoftInput(Context context) { |
| | | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); |
| | | imm.hideSoftInputFromWindow(((Activity) context).getCurrentFocus().getWindowToken(), 0); |
| | | try { |
| | | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); |
| | | imm.hideSoftInputFromWindow(((Activity) context).getCurrentFocus().getWindowToken(), 0); |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | sourceCompatibility JavaVersion.VERSION_1_8 |
| | | targetCompatibility JavaVersion.VERSION_1_8 |
| | | } |
| | | |
| | | repositories { |
| | | flatDir { |
| | | dirs 'libs' |
| | | } |
| | | } |
| | | } |
| | | |
| | | dependencies { |
| | |
| | | import android.content.Context; |
| | | import android.os.Build; |
| | | import android.os.Process; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | import com.heytap.msp.push.HeytapPushManager; |
| | | import com.heytap.msp.push.callback.ICallBackResultService; |
| | | import com.huawei.hms.aaid.HmsInstanceId; |
| | | import com.huawei.hms.common.ApiException; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.meizu.cloud.pushsdk.PushManager; |
| | |
| | | switch (Build.BRAND.toLowerCase()) { |
| | | case "huawei": |
| | | case "honor": |
| | | //华为是自动初始化 |
| | | //获取token |
| | | new Thread() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | // 从agconnect-service.json文件中读取appId |
| | | String appId = "10409568"; |
| | | // 输入token标识"HCM" |
| | | String tokenScope = "HCM"; |
| | | String token = HmsInstanceId.getInstance(context).getToken(appId, tokenScope); |
| | | Log.i(TAG, "get token: " + token); |
| | | |
| | | // 判断token是否为空 |
| | | if(!TextUtils.isEmpty(token)) { |
| | | tokenListener.onToken("hw",token); |
| | | } |
| | | } catch (ApiException e) { |
| | | Log.e(TAG, "hw: get token failed, " + e); |
| | | } |
| | | } |
| | | }.start(); |
| | | return; |
| | | case "oppo"://上面官方判断 |
| | | /***OPPO官方判断方法*/ |
| | |
| | | |
| | | public interface ITokenListener { |
| | | public void onToken(String romType, String regId); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | include ':library-BaiduCPU' |
| | | include ':library-VideoPlayer' |
| | | include ':library-GDTSDK' |
| | | include ':library-EventBus' |
| | | include ':library-SocialSdk' |
| | | include ':library-NineOldAndroids' |
| | | include ':library-ViewPagerIndicator' |