状态栏的设置,最后采取的是隐藏状态栏,透明状态栏需要在页面中调整布局
This commit is contained in:
@ -2,6 +2,7 @@ package chaoran.business.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.le.ScanSettings;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@ -13,6 +14,16 @@ import java.net.SocketException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
public class LocalAddressUtil {
|
||||
|
||||
private Context context;
|
||||
|
||||
private int[] heights;
|
||||
|
||||
public LocalAddressUtil(Context context) {
|
||||
this.context = context;
|
||||
this.heights = StatusBarUtil.getStatusBarHeight(context);
|
||||
}
|
||||
|
||||
@SuppressLint("JavascriptInterface")
|
||||
@JavascriptInterface
|
||||
public String getIpAddress() {
|
||||
@ -77,6 +88,15 @@ public class LocalAddressUtil {
|
||||
return info;
|
||||
}
|
||||
|
||||
public String getHeight(int type) {
|
||||
String info = "";
|
||||
switch (type) {
|
||||
case 1 : info = String.valueOf(this.heights[0]); break;
|
||||
case 2 : info = String.valueOf(this.heights[1]); break;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public void test(){
|
||||
Log.e("test", "MANUFACTURER=" + Build.MANUFACTURER);
|
||||
Log.e("test", "BRAND=" + Build.BRAND);
|
||||
|
||||
Reference in New Issue
Block a user