admin
2021-04-07 cbb88109494ffc7916f6639c20ce05c0cec941a9
3.9.1bug修复
20个文件已修改
150 ■■■■ 已修改文件
BuWanVideo/AndroidManifest.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/build.gradle 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
library-common/src/com/lcjian/library/RetainViewFragment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo/AndroidManifest.xml
@@ -63,6 +63,7 @@
        <activity
            android:name="com.weikou.beibeivideo.ui.SplashActivity"
            android:exported="true"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
@@ -72,6 +73,7 @@
        </activity>
        <activity
            android:name="com.weikou.beibeivideo.ui.main.MainActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@style/AppTabTheme3"></activity>
@@ -301,20 +303,16 @@
        <provider
            android:name="com.weikou.beibeivideo.db.WatchHistoryProvider"
            android:authorities="com.yeshi.ddysvideo.provider.watchhistory"
            android:exported="false" />
            android:authorities="com.yeshi.ddysvideo.provider.watchhistory" />
        <provider
            android:name="com.weikou.beibeivideo.db.DownloadProvider"
            android:authorities="com.yeshi.ddysvideo.provider.download"
            android:exported="false" />
            android:authorities="com.yeshi.ddysvideo.provider.download" />
        <provider
            android:name="com.weikou.beibeivideo.db.MessageProvider"
            android:authorities="com.yeshi.ddysvideo.provider.message"
            android:exported="false" />
            android:authorities="com.yeshi.ddysvideo.provider.message" />
        <provider
            android:name="com.mozillaonline.providers.downloads.DownloadProvider"
            android:authorities="com.ddysvideo.downloads"
            android:exported="false" />
            android:authorities="com.ddysvideo.downloads" />
        <!--百度内容联盟 -->
        <provider
@@ -463,8 +461,7 @@
        <!-- 网盟广告 -->
        <provider
            android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
            android:authorities="com.doudou.ysvideo.TTMultiProvider"
            android:exported="false" />
            android:authorities="com.doudou.ysvideo.TTMultiProvider" />
        <!--新浪 -->
        <activity
@@ -544,9 +541,7 @@
            android:name="push_kit_auto_init_enabled"
            android:value="true" />
        <!-- 华为推送服务注册 -->
        <service
            android:name=".service.HWPushService"
            android:exported="false">
        <service android:name=".service.HWPushService">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>
@@ -584,9 +579,7 @@
        <!-- VIVO推送 -->
        <receiver
            android:name=".receiver.VIVOPushMessageReceiver"
            android:exported="false">
        <receiver android:name=".receiver.VIVOPushMessageReceiver">
            <intent-filter>
                <!--接收push消息-->
                <action android:name="com.vivo.pushclient.action.RECEIVE" />
