From cbb88109494ffc7916f6639c20ce05c0cec941a9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 07 四月 2021 15:07:45 +0800
Subject: [PATCH] 3.9.1bug修复

---
 BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java |  150 +++++++++++++++++--------------------------------
 1 files changed, 52 insertions(+), 98 deletions(-)

diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
index 60b37fc..9fa5a34 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
@@ -21,11 +21,8 @@
 import android.support.v4.content.Loader;
 import android.view.KeyEvent;
 import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
 import android.widget.TextView;
@@ -38,44 +35,51 @@
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.reflect.TypeToken;
+import com.huawei.secure.android.common.util.ScreenUtil;
 import com.lcjian.library.util.FragmentSwitchHelper;
 import com.lcjian.library.util.MarketUtils;
+import com.lcjian.library.util.common.ClipboardUtil;
 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.analytics.MobclickAgent;
-import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.UMShareAPI;
 import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 import com.umeng.socialize.media.UMImage;
-import com.umeng.socialize.media.UMWeb;
 import com.weikou.beibeivideo.BasicTextHttpResponseHandler;
 import com.weikou.beibeivideo.BeibeiVideoAPI;
+import com.weikou.beibeivideo.R;
 import com.weikou.beibeivideo.db.MessageTable;
+import com.weikou.beibeivideo.entity.JumpDetail;
 import com.weikou.beibeivideo.entity.NewComment;
+import com.weikou.beibeivideo.entity.VideoInfo;
+import com.weikou.beibeivideo.entity.ad.ExpressAdContainer;
+import com.weikou.beibeivideo.entity.ad.RewardVideoAdContainer;
 import com.weikou.beibeivideo.ui.BaseActivity;
-import com.weikou.beibeivideo.ui.common.FollowActivity;
-import com.weikou.beibeivideo.ui.discover.ReleasePromptActivity;
+import com.weikou.beibeivideo.ui.baidu.BaiDuNewsFragment;
+import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment;
 import com.weikou.beibeivideo.ui.login.LoginActivity;
 import com.weikou.beibeivideo.ui.login.PersonInfoActivity;
+import com.weikou.beibeivideo.ui.media.VideoDetailActivity2;
 import com.weikou.beibeivideo.ui.mine.BrowserActivity;
-import com.weikou.beibeivideo.ui.mine.DownloadActivity;
-import com.weikou.beibeivideo.ui.mine.HelpAndTicklingActivity;
-import com.weikou.beibeivideo.ui.mine.MyFavouriteActivity;
-import com.weikou.beibeivideo.ui.mine.SettingsActivity;
 import com.weikou.beibeivideo.ui.mine.SystemMessageActivity;
 import com.weikou.beibeivideo.ui.mine.WatchHistoryActivity;
+import com.weikou.beibeivideo.ui.push.PushOpenClickActivity;
 import com.weikou.beibeivideo.ui.recommend.SearchActivity;
+import com.weikou.beibeivideo.util.AlibcTradeUtil;
 import com.weikou.beibeivideo.util.BeibeiConstant;
+import com.weikou.beibeivideo.util.DimenUtils;
 import com.weikou.beibeivideo.util.ExitDialog;
+import com.weikou.beibeivideo.util.JumpActivityUtil;
 import com.weikou.beibeivideo.util.LoginFirstDialog;
-import com.weikou.beibeivideo.util.ad.FullVideoAdManager;
+import com.weikou.beibeivideo.util.UserUtil;
+import com.weikou.beibeivideo.util.ad.AdUtil;
+import com.weikou.beibeivideo.util.ad.RewardVideoAdManager;
 import com.weikou.beibeivideo.util.ad.manager.SearchResultAdManager;
-import com.weikou.beibeivideo.R;
-import com.yeshi.ec.library_baiducpu.fragment.BaiDuNewsFragment;
-import com.ysh.wpc.appupdate.AppUpdate;
+import com.weikou.beibeivideo.util.browser.BWJavaInterface;
+import com.weikou.beibeivideo.util.ui.TopStatusSettings;
+import com.yeshi.appupdate.AppUpdate;
 
 import org.apache.http.Header;
 import org.json.JSONObject;
@@ -130,39 +134,12 @@
 
         exitDialog = exitDialogBuilder.create();
         exitDialog.setCanceledOnTouchOutside(true);
-        /*
-         * 璁$畻鐘舵�佹爮楂樺害骞惰缃�
-         */
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            Window window = getWindow();
-            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-            int result = 0;
-            int resourceId = getResources().getIdentifier("status_bar_height",
-                    "dimen", "android");
-            if (resourceId > 0) {
-                result = getResources().getDimensionPixelSize(resourceId);
-            }
-            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
-                    result);
-            findViewById(R.id.v_status_bar).setLayoutParams(params);
-            findViewById(R.id.v_status_bar).setVisibility(View.VISIBLE);
-        } else {
-            findViewById(R.id.v_status_bar).setVisibility(View.GONE);
-        }
+        TopStatusSettings.setStatusViewAndDeepColor(this);
         // 灏唅mei mac lat lng瀛樺叆sharedpreference涓�
         SharedPreferences mPre = getSharedPreferences("user",
                 Context.MODE_PRIVATE);
         WifiManager wifi = (WifiManager) this.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
         WifiInfo info = wifi.getConnectionInfo();
