| | |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.live_browser_activity); |
| | | getWindow().setFormat(PixelFormat.TRANSLUCENT); |
| | | /* |
| | | * 计算状态栏高度并设置 |
| | | */ |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
| | | 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(); |
| | | tv_top_bar_left = (TextView) findViewById(R.id.tv_top_bar_left); |
| | | tv_top_bar_middle = (TextView) findViewById(R.id.tv_top_bar_middle); |
| | | webview = (WebView) findViewById(R.id.webview); |