BuWanVideo/build.gradle
@@ -94,8 +94,8 @@
    defaultConfig {
        applicationId "com.doudou.ysvideo"
        versionCode 109
        versionName "3.9.0"
        versionCode 110
        versionName "3.9.1"
        multiDexEnabled = true
        minSdkVersion 17
        targetSdkVersion 27
BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java
@@ -1173,12 +1173,13 @@
     * @param handler
     */
    public static void getVideoEpisodeList(Context context, String uid,
                                           String ResourceId, String videoId, int page,
                                           String ResourceId, String videoId, int page,int pageSize,
                                           ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getVideoEpisodeList");
        params.put("Uid", uid);
        params.put("Page", page + "");
        params.put("PageSize", pageSize + "");
        params.put("VideoId", videoId);
        params.put("ResourceId", ResourceId);
        commonPost(context, BASE_URL + "recommend", params, handler);
BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java
@@ -345,7 +345,13 @@
                        @Override
                        public void onAdLoad(SplashAdLoadInfo adLoadInfo) {
                            //展示广告
                            try {
                            startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
                            } catch (SecurityException e) {
                            } catch (Exception e) {
                            }
                        }
                        @Override
BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java
@@ -92,6 +92,19 @@
    @Expose
    private VideoAlbumMoreInfo albumMoreInfo;
    //页大小
    @Expose
    private int pageSize;
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public VideoAlbumMoreInfo getAlbumMoreInfo() {
        return albumMoreInfo;
    }
BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java
@@ -114,6 +114,7 @@
        //初始化一次Banner,否则后面Banner使用时会出现卡顿
//        new BannerView(SplashActivity.this, ADSize.BANNER, BeibeiConstant.GDT_ID, BeibeiConstant.GDT_PLAYER_DETAIL);
        //弹用户协议框
        showProtocol();
@@ -139,7 +140,7 @@
                "4、未经监护人同意,我们不会收集使用14周岁以下(含14周岁)未成年人个人信息,且不会利用其信息推送新闻、时政信息、广告等定向推送活动。";
        if (!UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application) && !BeibeiConstant.IS_TEST) {
            new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() {
            Dialog dialog = new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    SplashActivity.this.finish();
@@ -157,7 +158,12 @@
                        }
                    });
                }
            }).setData(data).create().show();
            }).setData(data).create();
            if (!isFinishing()) {
                dialog.show();
            }
        } else {
            //请求权限
            vg_ad.post(new Runnable() {
BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java
@@ -46,7 +46,7 @@
        this.mAdShowListener = mAdShowListener;
    }
    private SplashADFragment() {
    public SplashADFragment() {
    }
BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java
@@ -1,6 +1,7 @@
package com.weikou.beibeivideo.ui.ad;
import android.os.Bundle;
import android.view.KeyEvent;
import com.weikou.beibeivideo.R;
import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo;
@@ -33,9 +34,7 @@
                finish();
            }
        });
        getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss();
    }
@@ -45,6 +44,15 @@
        EventBus.getDefault().unregister(this);
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK)
            return false;
        else
            return super.onKeyDown(keyCode, event);
    }
    public void onEventMainThread(SplashAdLoadInfo adLoadInfo) {
        finish();
    }
BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
@@ -223,7 +223,7 @@
                    VideoInfo videoInfo = new VideoInfo();
                    videoInfo.setId("8065880");
                    videoInfo.setThirdType("0");
                    Intent intent = new Intent(MainActivity.this, VideoDetailActivity2.class);
                    Intent intent = new Intent(MainActivity.this, SearchActivity.class);
                    intent.putExtra("video_info", videoInfo);
                    startActivity(intent);
                }
BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java
@@ -111,6 +111,9 @@
    private int episodePage = 2;//当前页
    //默认页大小为100
    private int pageSize = 100;
    private String fromName = null;
    public static DisplayImageOptions option = new DisplayImageOptions.Builder()
@@ -127,13 +130,14 @@
            .build();
    public static EpisodeFragment newInstance(VideoInfo videoInfo,
                                              int playingPosition, int start, int end, String from) {
                                              int playingPosition, int pageSize, int start, int end, String from) {
        EpisodeFragment episodeFragment = new EpisodeFragment();
        Bundle args = new Bundle();
        args.putSerializable("video_info", videoInfo);
        args.putInt("playing_position", playingPosition);
        args.putInt("start", start);
        args.putInt("end", end);
        args.putInt("pageSize", pageSize);
        args.putString("from", from);
        episodeFragment.setArguments(args);
        return episodeFragment;
@@ -240,6 +244,7 @@
                .getString("from", "");
        mPlayingPosition = bundle.getInt("playing_position");
        pageSize = bundle.getInt("pageSize", 100);
        mStart = bundle.getInt("start");
        mEnd = bundle.getInt("end");
@@ -338,7 +343,7 @@
                            break;
                        }
                        if (checkedResource != null) {
                            loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage);
                            loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage, pageSize);
                        }
                    }
                }
