问题修改
This commit is contained in:
parent
322aa13332
commit
6df7e26e28
|
|
@ -936,10 +936,10 @@ public class FaceFragment extends BaseFragment<ActivityFaceBinding> {
|
||||||
flEngine.unInit();
|
flEngine.unInit();
|
||||||
flEngine = null;
|
flEngine = null;
|
||||||
}
|
}
|
||||||
if (serialPort != null) {
|
// if (serialPort != null) {
|
||||||
serialPort.close();
|
// serialPort.close();
|
||||||
serialPort = null;
|
// serialPort = null;
|
||||||
}
|
// }
|
||||||
if (outputStream != null) {
|
if (outputStream != null) {
|
||||||
try {
|
try {
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,10 @@ public class LoginFragment extends BaseFragment<ActivityLoginBinding> {
|
||||||
if (jsonObject.getIntValue("code") == 500) {
|
if (jsonObject.getIntValue("code") == 500) {
|
||||||
Log.e(TAG, "登录失败: " + jsonObject.getString("msg"));
|
Log.e(TAG, "登录失败: " + jsonObject.getString("msg"));
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
if(dialog != null){
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
dialog = null;
|
dialog = null;
|
||||||
|
}
|
||||||
XToastUtils.error(jsonObject.getString("msg"));
|
XToastUtils.error(jsonObject.getString("msg"));
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -376,6 +376,7 @@ public class PalmFragment extends BaseFragment<ActivityPlamBinding> {
|
||||||
saveImage(bytes);
|
saveImage(bytes);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
XToastUtils.error("处理图像时出错 ");
|
||||||
Log.e(TAG, "处理图像错误: " + e.getMessage());
|
Log.e(TAG, "处理图像错误: " + e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import okhttp3.RequestBody;
|
||||||
@Page(name = "起始页", anim = CoreAnim.none)
|
@Page(name = "起始页", anim = CoreAnim.none)
|
||||||
public class StartFragment extends BaseFragment<ActivityStartBinding> {
|
public class StartFragment extends BaseFragment<ActivityStartBinding> {
|
||||||
private OkHttpService service = new OkHttpService();
|
private OkHttpService service = new OkHttpService();
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected ActivityStartBinding viewBindingInflate(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, boolean attachToRoot) {
|
protected ActivityStartBinding viewBindingInflate(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, boolean attachToRoot) {
|
||||||
|
|
@ -52,17 +53,21 @@ public class StartFragment extends BaseFragment<ActivityStartBinding> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
binding.btnStart.setOnClickListener(view->{
|
binding.btnStart.setOnClickListener(view -> {
|
||||||
Log.d("StartFragment", "checkToken: 开始验证Token");
|
Log.d("StartFragment", "checkToken: 开始验证Token");
|
||||||
//验证token是否失效
|
//验证token是否失效
|
||||||
checkToken(new ResponseCallBack(){
|
checkToken(new ResponseCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
requireActivity().runOnUiThread(() -> ((MainActivity) requireActivity()).updateView(2));
|
requireActivity().runOnUiThread(() -> ((MainActivity) requireActivity()).updateView(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFail(String msg) {
|
public void onFail(String msg) {
|
||||||
requireActivity().runOnUiThread(()-> XToastUtils.error("Token验证失败,请重新登录!"));
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
((MainActivity) requireActivity()).updateView(-1);
|
||||||
|
XToastUtils.error("Token验证失败,请重新登录!");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -73,9 +78,9 @@ public class StartFragment extends BaseFragment<ActivityStartBinding> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkToken(ResponseCallBack callBack){
|
public void checkToken(ResponseCallBack callBack) {
|
||||||
Log.d("StartFragment", "checkToken: 开始验证Token");
|
Log.d("StartFragment", "checkToken: 开始验证Token");
|
||||||
ThreadPoolManager.getExecutor().execute(()->{
|
ThreadPoolManager.getExecutor().execute(() -> {
|
||||||
String url = WorkConfig.getBaseUrl() + "/api/android/device/checkToken";
|
String url = WorkConfig.getBaseUrl() + "/api/android/device/checkToken";
|
||||||
com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
|
com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
|
||||||
String jsonString = json.toString();
|
String jsonString = json.toString();
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ public class WorkConfig {
|
||||||
throw new UnsupportedOperationException("Cannot instantiate utility class");
|
throw new UnsupportedOperationException("Cannot instantiate utility class");
|
||||||
}
|
}
|
||||||
//本地
|
//本地
|
||||||
protected static String baseUrl = "http://192.168.0.34:48380/smart-canteen";
|
// protected static String baseUrl = "http://192.168.0.34:48380/smart-canteen";
|
||||||
protected static String prefixesUrl = "http://192.168.0.34:48380";
|
// protected static String prefixesUrl = "http://192.168.0.34:48380";
|
||||||
// protected static String baseUrl = "http://192.168.0.244:48380/smart-canteen";
|
protected static String baseUrl = "http://192.168.0.244:48380/smart-canteen";
|
||||||
// protected static String prefixesUrl = "http://192.168.0.244:48380";
|
protected static String prefixesUrl = "http://192.168.0.244:48380";
|
||||||
protected static String fileUrl = "http://192.168.0.14:9090/lnyst/";
|
protected static String fileUrl = "http://192.168.0.14:9090/lnyst/";
|
||||||
protected static String updateUrl = "https://www.baidu.com";
|
protected static String updateUrl = "https://www.baidu.com";
|
||||||
protected static String serverUri = "tcp://192.168.0.244:1883";
|
protected static String serverUri = "tcp://192.168.0.244:1883";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape>
|
||||||
|
<gradient
|
||||||
|
android:angle="0"
|
||||||
|
android:endColor="@color/primary_dark"
|
||||||
|
android:startColor="@color/primary_dark" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<gradient
|
||||||
|
android:angle="0"
|
||||||
|
android:endColor="@color/primary"
|
||||||
|
android:startColor="@color/primary" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/edittext_border" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
</shape>
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/white"/>
|
<solid android:color="@color/white"/>
|
||||||
<corners android:radius="5dp"/>
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/edittext_border" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
<solid android:color="#00000000" /> <!-- 透明 -->
|
<solid android:color="#00000000" /> <!-- 透明 -->
|
||||||
<stroke
|
<stroke
|
||||||
android:width="3dp"
|
android:width="3dp"
|
||||||
android:color="#4BCFCF" /> <!-- 圆形边框(可选) -->
|
android:color="#6C92E4" /> <!-- 圆形边框(可选) -->
|
||||||
</shape>
|
</shape>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="135"
|
||||||
|
android:endColor="#F5F7FA"
|
||||||
|
android:startColor="#E8EEF7" />
|
||||||
|
</shape>
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
android:text="00.0"
|
android:text="00.0"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:layout_marginEnd="25dp"
|
android:layout_marginEnd="25dp"
|
||||||
android:textColor="#606060"
|
android:textColor="#4C81F4"
|
||||||
android:textFontWeight="1000"
|
android:textFontWeight="1000"
|
||||||
android:textSize="25sp" />
|
android:textSize="25sp" />
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -169,11 +169,14 @@
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/face_rect_view_container"
|
|
||||||
android:layout_width="470dp"
|
android:layout_width="470dp"
|
||||||
android:layout_height="470dp"
|
android:layout_height="470dp"
|
||||||
android:background="@drawable/face_bg"
|
android:background="@drawable/face_bg"
|
||||||
android:padding="1px"
|
android:layout_gravity="center">
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/face_rect_view_container"
|
||||||
|
android:layout_width="460dp"
|
||||||
|
android:layout_height="460dp"
|
||||||
android:layout_gravity="center">
|
android:layout_gravity="center">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -190,13 +193,17 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextureView
|
<TextureView
|
||||||
android:id="@+id/texture_preview"
|
android:id="@+id/texture_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="465dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="465dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
/>
|
/>
|
||||||
<com.bonus.canteen.face.widget.FaceRectView
|
<com.bonus.canteen.face.widget.FaceRectView
|
||||||
android:id="@+id/face_rect_view"
|
android:id="@+id/face_rect_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="465dp"
|
||||||
android:layout_height="match_parent" />
|
android:layout_gravity="center"
|
||||||
|
android:layout_height="465dp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="800dp"
|
android:layout_width="900dp"
|
||||||
android:layout_height="500dp"
|
android:layout_height="600dp"
|
||||||
android:background="@drawable/title_gradient_bg"
|
android:background="@drawable/title_gradient_bg"
|
||||||
android:padding="20dp"
|
android:padding="50dp"
|
||||||
android:layout_marginTop="-100dp"
|
android:layout_marginTop="-100dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:paddingLeft="@dimen/config_margin_10dp"
|
android:paddingLeft="@dimen/config_margin_10dp"
|
||||||
android:paddingRight="@dimen/config_margin_10dp">
|
android:paddingRight="70dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
android:text="欢迎登录"
|
android:text="欢迎登录"
|
||||||
android:textColor="#333333"
|
android:textColor="#333333"
|
||||||
android:textFontWeight="1000"
|
android:textFontWeight="1000"
|
||||||
android:textSize="30sp" />
|
android:textSize="35sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -42,38 +42,38 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:layout_marginTop="@dimen/config_margin_20dp"
|
android:layout_marginTop="@dimen/config_margin_40dp"
|
||||||
android:paddingLeft="@dimen/config_margin_10dp"
|
android:paddingLeft="@dimen/config_margin_10dp"
|
||||||
android:paddingRight="@dimen/config_margin_10dp">
|
android:paddingRight="@dimen/config_margin_10dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatEditText
|
<androidx.appcompat.widget.AppCompatEditText
|
||||||
android:id="@+id/et_username"
|
android:id="@+id/et_username"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="80dp"
|
||||||
android:background="@drawable/edittext_border_white"
|
android:background="@drawable/edittext_border_white"
|
||||||
android:drawableStart="@drawable/ic_user"
|
android:drawableStart="@drawable/ic_user"
|
||||||
android:paddingStart="0dp"
|
android:paddingStart="0dp"
|
||||||
android:hint="请输入账号"
|
android:hint="请输入账号"
|
||||||
android:maxLength="11"
|
android:maxLength="11"
|
||||||
android:text="jkytj"
|
android:text="tqjsss"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:layout_marginTop="@dimen/config_margin_20dp"
|
android:layout_marginTop="50dp"
|
||||||
android:paddingLeft="@dimen/config_margin_10dp"
|
android:paddingLeft="@dimen/config_margin_10dp"
|
||||||
android:paddingRight="@dimen/config_margin_10dp">
|
android:paddingRight="@dimen/config_margin_10dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatEditText
|
<androidx.appcompat.widget.AppCompatEditText
|
||||||
android:id="@+id/et_password"
|
android:id="@+id/et_password"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="80dp"
|
||||||
android:background="@drawable/edittext_border_white"
|
android:background="@drawable/edittext_border_white"
|
||||||
android:drawableStart="@drawable/ic_password"
|
android:drawableStart="@drawable/ic_password"
|
||||||
android:paddingStart="0dp"
|
android:paddingStart="0dp"
|
||||||
android:hint="请输入密码"
|
android:hint="请输入密码"
|
||||||
android:text="Bonus$2027"
|
android:text="Bonus$2031"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -81,14 +81,14 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginTop="@dimen/config_margin_40dp"
|
android:layout_marginTop="60dp"
|
||||||
android:paddingLeft="@dimen/config_margin_10dp"
|
android:paddingLeft="@dimen/config_margin_10dp"
|
||||||
android:paddingRight="@dimen/config_margin_10dp">
|
android:paddingRight="@dimen/config_margin_10dp">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_login"
|
android:id="@+id/btn_login"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="65dp"
|
||||||
android:text="登录"
|
android:text="登录"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:background="@drawable/btn_border_bg_10_4c81f4"
|
android:background="@drawable/btn_border_bg_10_4c81f4"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,13 @@
|
||||||
<color name="colorPrimaryDark">#299EE3</color>
|
<color name="colorPrimaryDark">#299EE3</color>
|
||||||
<color name="color_dark_green">#006e6b</color>
|
<color name="color_dark_green">#006e6b</color>
|
||||||
<color name="colorAccent">#299EE3</color>
|
<color name="colorAccent">#299EE3</color>
|
||||||
|
<color name="primary">#4C81F4</color>
|
||||||
|
<color name="primary_dark">#3A6CD4</color>
|
||||||
|
<color name="text_primary">#333333</color>
|
||||||
|
<color name="text_secondary">#8A8A8A</color>
|
||||||
|
<color name="card_background">#FFFFFF</color>
|
||||||
|
<color name="edittext_border">#E0E0E0</color>
|
||||||
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="config_color_select_bg">#FFF1F1F1</color>
|
<color name="config_color_select_bg">#FFF1F1F1</color>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue