ui优化.
This commit is contained in:
parent
60aa2dec6e
commit
4d7060bcd2
|
|
@ -72,9 +72,9 @@
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.zjrx.common.reciver.UsbDeviceReciver"
|
android:name="com.zjrx.common.reciver.UsbDeviceReciver"
|
||||||
android:exported="true">
|
android:exported="false">
|
||||||
|
|
||||||
<intent-filter tools:node="removeAll">
|
<intent-filter>
|
||||||
|
|
||||||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
||||||
|
|
||||||
|
|
@ -84,9 +84,9 @@
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.zjrx.common.reciver.BluetoothReciver"
|
android:name="com.zjrx.common.reciver.BluetoothReciver"
|
||||||
android:exported="true">
|
android:exported="false">
|
||||||
|
|
||||||
<intent-filter tools:node="removeAll">
|
<intent-filter>
|
||||||
|
|
||||||
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
|
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import android.os.PersistableBundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
@ -44,22 +45,29 @@ public class MainActivity extends FlutterActivity {
|
||||||
private final int SDK_PAY_FLAG = 1;
|
private final int SDK_PAY_FLAG = 1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState, persistentState);
|
super.onCreate(savedInstanceState);
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
WhaleCloud.getInstance().isShowLog(true);
|
WhaleCloud.getInstance().isShowLog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
// public boolean dispatchGenericMotionEvent(MotionEvent ev) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
// return super.dispatchGenericMotionEvent(ev);
|
||||||
// 处理按键按下事件
|
//
|
||||||
int keyCode = event.getKeyCode();
|
// }
|
||||||
// 根据keyCode进行相应处理
|
|
||||||
Log.d(TAG, "dispatchKeyEvent: keyCode==" + keyCode);
|
// @Override
|
||||||
}
|
// public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
return super.dispatchKeyEvent(event);
|
// //Log.d(TAG, "dispatchKeyEvent1: event==" + event);
|
||||||
}
|
// if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
// // 处理按键按下事件
|
||||||
|
// int keyCode = event.getKeyCode();
|
||||||
|
// // 根据keyCode进行相应处理
|
||||||
|
// Log.d(TAG, "dispatchKeyEvent: keyCode==" + keyCode);
|
||||||
|
// }
|
||||||
|
// return super.dispatchKeyEvent(event);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,7 @@ public class PlayGameActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchGenericMotionEvent(MotionEvent event) {
|
public boolean dispatchGenericMotionEvent(MotionEvent event) {
|
||||||
boolean consumed;
|
boolean consumed;
|
||||||
|
Log.d(TAG, "dispatchGenericMotionEvent: event==" + event);
|
||||||
LogUtil.d("...dispatchGenericMotionEvent:" + event);
|
LogUtil.d("...dispatchGenericMotionEvent:" + event);
|
||||||
consumed = WhaleCloud.getInstance().dispatchGenericMotionEvent(event);
|
consumed = WhaleCloud.getInstance().dispatchGenericMotionEvent(event);
|
||||||
return consumed;
|
return consumed;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class NetworkConfig {
|
||||||
static bool isChecking = false; //是否是审核模式
|
static bool isChecking = false; //是否是审核模式
|
||||||
static String deviceID = ""; //设备号
|
static String deviceID = ""; //设备号
|
||||||
static String deviceName = ""; //设备名称
|
static String deviceName = ""; //设备名称
|
||||||
static String Channel = ""; //渠道号
|
static String Channel = "ps_001"; //渠道号
|
||||||
static String Platform = ""; //设备平台名称
|
static String Platform = ""; //设备平台名称
|
||||||
static String userId = "";
|
static String userId = "";
|
||||||
static String userName = "";
|
static String userName = "";
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ class RequestCenter {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RequestCenter._internal() {
|
RequestCenter._internal() {
|
||||||
setup();
|
setup();
|
||||||
setupDio();
|
setupDio();
|
||||||
|
|
@ -55,8 +54,7 @@ class RequestCenter {
|
||||||
static RequestCenter _getInstance() {
|
static RequestCenter _getInstance() {
|
||||||
_instance ??= RequestCenter._internal();
|
_instance ??= RequestCenter._internal();
|
||||||
//域名不一致,重新初始化
|
//域名不一致,重新初始化
|
||||||
if (_instance!._dio != null &&
|
if (_instance!._dio != null && NetworkConfig.ServerDomain_Online != _instance!._dio!.options.baseUrl) {
|
||||||
NetworkConfig.ServerDomain_Online != _instance!._dio!.options.baseUrl) {
|
|
||||||
_instance!._dio!.options.baseUrl = NetworkConfig.ServerDomain_Online;
|
_instance!._dio!.options.baseUrl = NetworkConfig.ServerDomain_Online;
|
||||||
}
|
}
|
||||||
return _instance!;
|
return _instance!;
|
||||||
|
|
@ -82,23 +80,18 @@ class RequestCenter {
|
||||||
responseType: ResponseType.json));
|
responseType: ResponseType.json));
|
||||||
//_dioLog!.interceptors.add(DioLogInterceptor());
|
//_dioLog!.interceptors.add(DioLogInterceptor());
|
||||||
|
|
||||||
// (_dio?.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
|
// (_dio?.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
|
||||||
// client.findProxy = (uri) {
|
// client.findProxy = (uri) {
|
||||||
// return "PROXY 192.168.1.11:8888";
|
// return "PROXY 192.168.1.11:8888";
|
||||||
// };
|
// };
|
||||||
// //抓Https包设置
|
// //抓Https包设置
|
||||||
// client.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
// client.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
||||||
// };
|
// };
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 网络请求默认为post
|
// 网络请求默认为post
|
||||||
Future<BaseEntity?> request(
|
Future<BaseEntity?> request(path, Map<String, dynamic> parameters, Function(BaseEntity dataEntity) success, Function(ErrorEntity errorEntity) error,
|
||||||
path,
|
|
||||||
Map<String, dynamic> parameters,
|
|
||||||
Function(BaseEntity dataEntity) success,
|
|
||||||
Function(ErrorEntity errorEntity) error,
|
|
||||||
{RequestMethod? method}) async {
|
{RequestMethod? method}) async {
|
||||||
try {
|
try {
|
||||||
// Map<String, dynamic> general = {
|
// Map<String, dynamic> general = {
|
||||||
|
|
@ -107,16 +100,17 @@ class RequestCenter {
|
||||||
// parameters.addAll(general);
|
// parameters.addAll(general);
|
||||||
//签名加密
|
//签名加密
|
||||||
Map<String, dynamic> parametersSign = sign(parameters);
|
Map<String, dynamic> parametersSign = sign(parameters);
|
||||||
Response response = await _dio!.post(path, data: parametersSign,
|
Response response = await _dio!.post(path,
|
||||||
options: Options(
|
data: parametersSign,
|
||||||
headers: {
|
options: Options(
|
||||||
'Authorization': "Bearer ${NetworkConfig.token}",
|
headers: {
|
||||||
"Channel":NetworkConfig.Channel,
|
'Authorization': "Bearer ${NetworkConfig.token}",
|
||||||
"Platform":NetworkConfig.Platform,
|
"Channel": NetworkConfig.Channel,
|
||||||
"Version":NetworkConfig.Version,
|
"Platform": NetworkConfig.Platform,
|
||||||
"Language":NetworkConfig.Language,
|
"Version": NetworkConfig.Version,
|
||||||
},
|
"Language": NetworkConfig.Language,
|
||||||
));
|
},
|
||||||
|
));
|
||||||
BaseEntity entity = BaseEntity.PlayfromJson(response.data);
|
BaseEntity entity = BaseEntity.PlayfromJson(response.data);
|
||||||
success(entity);
|
success(entity);
|
||||||
return entity;
|
return entity;
|
||||||
|
|
@ -127,19 +121,18 @@ class RequestCenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<BaseEntity?> requestGet(
|
Future<BaseEntity?> requestGet(
|
||||||
path,
|
path, Map<String, dynamic> parmeters, Function(BaseEntity dataEntity) success, Function(ErrorEntity errorEntity) error,
|
||||||
Map<String, dynamic> parmeters,
|
|
||||||
Function(BaseEntity dataEntity) success,
|
|
||||||
Function(ErrorEntity errorEntity) error,
|
|
||||||
{RequestMethod? method}) async {
|
{RequestMethod? method}) async {
|
||||||
try {
|
try {
|
||||||
//FormData formData = FormData.fromMap(parmeters);
|
//FormData formData = FormData.fromMap(parmeters);
|
||||||
Response response = await _dio!.get(path, queryParameters: parmeters,
|
Response response = await _dio!.get(path,
|
||||||
options: Options(
|
queryParameters: parmeters,
|
||||||
headers: {
|
options: Options(
|
||||||
'Authorization': "Bearer ${NetworkConfig.token}"
|
headers: {
|
||||||
},
|
'Authorization': "Bearer ${NetworkConfig.token}",
|
||||||
));
|
"Channel": NetworkConfig.Channel,
|
||||||
|
},
|
||||||
|
));
|
||||||
BaseEntity entity = BaseEntity.PlayfromJson(response.data);
|
BaseEntity entity = BaseEntity.PlayfromJson(response.data);
|
||||||
success(entity);
|
success(entity);
|
||||||
return entity;
|
return entity;
|
||||||
|
|
@ -149,7 +142,6 @@ class RequestCenter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Map<String, dynamic> sign(Map<String, dynamic> parmeters) {
|
Map<String, dynamic> sign(Map<String, dynamic> parmeters) {
|
||||||
List<String> keys = parmeters.keys.toList();
|
List<String> keys = parmeters.keys.toList();
|
||||||
// key排序
|
// key排序
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,9 @@ class _HomeRecommendState extends State<HomeRecommendPage> with AutomaticKeepAli
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: t9),
|
margin: EdgeInsets.only(top: t9),
|
||||||
|
width: w57,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
"${widget.homeInfoBean.epgList?[0].title}",
|
"${widget.homeInfoBean.epgList?[0].title}",
|
||||||
style: TextStyle(fontSize: s13, color: Colors.white),
|
style: TextStyle(fontSize: s13, color: Colors.white),
|
||||||
),
|
),
|
||||||
|
|
@ -197,8 +199,10 @@ class _HomeRecommendState extends State<HomeRecommendPage> with AutomaticKeepAli
|
||||||
errorWidget: (context, url, error) => const Icon(Icons.error),
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
width: w57,
|
||||||
margin: EdgeInsets.only(top: t9),
|
margin: EdgeInsets.only(top: t9),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
"${widget.homeInfoBean.epgList?[1].title}",
|
"${widget.homeInfoBean.epgList?[1].title}",
|
||||||
style: TextStyle(fontSize: s13, color: Colors.white),
|
style: TextStyle(fontSize: s13, color: Colors.white),
|
||||||
),
|
),
|
||||||
|
|
@ -264,8 +268,10 @@ class _HomeRecommendState extends State<HomeRecommendPage> with AutomaticKeepAli
|
||||||
errorWidget: (context, url, error) => const Icon(Icons.error),
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
width: w57,
|
||||||
margin: EdgeInsets.only(top: t9),
|
margin: EdgeInsets.only(top: t9),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
"${widget.homeInfoBean.epgList?[2].title}",
|
"${widget.homeInfoBean.epgList?[2].title}",
|
||||||
style: TextStyle(fontSize: s13, color: Colors.white),
|
style: TextStyle(fontSize: s13, color: Colors.white),
|
||||||
),
|
),
|
||||||
|
|
@ -467,9 +473,11 @@ class _HomeRecommendState extends State<HomeRecommendPage> with AutomaticKeepAli
|
||||||
errorWidget: (context, url, error) => const Icon(Icons.error),
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
width: w90,
|
||||||
margin: EdgeInsets.only(top: t11),
|
margin: EdgeInsets.only(top: t11),
|
||||||
child: Text(
|
child: Text(
|
||||||
"${data.title}",
|
"${data.title}",
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: s14, color: Color(0xFF909090)),
|
style: TextStyle(fontSize: s14, color: Color(0xFF909090)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user