Jelajahi Sumber

Merge branch 'cabinet_req_2023_05_04' of zhushouping/ich-android into cabinet_req_2023_05_04

寄件开柜提示ui改造
朱寿平 1 tahun lalu
induk
melakukan
4df7f6148f

+ 1 - 1
app/src/main/java/com/emato/ich/fragment/ExceptionFragment.java

@@ -306,7 +306,7 @@ public class ExceptionFragment extends Fragment {
             //获取mAlert对象
             Field mAlert = AlertDialog.class.getDeclaredField("mAlert");
             mAlert.setAccessible(true);
-            Object mAlertController = mAlert.get(builder);
+            Object mAlertController = mAlert.get(alertDialog);
             //获取mTitleView并设置大小颜色
             Field mTitle = mAlertController.getClass().getDeclaredField("mTitleView");
             mTitle.setAccessible(true);

+ 115 - 5
app/src/main/java/com/emato/ich/fragment/SendInfoConfirmFragment.java

@@ -1,12 +1,14 @@
 package com.emato.ich.fragment;
 
 import android.app.AlertDialog;
+import android.graphics.Color;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.TextView;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
@@ -37,6 +39,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import org.jetbrains.annotations.NotNull;
 
 import java.io.IOException;
+import java.lang.reflect.Field;
 import java.util.Objects;
 
 import okhttp3.Call;
@@ -218,8 +221,10 @@ public class SendInfoConfirmFragment extends Fragment {
 //            bundle.putString("exception", "exception_page");
 //            finalActivity.getBundleMap().put(SendInfoConfirmFragment.class.getName(), bundle);
             AlertDialog alertDialog = new AlertDialog.Builder(finalActivity)
-                    .setTitle("e站通")
-                    .setMessage("点击未投递会取消本次投递!并且取消投递后的订单状态为预下单!确认取消吗?")
+                    //.setTitle("e站通")
+                    .setTitle("温馨提示")
+                    //.setMessage("点击未投递会取消本次投递!并且取消投递后的订单状态为预下单!确认取消吗?")
+                    .setMessage("点击未投递会取消本次投递!\n并且取消投递后的订单状态为预下单!\n确认取消吗?")
                     .setPositiveButton("确认", (dialog, which) -> {
                         // 是, 取消本次投递
                         ConfirmOrderVo confirmOrderVo = new ConfirmOrderVo();
@@ -253,15 +258,43 @@ public class SendInfoConfirmFragment extends Fragment {
                         dialog.dismiss();
                     }).create();
             alertDialog.show();
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setBackgroundColor(Color.BLUE);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setTextSize(20);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE).setTextSize(20);
+
+            try {
+                //获取mAlert对象
+                Field mAlert = androidx.appcompat.app.AlertDialog.class.getDeclaredField("mAlert");
+                mAlert.setAccessible(true);
+                Object mAlertController = mAlert.get(alertDialog);
+                //获取mTitleView并设置大小颜色
+                Field mTitle = mAlertController.getClass().getDeclaredField("mTitleView");
+                mTitle.setAccessible(true);
+                TextView mTitleView = (TextView) mTitle.get(mAlertController);
+                mTitleView.setTextSize(25);
+                mTitleView.setTextColor(Color.BLUE);
+                //获取mMessageView并设置大小颜色
+                Field mMessage = mAlertController.getClass().getDeclaredField("mMessageView");
+                mMessage.setAccessible(true);
+                TextView mMessageView = (TextView) mMessage.get(mAlertController);
+                mMessageView.setTextSize(18);
+                mMessageView.setTextColor(Color.BLACK);
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            } catch (NoSuchFieldException e) {
+                e.printStackTrace();
+            }
         });
 
-        binding.returnMainBtn.setOnClickListener(view1 -> {
+        binding.mainBtn.setOnClickListener(view1 -> {
             if (ButtonUtils.isFastClick()) {
                 return;
             }
             AlertDialog alertDialog = new AlertDialog.Builder(finalActivity)
-                    .setTitle("e站通")
-                    .setMessage("返回主页会取消本次投递!并且本次投递的订单状态为预下单!确认取消吗?")
+                    //.setTitle("e站通")
+                    .setTitle("温馨提示")
+                    //.setMessage("返回主页会取消本次投递!并且本次投递的订单状态为预下单!确认取消吗?")
+                    .setMessage("返回主页会取消本次投递!\n并且本次投递的订单状态为预下单!\n确认取消吗?")
                     .setPositiveButton("确认", ((dialog, which) -> {
                         if (null != timer) {
                             timer.cancel();
@@ -276,6 +309,83 @@ public class SendInfoConfirmFragment extends Fragment {
                         dialog.dismiss();
                     })).create();
             alertDialog.show();
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setBackgroundColor(Color.BLUE);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setTextSize(20);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE).setTextSize(20);
+
+            try {
+                //获取mAlert对象
+                Field mAlert = androidx.appcompat.app.AlertDialog.class.getDeclaredField("mAlert");
+                mAlert.setAccessible(true);
+                Object mAlertController = mAlert.get(alertDialog);
+                //获取mTitleView并设置大小颜色
+                Field mTitle = mAlertController.getClass().getDeclaredField("mTitleView");
+                mTitle.setAccessible(true);
+                TextView mTitleView = (TextView) mTitle.get(mAlertController);
+                mTitleView.setTextSize(25);
+                mTitleView.setTextColor(Color.BLUE);
+                //获取mMessageView并设置大小颜色
+                Field mMessage = mAlertController.getClass().getDeclaredField("mMessageView");
+                mMessage.setAccessible(true);
+                TextView mMessageView = (TextView) mMessage.get(mAlertController);
+                mMessageView.setTextSize(18);
+                mMessageView.setTextColor(Color.BLACK);
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            } catch (NoSuchFieldException e) {
+                e.printStackTrace();
+            }
+        });
+
+        binding.backHome.setOnClickListener(view1 -> {
+            if (ButtonUtils.isFastClick()) {
+                return;
+            }
+            AlertDialog alertDialog = new AlertDialog.Builder(finalActivity)
+                    //.setTitle("e站通")
+                    .setTitle("温馨提示")
+                    //.setMessage("返回主页会取消本次投递!并且本次投递的订单状态为预下单!确认取消吗?")
+                    .setMessage("返回主页会取消本次投递!\n并且本次投递的订单状态为预下单!\n确认取消吗?")
+                    .setPositiveButton("确认", ((dialog, which) -> {
+                        if (null != timer) {
+                            timer.cancel();
+                        }
+                        boolean isException = false;
+                        if (LocalStorage.getInstance().getSession().getException()) {
+                            isException = true;
+                        }
+                        LocalStorage.getInstance().cleanSession(((MainActivity) getActivity()), isException);
+                        NavUtils.navigate(this, R.id.action_sendInfoConfirmFragment_to_mainFragment);
+                    })).setNegativeButton("取消", ((dialog, which) -> {
+                        dialog.dismiss();
+                    })).create();
+            alertDialog.show();
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setBackgroundColor(Color.BLUE);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setTextSize(20);
+            alertDialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE).setTextSize(20);
+
+            try {
+                //获取mAlert对象
+                Field mAlert = androidx.appcompat.app.AlertDialog.class.getDeclaredField("mAlert");
+                mAlert.setAccessible(true);
+                Object mAlertController = mAlert.get(alertDialog);
+                //获取mTitleView并设置大小颜色
+                Field mTitle = mAlertController.getClass().getDeclaredField("mTitleView");
+                mTitle.setAccessible(true);
+                TextView mTitleView = (TextView) mTitle.get(mAlertController);
+                mTitleView.setTextSize(25);
+                mTitleView.setTextColor(Color.BLUE);
+                //获取mMessageView并设置大小颜色
+                Field mMessage = mAlertController.getClass().getDeclaredField("mMessageView");
+                mMessage.setAccessible(true);
+                TextView mMessageView = (TextView) mMessage.get(mAlertController);
+                mMessageView.setTextSize(18);
+                mMessageView.setTextColor(Color.BLACK);
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            } catch (NoSuchFieldException e) {
+                e.printStackTrace();
+            }
         });
 
     }

+ 15 - 14
app/src/main/res/layout/fragment_send_info_confirm.xml

@@ -56,17 +56,18 @@
 
     <TextView
         android:id="@+id/send_door_open"
-        android:layout_width="85dp"
-        android:layout_height="88dp"
-        android:layout_x="100dp"
-        android:layout_y="160dp" />
+        android:layout_width="125dp"
+        android:layout_height="100dp"
+        android:layout_x="137dp"
+        android:layout_y="170dp"
+        android:background="@drawable/open_door"/>
 
     <TextView
         android:id="@+id/open_cabinet_no"
         android:layout_width="200dp"
         android:layout_height="70dp"
         android:layout_x="100dp"
-        android:layout_y="256dp"
+        android:layout_y="300dp"
         android:gravity="center"
         android:text="@string/open_cabinet_no"
         android:textColor="#00a0d7"
@@ -78,7 +79,7 @@
         android:layout_width="100dp"
         android:layout_height="30dp"
         android:layout_x="100dp"
-        android:layout_y="340dp"
+        android:layout_y="390dp"
         android:textAlignment="textStart"
         android:gravity="center"
         android:text="@string/take_no_hint"
@@ -91,7 +92,7 @@
         android:layout_width="100dp"
         android:layout_height="30dp"
         android:layout_x="200dp"
-        android:layout_y="340dp"
+        android:layout_y="390dp"
         android:textAlignment="textEnd"
         android:gravity="center"
         android:textColor="#00a0d7"
@@ -105,7 +106,7 @@
         android:layout_width="75dp"
         android:layout_height="30dp"
         android:layout_x="100dp"
-        android:layout_y="370dp"
+        android:layout_y="410dp"
         android:textAlignment="textStart"
         android:gravity="center"
         android:text="@string/take_number_hint"
@@ -118,7 +119,7 @@
         android:layout_width="125dp"
         android:layout_height="30dp"
         android:layout_x="175dp"
-        android:layout_y="370dp"
+        android:layout_y="410dp"
         android:textAlignment="textEnd"
         android:gravity="center"
         android:text="@string/take_number"
@@ -132,7 +133,7 @@
         android:layout_width="202dp"
         android:layout_height="47dp"
         android:layout_x="100dp"
-        android:layout_y="450dp"
+        android:layout_y="490dp"
         android:background="@drawable/already_send_new"/>
 
     <TextView
@@ -140,7 +141,7 @@
         android:layout_width="202dp"
         android:layout_height="47dp"
         android:layout_x="100dp"
-        android:layout_y="514dp"
+        android:layout_y="554dp"
         android:background="@drawable/none_send_new"/>
 
     <TextView
@@ -148,7 +149,7 @@
         android:layout_width="200dp"
         android:layout_height="40dp"
         android:layout_x="100dp"
-        android:layout_y="624dp"
+        android:layout_y="664dp"
         android:textAlignment="center"
         android:gravity="center"
         android:text="@string/return_main_btn"
@@ -162,7 +163,7 @@
         android:layout_width="47dp"
         android:layout_height="127dp"
         android:layout_x="359dp"
-        android:layout_y="578dp"
+        android:layout_y="618dp"
         android:radius="6dp"
         android:background="@drawable/exception_handler_new" />
     <ImageView
@@ -170,7 +171,7 @@
         android:layout_width="388dp"
         android:layout_height="80dp"
         android:layout_x="14dp"
-        android:layout_y="724dp"
+        android:layout_y="774dp"
         android:background="@drawable/how_to_send" />
 
     <!--<TextView