状态栏的设置,最后采取的是隐藏状态栏,透明状态栏需要在页面中调整布局;
旋转使用的是api进行的旋转,不使用css进行旋转
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
package chaoran.business.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanSettings;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
@ -13,14 +16,22 @@ import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import chaoran.business.R;
|
||||
|
||||
public class LocalAddressUtil {
|
||||
|
||||
private Context context;
|
||||
|
||||
private Activity activity;
|
||||
|
||||
private View view;
|
||||
|
||||
private int[] heights;
|
||||
|
||||
public LocalAddressUtil(Context context) {
|
||||
public LocalAddressUtil(Context context, Activity activity, View view) {
|
||||
this.context = context;
|
||||
this.activity = activity;
|
||||
this.view = view;
|
||||
this.heights = StatusBarUtil.getStatusBarHeight(context);
|
||||
}
|
||||
|
||||
@ -88,6 +99,8 @@ public class LocalAddressUtil {
|
||||
return info;
|
||||
}
|
||||
|
||||
@SuppressLint("JavascriptInterface")
|
||||
@JavascriptInterface
|
||||
public String getHeight(int type) {
|
||||
String info = "";
|
||||
switch (type) {
|
||||
@ -118,4 +131,13 @@ public class LocalAddressUtil {
|
||||
Log.e("test", "UNKNOWN=" + Build.UNKNOWN);
|
||||
Log.e("test", "USER=" + Build.USER);
|
||||
}
|
||||
|
||||
@SuppressLint("JavascriptInterface")
|
||||
@JavascriptInterface
|
||||
public void rotateScreen(int type) {
|
||||
view.setRotationX(type);
|
||||
view.setRotationY(type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user