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