| | |
| | | |
| | | 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); |
| | |
| | | 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(); |
| | | |