admin
2021-02-27 db66b085308b8bc7a1ff9440c85895d41c98b5ed
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;
@@ -50,7 +47,6 @@
import com.umeng.socialize.media.UMImage;
import com.weikou.beibeivideo.BasicTextHttpResponseHandler;
import com.weikou.beibeivideo.BeibeiVideoAPI;
import com.weikou.beibeivideo.BeibeiVideoApplication;
import com.weikou.beibeivideo.R;
import com.weikou.beibeivideo.db.MessageTable;
import com.weikou.beibeivideo.entity.NewComment;
@@ -58,14 +54,13 @@
import com.weikou.beibeivideo.ui.BaseActivity;
import com.weikou.beibeivideo.ui.baidu.BaiDuNewsFragment;
import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment;
import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil;
import com.weikou.beibeivideo.ui.login.LoginActivity;
import com.weikou.beibeivideo.ui.login.PersonInfoActivity;
import com.weikou.beibeivideo.ui.login.PhoneLoginActivity;
import com.weikou.beibeivideo.ui.media.VideoDetailActivity2;
import com.weikou.beibeivideo.ui.mine.BrowserActivity;
import com.weikou.beibeivideo.ui.mine.SystemMessageActivity;
import com.weikou.beibeivideo.ui.mine.WatchHistoryActivity;
import com.weikou.beibeivideo.ui.push.PushOpenClickActivity;
import com.weikou.beibeivideo.ui.recommend.SearchActivity;
import com.weikou.beibeivideo.util.BeibeiConstant;
import com.weikou.beibeivideo.util.ExitDialog;
@@ -127,40 +122,24 @@
        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);
        }
        initStatusBar();
        // 将imei 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();
        try {
            Editor editor = mPre.edit();
            if (StringUtils.isEmpty(getMacAddress())) {
                editor.putString("mac", info.getMacAddress());
            } else {
                editor.putString("mac", getMacAddress());
            }
            editor.commit();
        } catch (Exception e) {
        }
        tv_search = findViewById(R.id.tv_activity_main_search);
        iv_msg_dot = findViewById(R.id.iv_msg_dot);
@@ -183,26 +162,7 @@
        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);
        }
        initStatusBar();
        initialer.run();
@@ -383,6 +343,8 @@
            addDownloadBuxin(preferences.getString("shopurl", ""));
        }
        EventBus.getDefault().register(this);
        PushOpenClickActivity.resumeJumpActivity(this);
    }