@@ -790,7 +795,7 @@
            ImageView iv = view.findViewById(R.id.iv_resource);
            TextView tv = view.findViewById(R.id.tv_resource);
            try {
                Glide.with(getActivity().getApplicationContext())
                Glide.with(iv)
                        .load(reList.get(position).getPicture())
                        .apply(new RequestOptions().placeholder(R.drawable.from_other).error(R.drawable.from_other))
                        .into(iv);
@@ -1014,8 +1019,8 @@
     * @param videoId
     * @param resourceId
     */
    private synchronized void loadMoreEpisode(String videoId, String resourceId, int page) {
        BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, new
    private synchronized void loadMoreEpisode(String videoId, String resourceId, int page, int pageSize) {
        BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, pageSize, new
                BasicTextHttpResponseHandler() {
                    @Override
BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java
@@ -14,13 +14,15 @@
    private int mPlayingPosition;
    private String fromName;
    private int pageSize;
    public EpisodePagerAdapter(FragmentManager fm, VideoInfo videoInfo,
                               int playingPosition, String from) {
                               int playingPosition, int pageSize, String from) {
        super(fm);
        this.mVideoInfo = videoInfo;
        this.mPlayingPosition = playingPosition;
        this.fromName = from;
        this.pageSize = pageSize;
    }
    @Override
@@ -30,7 +32,7 @@
        if (end > VideoUtil.videoEpisodeList.size()) {
            end = VideoUtil.videoEpisodeList.size();
        }
        return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), start,
        return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), pageSize, start,
                end, fromName);
    }
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java
@@ -895,6 +895,8 @@
                                Log.i("mResult", "是否是从观看记录点击进来的:" + isFromWatchHistory);
                                if (isFromWatchHistory || position > 0) {
                                    mPosition = getIntent().getIntExtra("playing_position", 0);
                                    //防止数组越界
                                    mPosition = mPosition >= VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : mPosition;
                                    EventBus.getDefault().post(videoInfo);
                                    getUrl(VideoUtil.videoEpisodeList.get(mPosition), isSetup);
                                    EventBus.getDefault().post(VideoUtil.videoEpisodeList.get(mPosition));
@@ -937,11 +939,16 @@
                                            @Override
                                            public void run() {
                                                try {
                                                EventBus.getDefault().post(
                                                        videoInfo);
                                                EventBus.getDefault()
                                                        .post(VideoUtil.videoEpisodeList
                                                                .get(0));
                                                } catch (NullPointerException e) {
                                                    //出现过空指针的异常
                                                }
                                            }
                                        }, 200);
                            }
@@ -1067,10 +1074,11 @@
                @Override
                public void run() {
                    EventBus.getDefault().post(videoInfo);
                    int position = getIntent().getIntExtra("playing_position", 0) >=
                            VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : getIntent().getIntExtra("playing_position",
                            0);
                    EventBus.getDefault().post(
                            VideoUtil.videoEpisodeList.get(
                                    getIntent().getIntExtra("playing_position",
                                            0)));
                            VideoUtil.videoEpisodeList.get(position));
                }
            }, 200);
        }
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java
@@ -118,6 +118,7 @@
        Bundle bundle = new Bundle();
        bundle.putSerializable("video_info", mVideoInfo);
        bundle.putInt("playing_position", mPlayingPosition);
        bundle.putInt("pageSize", mVideoInfo.getPageSize());
        videoEpisodeFragment.setArguments(bundle);
        getChildFragmentManager().beginTransaction().add(R.id.fl_add_container, videoEpisodeFragment, "VideoEpisodeFragment").commitAllowingStateLoss();
BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java
@@ -81,11 +81,12 @@
    private String from;
    public static VideoEpisodeFragment newInstance(VideoInfo videoInfo,
                                                   int playingPostion, String from) {
                                                   int playingPostion, int pageSize, String from) {
        VideoEpisodeFragment videoEpisodeFragment = new VideoEpisodeFragment();
        Bundle args = new Bundle();
        args.putSerializable("video_info", videoInfo);
        args.putInt("playing_position", playingPostion);
        args.putInt("pageSize", pageSize);
        args.putString("from", from);
        videoEpisodeFragment.setArguments(args);
        return videoEpisodeFragment;
@@ -140,12 +141,16 @@
        return R.layout.video_episode_fragment;
    }
    private int pageSize = 100;
    @Override
    public void onCreateView(View contentView, Bundle savedInstanceState) {
        Log.d(TAG, "onCreateView");
        sv_detail = contentView.findViewById(R.id.sv_detail);
        mVideoInfo = (VideoInfo) getArguments().getSerializable("video_info");
        mPlayingPosition = getArguments().getInt("playing_position");
        pageSize = getArguments().getInt("pageSize", 100);
        if (getArguments() != null)
            getArguments().clear();
        // ******简介*******
@@ -191,7 +196,7 @@
            return;
        mEpisodePagerAdapter = new EpisodePagerAdapter(
                getChildFragmentManager(), mVideoInfo, mPlayingPosition, from);
                getChildFragmentManager(), mVideoInfo, mPlayingPosition, pageSize, from);
        //
        vp_episode.setAdapter(mEpisodePagerAdapter);
        // 指示当前播放页---hxh
@@ -381,8 +386,9 @@
        if (mPlayingPosition != playingPosition) {
            mPlayingPosition = playingPosition;
        }
        pageSize = info.getPageSize();
        mEpisodePagerAdapter = new EpisodePagerAdapter(
                getChildFragmentManager(), info, mPlayingPosition, from);
                getChildFragmentManager(), info, mPlayingPosition, pageSize, from);
        //
        vp_episode.setAdapter(mEpisodePagerAdapter);
    }
BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java
@@ -239,6 +239,9 @@
    public void onClick(final View v) {
        switch (v.getId()) {
            case R.id.tv_search_cancel:
                if (fl_suggest.getVisibility() == View.VISIBLE) {
                    hiddenSuggestFragment();
                } else
                finish();
                break;
            case R.id.tv_search_clear_his:
BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java
@@ -473,6 +473,12 @@
                new BasicTextHttpResponseHandler() {
                    @Override
                    public void onStart() {
                        super.onStart();
                        hiddenSuggestFragment();
                    }
                    @Override
                    public void onSuccessPerfect(int statusCode,
                                                 Header[] headers, JSONObject jsonObject)
                            throws Exception {
BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java
@@ -589,6 +589,8 @@
    //广告展示完成
    private void adShowFinish(FunshionPlayInfo info) {
        if (fl_ad == null)
            return;
        fl_ad.setVisibility(View.GONE);
        fl_ad.removeAllViews();
        //播放视频
@@ -1007,6 +1009,7 @@
                    vpc_funshion.post(new Runnable() {
                        @Override
                        public void run() {
                            if (tv_skip != null)
                            tv_skip.setVisibility(View.GONE);
                            adShowFinish(info);
                        }
BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
@@ -4,6 +4,7 @@
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
@@ -116,9 +117,15 @@
            public void onClick(View v) {
                hiddenMenu();
                String url = tv_url.getText().toString();
                try {
                Uri uri = Uri.parse(url);
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);
                } catch (ActivityNotFoundException e) {
                    Toast.makeText(VideoPlayerBrowserActivity.this, "无法找到浏览器", Toast.LENGTH_SHORT).show();
                } catch (Exception e) {
                }
            }
        });
BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java
@@ -29,8 +29,12 @@
    //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
    private static void doInit(Context context) {
        if (!sInit) {
            try {
            TTAdSdk.init(context, buildConfig(context));
            sInit = true;
            } catch (Exception e) {
            }
        }
    }
library-common/src/com/lcjian/library/RetainViewFragment.java
@@ -11,7 +11,6 @@
    private View mContentView;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
@@ -22,6 +21,7 @@
            try {
                ((ViewGroup) mContentView.getParent()).removeView(mContentView);
            } catch (Exception e) {
                if (container != null)
                container.removeView(mContentView);
            }
        }