-
-        Editor editor = mPre.edit();
-        if (StringUtils.isEmpty(getMacAddress())) {
-            editor.putString("mac", info.getMacAddress());
-        } else {
-            editor.putString("mac", getMacAddress());
-        }
-        editor.commit();
 
         tv_search = findViewById(R.id.tv_activity_main_search);
 
@@ -186,33 +163,14 @@
         iv_taobao.setOnClickListener(this);
         iv_red_dot = findViewById(R.id.iv_red_dot);
         fl_right_ad = findViewById(R.id.fl_right_ad);
-
-        /*
-         * 璁$畻鐘舵�佹爮楂樺害骞惰缃�
-         */
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            Window window = getWindow();
-            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-            int result = 0;
-            int resourceId = getResources().getIdentifier("status_bar_height",
-                    "dimen", "android");
-            if (resourceId > 0) {
-                result = getResources().getDimensionPixelSize(resourceId);
-            }
-            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
-                    result);
-            findViewById(R.id.v_status_bar).setLayoutParams(params);
-        } else {
-            findViewById(R.id.v_status_bar).setVisibility(View.GONE);
-        }
+        TopStatusSettings.setStatusViewAndDeepColor(this);
 
         initialer.run();
 
         mFragmentSwitchHelper = FragmentSwitchHelper.create(
                 R.id.fl_main_fragment_container, getSupportFragmentManager(),
                 new HomeFragment(), new CategoryFragment(),
-                new BaiDuNewsFragment(), new MineFragment(), new GuessLikeFragment());
+                BaiDuNewsFragment.newInstance(), new MineFragment(), BaiDuVideosFragment.newInstance());
         rg_nav = findViewById(R.id.rg_nav);
         rg_nav.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
 
@@ -231,7 +189,7 @@
                     break;
                     case R.id.rb_guess_like: {
                         mFragmentSwitchHelper
-                                .changeFragment(GuessLikeFragment.class);
+                                .changeFragment(BaiDuVideosFragment.class);
                     }
                     break;
                     case R.id.rb_nav_discover: {
@@ -256,6 +214,24 @@
         });
         setRightTopAD();
         preLoadCommonAD();
+
+
+        if (BeibeiConstant.IS_TEST) {
+            tv_search.postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    VideoInfo videoInfo = new VideoInfo();
+                    videoInfo.setId("8065880");
+                    videoInfo.setThirdType("0");
+                    Intent intent = new Intent(MainActivity.this, SearchActivity.class);
+                    intent.putExtra("video_info", videoInfo);
+                    startActivity(intent);
+                }
+            }, 2000);
+        }
+
+        //鎷夊彇璇︽儏闂
+        UserUtil.updateUserInfo(getApplicationContext(), null);
     }
 
 
@@ -276,7 +252,14 @@
         if (!StringUtils.isBlank(topIcon)) {
             fl_right_ad.setVisibility(View.VISIBLE);
             try {
-                Glide.with(getApplicationContext()).load(topIcon).into(target);
+                Glide.with(getApplicationContext()).load(topIcon).into(iv_taobao);
+                long time = preferences.getLong("latestAdtime", 0);
+                if (!getDay(time).equalsIgnoreCase(
+                        getDay(System.currentTimeMillis()))) {
+                    iv_red_dot.setVisibility(View.VISIBLE);
+                } else {
+                    iv_red_dot.setVisibility(View.GONE);
+                }
             } catch (IllegalArgumentException e) {
                 e.printStackTrace();
             }
@@ -361,6 +344,8 @@
             addDownloadBuxin(preferences.getString("shopurl", ""));
         }
         EventBus.getDefault().register(this);
+
+        PushOpenClickActivity.resumeJumpActivity(this);
     }
 
 
@@ -410,37 +395,6 @@
         EventBus.getDefault().unregister(this);
     }
 
-    /*
-     * ****************************************************************
-     * 瀛愬嚱鏁帮細鑾峰緱鏈湴MAC鍦板潃
-     * ****************************************************************
-     */
-    private String getMacAddress() {
-        String result = "";
-        String Mac = "";
-        result = callCmd("busybox ifconfig", "HWaddr");
-
-        // 濡傛灉杩斿洖鐨剅esult == null锛屽垯璇存槑缃戠粶涓嶅彲鍙�
-        if (result == null) {
-            return "缃戠粶鍑洪敊锛岃妫�鏌ョ綉缁�";
-        }
-
-        // 瀵硅琛屾暟鎹繘琛岃В鏋�
-        // 渚嬪锛歟th0 Link encap:Ethernet HWaddr 00:16:E8:3E:DF:67
-        if (result.length() > 0 && result.contains("HWaddr") == true) {
-            Mac = result.substring(result.indexOf("HWaddr") + 6,
-                    result.length() - 1);
-            if (Mac.length() > 1) {
-                Mac = Mac.replaceAll(" ", "");
-                result = "";
-                String[] tmp = Mac.split(":");
-                for (int i = 0; i < tmp.length; ++i) {
-                    result += tmp[i];
-                }
-            }
-        }
-        return result;
-    }
 
     private String callCmd(String cmd, String filter) {
         String result = "";

--
Gitblit v1.8.0