Переглянути джерело

新增身份证输入,修改页面调整逻辑和修复bug

zhongzhao 1 рік тому
батько
коміт
7fc12c7e8c
33 змінених файлів з 715 додано та 209 видалено
  1. 3 3
      app/src/main/AndroidManifest.xml
  2. 116 0
      app/src/main/java/com/hw/nativeapp/CustomKeyboard.java
  3. 49 8
      app/src/main/java/com/hw/nativeapp/httpnet/ErrorConsumer.java
  4. 19 3
      app/src/main/java/com/hw/nativeapp/httpnet/ResponseConsumer.java
  5. 33 2
      app/src/main/java/com/hw/nativeapp/ui/activity/InfoEnterActivity.java
  6. 46 3
      app/src/main/java/com/hw/nativeapp/ui/activity/InfoInputActivity.java
  7. 18 4
      app/src/main/java/com/hw/nativeapp/ui/activity/IssueTicketsActivity.java
  8. 34 8
      app/src/main/java/com/hw/nativeapp/ui/activity/MainActivity.java
  9. 8 3
      app/src/main/java/com/hw/nativeapp/ui/activity/PaymentMethodActivity.java
  10. 9 1
      app/src/main/java/com/hw/nativeapp/ui/activity/PurchaseInfoActivity.java
  11. 2 0
      app/src/main/java/com/hw/nativeapp/ui/activity/ScanCodePayActivity.java
  12. 5 1
      app/src/main/java/com/hw/nativeapp/ui/activity/SelectInfoActivity.java
  13. 2 1
      app/src/main/java/com/hw/nativeapp/ui/activity/SplashActivity.java
  14. 6 8
      app/src/main/java/com/hw/nativeapp/ui/activity/TakeActivity.java
  15. 2 0
      app/src/main/java/com/hw/nativeapp/ui/activity/TakeUserInfoActivity.java
  16. 22 1
      app/src/main/java/com/hw/nativeapp/ui/activity/TicketCollectionActivity.java
  17. 18 0
      app/src/main/java/com/hw/nativeapp/ui/activity/TicketPurchaseActivity.java
  18. 46 0
      app/src/main/java/com/hw/nativeapp/ui/widgets/MyKeyboardView.java
  19. 1 0
      app/src/main/java/com/hw/nativeapp/utils/MaskUtil.java
  20. 9 0
      app/src/main/res/drawable/bg_keyboard_btn.xml
  21. 14 0
      app/src/main/res/layout/activity_info_input.xml
  22. 0 1
      app/src/main/res/layout/activity_issue_tickets.xml
  23. 26 15
      app/src/main/res/layout/activity_main.xml
  24. 109 103
      app/src/main/res/layout/activity_purchase_info.xml
  25. 42 37
      app/src/main/res/layout/activity_ticket_purchase.xml
  26. 2 2
      app/src/main/res/layout/item_ticket_collection.xml
  27. 3 3
      app/src/main/res/layout/item_ticket_purchase.xml
  28. BIN
      app/src/main/res/mipmap-hdpi/icon_number_del.png
  29. BIN
      app/src/main/res/mipmap-hdpi/icon_number_del_b.png
  30. 9 0
      app/src/main/res/xml/anim_left_in.xml
  31. 8 0
      app/src/main/res/xml/anim_right_out.xml
  32. 52 0
      app/src/main/res/xml/keyboard.xml
  33. 2 2
      config.gradle

+ 3 - 3
app/src/main/AndroidManifest.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+    xmlns:tools="http://schemas.android.com/tools"
+    package="com.hw.great.self">
 
     <!-- jpush start -->
     <permission
@@ -17,8 +18,7 @@
     <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
-        tools:ignore="ScopedStorage" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

+ 116 - 0
app/src/main/java/com/hw/nativeapp/CustomKeyboard.java

@@ -0,0 +1,116 @@
+package com.hw.nativeapp;
+
+import android.content.Context;
+import android.inputmethodservice.Keyboard;
+import android.inputmethodservice.KeyboardView;
+import android.text.Editable;
+import android.view.View;
+import android.widget.EditText;
+
+import com.hw.nativeapp.ui.widgets.MyKeyboardView;
+
+/**
+ * Created by yi17.zhang on 2017/5/19.
+ */
+public class CustomKeyboard {
+
+    private EditText mEdittext;
+    private MyKeyboardView mKeyboardView;
+    private Keyboard mKeyboard;
+
+    public CustomKeyboard(Context context, MyKeyboardView keyboardView, EditText editText) {
+        this.mEdittext = editText;
+        mKeyboard = new Keyboard(context, R.xml.keyboard);//从xml中加载自定义的键盘
+        mKeyboardView = keyboardView;
+        mKeyboardView.setContext(context);
+        mKeyboardView.setKeyboard(mKeyboard);
+        mKeyboardView.setPreviewEnabled(false);
+        mKeyboardView.setOnKeyboardActionListener(actionListener);
+    }
+
+    private KeyboardView.OnKeyboardActionListener actionListener = new KeyboardView.OnKeyboardActionListener() {
+        @Override
+        public void onPress(int primaryCode) {
+        }
+
+        @Override
+        public void onRelease(int primaryCode) {
+
+        }
+
+        @Override
+        public void onKey(int primaryCode, int[] keyCodes) {
+            Editable editable = mEdittext.getText();
+            int index = mEdittext.getSelectionStart();//光标位置
+            switch (primaryCode) {
+
+                case Keyboard.KEYCODE_DELETE://回退
+                    if (editable != null && editable.length() > 0) {
+                        if (index > 0) {
+                            editable.delete(index - 1, index);
+                        }
+                    }
+                    break;
+                case 9995://重输
+                    mEdittext.setText("");
+                    break;
+                case 9994://左移
+                    if (index > 0) {
+                        mEdittext.setSelection(index - 1);
+                    }
+                    break;
+                case 9996://右移
+                    if (index < mEdittext.length()) {
+                        mEdittext.setSelection(index + 1);
+                    }
+                    break;
+                default:
+                    editable.insert(index, Character.toString((char) primaryCode));
+                    break;
+            }
+        }
+
+        @Override
+        public void onText(CharSequence text) {
+
+        }
+
+        @Override
+        public void swipeLeft() {
+
+        }
+
+        @Override
+        public void swipeRight() {
+
+        }
+
+        @Override
+        public void swipeDown() {
+
+        }
+
+        @Override
+        public void swipeUp() {
+
+        }
+    };
+
+    public void showKeyboard() {
+        if (mKeyboardView.getVisibility() != View.VISIBLE) {
+            mKeyboardView.setVisibility(View.VISIBLE);
+        }
+    }
+
+    public void hideKeyboard() {
+        if (mKeyboardView.getVisibility() == View.VISIBLE) {
+            mKeyboardView.setVisibility(View.GONE);
+        }
+    }
+
+    public boolean isShowKeyboard() {
+        return mKeyboardView.getVisibility() == View.VISIBLE;
+    }
+
+}
+

+ 49 - 8
app/src/main/java/com/hw/nativeapp/httpnet/ErrorConsumer.java

@@ -2,6 +2,7 @@ package com.hw.nativeapp.httpnet;
 
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.Gravity;
 
 import androidx.annotation.StringRes;
 
@@ -46,15 +47,30 @@ public class ErrorConsumer implements Consumer<Throwable> {
                 ResponseData responseData = JSONObject.parseObject(content, ResponseData.class);
                 if (responseData != null) {
                     String msg = responseData.getMsg();
-                    toast(msg);
+//                    toast(msg);
+                    ToastUtils Toast = new ToastUtils();
+                    Toast.setGravity(Gravity.TOP, 0, 200);
+                    Toast.setTextSize(32);
+                    Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                    Toast.show(msg);
                 }
 
             } else {
                     String msg = getMsg(exception);
                     if (!TextUtils.isEmpty(msg)) {
-                        toast(msg);
+//                        toast(msg);
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show(msg);
                     } else if (stringRes != 0) {
-                        ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+//                        ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show(MApplication.getInstance().getText(stringRes));
                     }
 
             }
@@ -67,7 +83,12 @@ public class ErrorConsumer implements Consumer<Throwable> {
                         msg = MApplication.getInstance().getString(R.string.network_error);
                     }
                     if(msg.indexOf("No address associated with hostname") > -1){
-                        toast("网络错误,请检查网络!");
+//                        toast("网络错误,请检查网络!");
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show("网络错误,请检查网络!");
                     } else if (msg.indexOf(".setVisibility(int)") > -1){
 
                     } else if (msg.indexOf("to post notification on channel") > -1){
@@ -77,11 +98,21 @@ public class ErrorConsumer implements Consumer<Throwable> {
                     } else if (msg.indexOf("Index: 0, Size: 0") > -1){
 
                     } else {
-                        toast(msg);
+//                        toast(msg);
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show(msg);
                     }
                 } else {
                     if(msg.indexOf("No address associated with hostname") > -1){
-                        toast("网络错误,请检查网络!");
+//                        toast("网络错误,请检查网络!");
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show("网络错误,请检查网络!");
                     } else if (msg.indexOf(".setVisibility(int)") > -1){
 
                     } else if (msg.indexOf("to post notification on channel") > -1){
@@ -89,11 +120,21 @@ public class ErrorConsumer implements Consumer<Throwable> {
                     }else if (msg.indexOf("on a null object reference") > -1){
 
                     }else {
-                        toast(msg);
+//                        toast(msg);
+                        ToastUtils Toast = new ToastUtils();
+                        Toast.setGravity(Gravity.TOP, 0, 200);
+                        Toast.setTextSize(32);
+                        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                        Toast.show(msg);
                     }
                 }
             } else {
-                ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+//                ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+                ToastUtils Toast = new ToastUtils();
+                Toast.setGravity(Gravity.TOP, 0, 200);
+                Toast.setTextSize(32);
+                Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                Toast.show(MApplication.getInstance().getText(stringRes));
             }
         }
 

+ 19 - 3
app/src/main/java/com/hw/nativeapp/httpnet/ResponseConsumer.java

@@ -3,6 +3,7 @@ package com.hw.nativeapp.httpnet;
 import android.os.RemoteException;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.Gravity;
 
 import com.blankj.utilcode.util.LogUtils;
 import com.blankj.utilcode.util.ToastUtils;
@@ -35,7 +36,12 @@ public abstract class ResponseConsumer<E> implements Consumer<ResponseData<E>> {
                 LogUtils.e("code : " + code + ", Error : " + msg);
 //                LoadingDialogUtils.cancelLoadingDialog();
                 LoadingDialog.getInstance(MApplication.getAppContext()).hide();
-                ToastUtils.showShort(msg);
+//                ToastUtils.showShort(msg);
+                ToastUtils Toast = new ToastUtils();
+                Toast.setGravity(Gravity.TOP, 0, 200);
+                Toast.setTextSize(32);
+                Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                Toast.show(msg);
 //                if (code == 1)
 //                    ToastUtils.showShort(msg);
 //                if ("该证件已经被其他手机号绑定".equals(msg)){
@@ -88,10 +94,20 @@ public abstract class ResponseConsumer<E> implements Consumer<ResponseData<E>> {
 
     public static void showErrorMsg(String msg) {
         if (TextUtils.isEmpty(msg)) {
-            ToastUtils.showShort("请求错误");
+//            ToastUtils.showShort("请求错误");
+            ToastUtils Toast = new ToastUtils();
+            Toast.setGravity(Gravity.TOP, 0, 200);
+            Toast.setTextSize(32);
+            Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+            Toast.show("请求错误");
             return;
         }
-        ToastUtils.showShort(msg);
+//        ToastUtils.showShort(msg);
+        ToastUtils Toast = new ToastUtils();
+        Toast.setGravity(Gravity.TOP, 0, 200);
+        Toast.setTextSize(32);
+        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+        Toast.show(msg);
     }
 
 }

+ 33 - 2
app/src/main/java/com/hw/nativeapp/ui/activity/InfoEnterActivity.java

@@ -13,6 +13,7 @@ import android.os.Handler;
 import android.os.IBinder;
 import android.util.Log;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.Toast;
 
 import androidx.annotation.NonNull;
@@ -86,6 +87,7 @@ public class InfoEnterActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_info_enter);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
 //        bindIDCardService();
     }
     @Override
@@ -192,7 +194,7 @@ public class InfoEnterActivity extends BaseActivity  {
             mService = IDCardServiceAidl.Stub.asInterface(service);
             Log.e("id_card", " 服务已连接");
             Toast.makeText(InfoEnterActivity.this, "请将身份证放置到指示位置!", Toast.LENGTH_SHORT).show();
-
+            autoFu();
         }
 
         @Override
@@ -201,11 +203,39 @@ public class InfoEnterActivity extends BaseActivity  {
             Log.e("id_card", "服务已断开");
         }
     };
-    public void auto(View view) {
+    public void readFu() {
+        Toast.makeText(InfoEnterActivity.this, "read!", Toast.LENGTH_SHORT).show();
+        try {
+            if (mService != null) {
+                IDCardInfo cardInfo = mService.readCard();
+                if (cardInfo != null) {
+                    //显示图片
+                    Toast.makeText(InfoEnterActivity.this, "身份证去ok!" , Toast.LENGTH_SHORT).show();
+                    Log.i(TAG, "read: " + cardInfo.getIdCard());
+                    name = cardInfo.getName(); // 姓名
+                    idcard = cardInfo.getIdCard(); // 身份证号
+                    factorAuth();
+                } else {
+                    Toast.makeText(InfoEnterActivity.this, "card is null!", Toast.LENGTH_SHORT).show();
+                    Log.i(TAG, "card info is null ");
+                }
+            } else {
+                Toast.makeText(InfoEnterActivity.this, "service is null!", Toast.LENGTH_SHORT).show();
+                Log.i(TAG, "service is null");
+            }
+        } catch (Exception e) {
+            Toast.makeText(InfoEnterActivity.this, "read error!", Toast.LENGTH_SHORT).show();
+            Log.i(TAG, "got error: " + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+    public void autoFu() {
+        Toast.makeText(InfoEnterActivity.this, "auto!", Toast.LENGTH_SHORT).show();
         try {
             mService.readCardAuto(new CardCallback.Stub() {
                 @Override
                 public void getCardData(final IDCardInfo info, int code) {
+                    Toast.makeText(InfoEnterActivity.this, "code=" + code, Toast.LENGTH_SHORT).show();
                     Log.i(TAG, "getCardData: code=" + code + ", id info:" + info);
                     if (code == 10) {
                         //读取成功
@@ -222,6 +252,7 @@ public class InfoEnterActivity extends BaseActivity  {
                 }
             });
         } catch (Exception e) {
+            Toast.makeText(InfoEnterActivity.this, "auto read is error !", Toast.LENGTH_SHORT).show();
             Log.i(TAG, "auto read is error " + e.getMessage());
             e.printStackTrace();
         }

+ 46 - 3
app/src/main/java/com/hw/nativeapp/ui/activity/InfoInputActivity.java

@@ -1,28 +1,41 @@
 package com.hw.nativeapp.ui.activity;
 import android.annotation.SuppressLint;
 import android.app.ProgressDialog;
+import android.content.Context;
 import android.content.Intent;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.os.Handler;
+import android.text.InputType;
 import android.util.Log;
+import android.view.Gravity;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.Toast;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.blankj.utilcode.util.ToastUtils;
 import com.hjq.bar.OnTitleBarListener;
 import com.hjq.bar.TitleBar;
+import com.hw.nativeapp.CustomKeyboard;
 import com.hw.nativeapp.MApplication;
 import com.hw.nativeapp.R;
 import com.hw.nativeapp.httpnet.ErrorConsumer;
 import com.hw.nativeapp.httpnet.ResponseConsumer;
+import com.hw.nativeapp.ui.widgets.MyKeyboardView;
 import com.hw.nativeapp.utils.ActivityUtils;
 import com.hw.nativeapp.utils.MaskUtil;
 import com.hw.nativeapp.utils.RxUtil;
 
+import java.lang.reflect.Method;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 
@@ -33,6 +46,7 @@ public class InfoInputActivity extends BaseActivity  {
     private CountDownTimer timer;
     private TitleBar titleBar;
     private ProgressDialog progressDialog;
+    CustomKeyboard mCustomKeyboard;
 
     @BindView(R.id.et_name)
     EditText et_name;
@@ -77,6 +91,27 @@ public class InfoInputActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_info_input);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        //1 屏蔽掉系统默认输入法
+        et_idcard.setInputType(InputType.TYPE_NULL);
+
+        //2 初试化键盘
+        MyKeyboardView keyboardView = (MyKeyboardView) findViewById(R.id.customKeyboard);
+        mCustomKeyboard = new CustomKeyboard(InfoInputActivity.this, keyboardView, et_idcard);
+        mCustomKeyboard.hideKeyboard();
+        et_idcard.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                if (hasFocus) {
+//                    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+                    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+                    mCustomKeyboard.showKeyboard();
+                } else {
+                    mCustomKeyboard.hideKeyboard();
+                }
+            }
+        });
     }
 
     @OnClick({R.id.input_btn})
@@ -130,12 +165,16 @@ public class InfoInputActivity extends BaseActivity  {
 
     // 二要数认证
     private void factorAuth(){
+        ToastUtils Toast = new ToastUtils();
+        Toast.setGravity(Gravity.TOP, 0, 200);
+        Toast.setTextSize(32);
+        Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
         if(et_name.getText().toString().isEmpty() || et_idcard.getText().toString().isEmpty()){
-            ToastUtils.showShort("请输入姓名和身份证号");
+            Toast.show("请输入姓名和身份证号");
             return;
         }
         if(et_name.getText().toString().length() < 2 || et_idcard.getText().toString().length() < 18){
-            ToastUtils.showShort("姓名和身份证号格式错误");
+            Toast.show("姓名和身份证号格式错误");
             return;
         }
         JSONObject options = new  JSONObject();
@@ -161,7 +200,11 @@ public class InfoInputActivity extends BaseActivity  {
                             if(progressDialog != null){
                                 progressDialog.dismiss();
                             }
-                            ToastUtils.showShort(data.getString("errReason"));
+                            ToastUtils Toast1 = new ToastUtils();
+                            Toast1.setGravity(Gravity.TOP, 0, 200);
+                            Toast1.setTextSize(32);
+                            Toast1.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                            Toast1.show(data.getString("errReason"));
                         }
                     }
 

+ 18 - 4
app/src/main/java/com/hw/nativeapp/ui/activity/IssueTicketsActivity.java

@@ -9,7 +9,9 @@ import android.os.CountDownTimer;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -17,6 +19,7 @@ import android.widget.Toast;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.ToastUtils;
 import com.hjq.bar.OnTitleBarListener;
 import com.hjq.bar.TitleBar;
 import com.hw.nativeapp.MApplication;
@@ -68,7 +71,8 @@ public class IssueTicketsActivity extends BaseActivity  {
 
             @Override
             public void onLeftClick(View v) {
-                ActivityUtils.activityFinish(IssueTicketsActivity.this, true );
+                Intent i = new Intent (IssueTicketsActivity.this  ,  MainActivity.class  ).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+                startActivity(i);
             }
 
             @Override
@@ -86,7 +90,7 @@ public class IssueTicketsActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_issue_tickets);
-
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
         tx_issue_not.setVisibility(View.GONE);
         selfIndex();
         getPageTransmitParams();
@@ -201,7 +205,12 @@ public class IssueTicketsActivity extends BaseActivity  {
         }
         if(printerStatus != 0 && printerStatus != 3){
             String msg = printerStatus == -1 ? "打印机脱机或打印服务还未连接打印机" : printerStatus == 1 ? "打印机开盖" : printerStatus == 2 ? "打印机缺纸" : printerStatus == 3 ? "打印机即将缺纸" : "打印机过热";
-            Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
+//            Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
+            ToastUtils Toast = new ToastUtils();
+            Toast.setGravity(Gravity.TOP, 0, 200);
+            Toast.setTextSize(32);
+            Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+            Toast.show(msg);
             return;
         }
         JSONArray rowItem = obj.getJSONArray("printList");
@@ -275,7 +284,12 @@ public class IssueTicketsActivity extends BaseActivity  {
                 finishView();
             }
         } else {
-            Toast.makeText(IssueTicketsActivity.this, "打印小票数据为空!" + rowItem, Toast.LENGTH_SHORT).show();
+//            Toast.makeText(IssueTicketsActivity.this, "打印小票数据为空!" + rowItem, Toast.LENGTH_SHORT).show();
+            ToastUtils Toast = new ToastUtils();
+            Toast.setGravity(Gravity.TOP, 0, 200);
+            Toast.setTextSize(32);
+            Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+            Toast.show("打印小票数据为空");
         }
     }
 

+ 34 - 8
app/src/main/java/com/hw/nativeapp/ui/activity/MainActivity.java

@@ -11,12 +11,16 @@ import android.os.IBinder;
 import android.os.RemoteException;
 import android.provider.Settings;
 import android.util.Log;
+import android.view.GestureDetector;
 import android.view.KeyEvent;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.Toast;
+import android.widget.ViewFlipper;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -47,7 +51,7 @@ import butterknife.BindView;
 import butterknife.OnClick;
 
 
-public class MainActivity extends BaseActivity  {
+public class MainActivity extends BaseActivity {
     public static final Integer COUNTDOWN_TIME = 15000;
     private CountDownTimer timer;
 
@@ -57,6 +61,7 @@ public class MainActivity extends BaseActivity  {
 
     private String deviceId = "";
     private int closeNum = 0;
+    private float startX;
 
     @BindView(R.id.tx_customerMobile)
     TextView tx_customerMobile;
@@ -65,14 +70,18 @@ public class MainActivity extends BaseActivity  {
     @BindView(R.id.tx_hide)
     TextView tx_hide;
 
-    @BindView(R.id.main_img)
-    ImageView main_img;
+//    @BindView(R.id.main_img)
+//    ImageView main_img;
+
+    private ViewFlipper     mFlipper;
+    private GestureDetector mDetector; //手势检测
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
 //        bindExtPrinterService();
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @Override
@@ -220,10 +229,28 @@ public class MainActivity extends BaseActivity  {
                     public void onSuccess(JSONObject data) {
                         tx_customerMobile.setText("客服电话:" + data.getString("customerMobile"));
                         JSONArray list = data.getJSONArray("advList");
-                        if (list != null && list.size() > 0) {
-                            JSONObject jsonObject = list.getJSONObject(0);
-                            String sliderImg = jsonObject.getString("sliderImg");
-                            Picasso.with(MainActivity.this).load(sliderImg).into(main_img);
+                        ViewFlipper flipper = findViewById(R.id.flipper);
+                        if (list != null && list.size() > 1) {
+                            for (int i = 0; i < list.size(); i++) {
+                                Log.e("i", i+"");
+                                ImageView imageView=new ImageView(MainActivity.this);
+                                imageView.setScaleType(ImageView.ScaleType.FIT_XY);
+                                imageView.setMaxHeight(800);
+                                imageView.setMinimumHeight(800);
+                                String sliderImg = list.getJSONObject(i).getString("sliderImg");
+                                Picasso.with(MainActivity.this).load(sliderImg).into(imageView);
+                                flipper.addView(imageView);
+                            }
+                            flipper.setFlipInterval(4000);//设置自动切换的间隔时间
+                            flipper.showNext();
+                            flipper.startFlipping();
+                        } else {
+                            ImageView imageView=new ImageView(MainActivity.this);
+                            imageView.setScaleType(ImageView.ScaleType.FIT_XY);
+                            imageView.setMaxHeight(800);
+                            imageView.setMinimumHeight(800);
+                            imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.mipmap.main_top));
+                            flipper.addView(imageView);
                         }
                     }
 
@@ -232,7 +259,6 @@ public class MainActivity extends BaseActivity  {
                     }
                 }, new ErrorConsumer());
     }
-
     // 打印注册
     private void bindExtPrinterService() {
         Intent intent = new Intent();

+ 8 - 3
app/src/main/java/com/hw/nativeapp/ui/activity/PaymentMethodActivity.java

@@ -11,6 +11,7 @@ import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.util.Log;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -46,6 +47,7 @@ public class PaymentMethodActivity extends BaseActivity  {
     ImageView wechat_pay;
 
 
+    private int isPage = 0;
     private String orderId = "";
     private String total = "";
     private String totalPeice = "";
@@ -81,11 +83,12 @@ public class PaymentMethodActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_payment_method);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
     @Override
     protected void onStart() {
         super.onStart();
-        registerReceiver();
+//        registerReceiver();
     }
     @Override
     protected void onStop() {
@@ -169,6 +172,9 @@ public class PaymentMethodActivity extends BaseActivity  {
                     @Override
                     public void onSuccess(JSONObject data) {
                         // 支付状态: 0-未支付 1-已支付 2-支付中 3-支付失败 4-支付退款
+                        if(isPage == 1){
+                            return;
+                        }
                         if(data.getIntValue("payStatus") != 0 && data.getIntValue("payStatus") != 2){
                             stopOrderCountDownTimer();
                             Bundle bundle = new Bundle();
@@ -181,6 +187,7 @@ public class PaymentMethodActivity extends BaseActivity  {
 //                            bundle.putString("viewerList", JSONArray.toJSONString(viewerList));
                             ActivityUtils.launchActivity(PaymentMethodActivity.this, ScanCodePayActivity.class, bundle);
                             ActivityUtils.activityFinish(PaymentMethodActivity.this, true );
+                            isPage = 1;
                         }
                     }
 
@@ -198,7 +205,6 @@ public class PaymentMethodActivity extends BaseActivity  {
         public void onReceive(Context context, Intent intent)
         {
             String code = intent.getStringExtra("data");
-            Toast.makeText(PaymentMethodActivity.this, "扫码返回数据:" + code, Toast.LENGTH_SHORT).show();
             if (code != null && !code.isEmpty())
             {
                 gotoMicroPay(code);
@@ -240,7 +246,6 @@ public class PaymentMethodActivity extends BaseActivity  {
         IntentFilter fifilter = new IntentFilter();
         fifilter.addAction("com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED");
         registerReceiver(receiver, fifilter);
-        Toast.makeText(PaymentMethodActivity.this, "扫码注册!", Toast.LENGTH_SHORT).show();
         onSendSerialCmd();
     }
 

+ 9 - 1
app/src/main/java/com/hw/nativeapp/ui/activity/PurchaseInfoActivity.java

@@ -7,7 +7,9 @@ import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.os.Handler;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -113,6 +115,7 @@ public class PurchaseInfoActivity extends BaseActivity  {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_purchase_info);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @Override
@@ -262,7 +265,12 @@ public class PurchaseInfoActivity extends BaseActivity  {
                 viewerList.remove(position);
                 initLoadData();
             } else {
-                Toast.makeText(this, "至少保留一个观影人", Toast.LENGTH_SHORT).show();
+//                Toast.makeText(this, "至少保留一个观影人", Toast.LENGTH_SHORT).show();
+                ToastUtils Toast = new ToastUtils();
+                Toast.setGravity(Gravity.TOP, 0, 200);
+                Toast.setTextSize(32);
+                Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+                Toast.show("至少保留一个观影人");
             }
         });
 

+ 2 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/ScanCodePayActivity.java

@@ -6,6 +6,7 @@ import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.util.Log;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -70,6 +71,7 @@ public class ScanCodePayActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_scan_code_pay);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @OnClick({R.id.code_btn})

+ 5 - 1
app/src/main/java/com/hw/nativeapp/ui/activity/SelectInfoActivity.java

@@ -8,6 +8,7 @@ import android.os.CountDownTimer;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
@@ -105,6 +106,7 @@ public class SelectInfoActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_select_info);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @OnClick({R.id.select_btn})
@@ -119,7 +121,9 @@ public class SelectInfoActivity extends BaseActivity  {
                     bundle.putString("seatTypeId", seatTypeId);
                     bundle.putString("goodsId", goodsId);
                     bundle.putString("salePeice", salePeice);
-                    ActivityUtils.launchActivity(this, InfoEnterActivity.class, bundle);
+                    bundle.putString("type", "1");
+//                    ActivityUtils.launchActivity(this, InfoEnterActivity.class, bundle);
+                    ActivityUtils.launchActivity(this, InfoInputActivity.class, bundle);
                     break;
                 }
         }

+ 2 - 1
app/src/main/java/com/hw/nativeapp/ui/activity/SplashActivity.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.TextView;
 
 import androidx.annotation.Nullable;
@@ -25,7 +26,7 @@ public class SplashActivity extends Activity implements View.OnClickListener {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_splash);
-
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
         txJump = findViewById(R.id.tx_jump);
         txContentdown = findViewById(R.id.tx_contentdown);
         txJump.setOnClickListener(this);

+ 6 - 8
app/src/main/java/com/hw/nativeapp/ui/activity/TakeActivity.java

@@ -15,6 +15,7 @@ import android.os.RemoteException;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -79,6 +80,7 @@ public class TakeActivity extends BaseActivity  {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_take);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
     @Override
     protected void onStart() {
@@ -89,7 +91,7 @@ public class TakeActivity extends BaseActivity  {
         }
 
         registerReceiver();
-        bindIDCardService();
+//        bindIDCardService();
     }
     @Override
     protected void onStop() {
@@ -127,7 +129,6 @@ public class TakeActivity extends BaseActivity  {
         if (mConnection != null) {
             try {
                 unbindService(mConnection);
-                Toast.makeText(TakeActivity.this, "ID服务已断开", Toast.LENGTH_SHORT).show();
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -250,7 +251,6 @@ public class TakeActivity extends BaseActivity  {
         IntentFilter fifilter = new IntentFilter();
         fifilter.addAction("com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED");
         registerReceiver(receiver, fifilter);
-        Toast.makeText(TakeActivity.this, "扫码注册!", Toast.LENGTH_SHORT).show();
         onSendSerialCmd();
     }
 
@@ -296,6 +296,7 @@ public class TakeActivity extends BaseActivity  {
             mService = IDCardServiceAidl.Stub.asInterface(service);
             Log.e("id_card", " 服务已连接");
             Toast.makeText(TakeActivity.this, "请将身份证放置到指示位置!", Toast.LENGTH_SHORT).show();
+            auto();
         }
 
         @Override
@@ -310,7 +311,6 @@ public class TakeActivity extends BaseActivity  {
                 @Override
                 public void getCardData(final IDCardInfo info, int code) {
                     Log.i(TAG, "getCardData: code=" + code + ", id info:" + info);
-                    Toast.makeText(TakeActivity.this, "身份证读取!" + code, Toast.LENGTH_SHORT).show();
                     if (code == 10) {
                         //读取成功
                         Log.i(TAG, "getCardData: " + info.toString());
@@ -321,18 +321,17 @@ public class TakeActivity extends BaseActivity  {
                         bundle.putString("idcard", info.getIdCard());
                         ActivityUtils.launchActivity(TakeActivity.this, TicketCollectionActivity.class, bundle);
                     } else if (code == -10) {
-                        Toast.makeText(TakeActivity.this, "身份证读取失败!" + code, Toast.LENGTH_SHORT).show();
+//                        Toast.makeText(TakeActivity.this, "身份证读取失败!" + code, Toast.LENGTH_SHORT).show();
                         //读取失败
                         Log.i(TAG, "auto read card did not get data");
                     } else {
-                        Toast.makeText(TakeActivity.this, "身份证读取失败!" + code, Toast.LENGTH_SHORT).show();
+//                        Toast.makeText(TakeActivity.this, "身份证读取失败!" + code, Toast.LENGTH_SHORT).show();
                         Log.i(TAG, "what is wrong");
                     }
                 }
             });
         } catch (Exception e) {
             Log.i(TAG, "auto read is error " + e.getMessage());
-            Toast.makeText(TakeActivity.this, "auto read is error " + e.getMessage(), Toast.LENGTH_SHORT).show();
             e.printStackTrace();
         }
     }
@@ -340,7 +339,6 @@ public class TakeActivity extends BaseActivity  {
         try {
             if (mService != null) {
                 IDCardInfo cardInfo = mService.readCard();
-                Toast.makeText(TakeActivity.this, "111111!", Toast.LENGTH_SHORT).show();
                 if (cardInfo != null) {
                     //显示图片
                     Log.i(TAG, "read: " + cardInfo.toString());

+ 2 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/TakeUserInfoActivity.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.TextView;
 
 import androidx.annotation.Nullable;
@@ -94,6 +95,7 @@ public class TakeUserInfoActivity extends BaseActivity  {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_take_user_info);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @Override

+ 22 - 1
app/src/main/java/com/hw/nativeapp/ui/activity/TicketCollectionActivity.java

@@ -8,7 +8,9 @@ import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.os.Handler;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.CheckBox;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -74,6 +76,7 @@ public class TicketCollectionActivity extends BaseActivity  {
     private String qrcodeNo;
     private String idcard = "";
     private String orderId = "";
+    private int initNum = 0;
 
     private JSONArray dataList = new JSONArray();
 
@@ -109,6 +112,7 @@ public class TicketCollectionActivity extends BaseActivity  {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_ticket_collection);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @Override
@@ -156,6 +160,10 @@ public class TicketCollectionActivity extends BaseActivity  {
     }
 
     private void reflashFinish(){
+        initNum ++;
+        if(progressDialog != null){
+            progressDialog.dismiss();
+        }
         if (refreshLayout != null){
             refreshLayout.finishRefresh();
             refreshLayout.finishLoadMore();
@@ -229,6 +237,14 @@ public class TicketCollectionActivity extends BaseActivity  {
         if(orderId != null && !orderId.isEmpty()){
             options.put("orderId", orderId);
         }
+        if(initNum == 0){
+            progressDialog = MaskUtil.showProgressDialog( "数据加载中...", TicketCollectionActivity.this);
+            new Handler().postDelayed(() -> {
+                if(progressDialog != null){
+                    progressDialog.dismiss();
+                }
+            }, 30000);
+        }
         MApplication.getApiService().getValidList( options, System.currentTimeMillis() / 1000)
                 .compose(RxUtil.applyObservableAsync())
                 .subscribe(new ResponseConsumer<JSONObject>() {
@@ -327,7 +343,12 @@ public class TicketCollectionActivity extends BaseActivity  {
             }
         }
         if(viewerList == null || viewerList.size() == 0){
-            Toast.makeText(TicketCollectionActivity.this, "请选择要打印的票", Toast.LENGTH_SHORT).show();
+//            Toast.makeText(TicketCollectionActivity.this, "请选择要打印的票", Toast.LENGTH_SHORT).show();
+            com.blankj.utilcode.util.ToastUtils Toast = new com.blankj.utilcode.util.ToastUtils();
+            Toast.setGravity(Gravity.TOP, 0, 200);
+            Toast.setTextSize(32);
+            Toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+            Toast.show("请选择要打印的票");
             return;
         }
         Bundle bundle = new Bundle();

+ 18 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/TicketPurchaseActivity.java

@@ -5,7 +5,9 @@ import android.app.ProgressDialog;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.CountDownTimer;
+import android.os.Handler;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.TextView;
 
 import androidx.annotation.Nullable;
@@ -26,6 +28,7 @@ import com.hw.nativeapp.httpnet.entity.handleBean;
 import com.hw.nativeapp.ui.activity.adapters.TicketCollectionAdapter;
 import com.hw.nativeapp.ui.activity.adapters.TicketPurchaseAdapter;
 import com.hw.nativeapp.utils.ActivityUtils;
+import com.hw.nativeapp.utils.MaskUtil;
 import com.hw.nativeapp.utils.RxUtil;
 import com.hw.nativeapp.utils.StockUtils;
 import com.hw.nativeapp.utils.ToastUtils;
@@ -52,6 +55,7 @@ public class TicketPurchaseActivity extends BaseActivity {
     public static final Integer COUNTDOWN_TIME = 120000;
     private CountDownTimer timer;
     private TitleBar titleBar;
+    private ProgressDialog progressDialog;
 
     private PageAsk pageAsk = new PageAsk();
     private handleBean operLocation;
@@ -59,6 +63,7 @@ public class TicketPurchaseActivity extends BaseActivity {
     private String getId;
 
     private JSONArray dataList = new JSONArray();
+    private int initNum = 0;
 
     @Override
     void initView() {
@@ -91,6 +96,7 @@ public class TicketPurchaseActivity extends BaseActivity {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_ticket_purchase);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
     }
 
     @Override
@@ -113,6 +119,10 @@ public class TicketPurchaseActivity extends BaseActivity {
     }
 
     private void reflashFinish(){
+        initNum ++;
+        if(progressDialog != null){
+            progressDialog.dismiss();
+        }
         if (refreshLayout != null){
             refreshLayout.finishRefresh();
             refreshLayout.finishLoadMore();
@@ -158,6 +168,14 @@ public class TicketPurchaseActivity extends BaseActivity {
 
     private void getDataList(boolean cleaned){
         Map< String,String> options = new HashMap<>();
+        if(initNum == 0){
+            progressDialog = MaskUtil.showProgressDialog( "数据加载中...", TicketPurchaseActivity.this);
+            new Handler().postDelayed(() -> {
+                if(progressDialog != null){
+                    progressDialog.dismiss();
+                }
+            }, 30000);
+        }
         MApplication.getApiService().selectAll( options, System.currentTimeMillis() / 1000)
                 .compose(RxUtil.applyObservableAsync())
                 .subscribe(new ResponseConsumer<JSONObject>() {

+ 46 - 0
app/src/main/java/com/hw/nativeapp/ui/widgets/MyKeyboardView.java

@@ -0,0 +1,46 @@
+package com.hw.nativeapp.ui.widgets;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.inputmethodservice.Keyboard;
+import android.inputmethodservice.KeyboardView;
+import android.util.AttributeSet;
+
+/**
+ * 用于以后扩展功能
+ */
+public class MyKeyboardView extends KeyboardView {
+
+    private Context context;
+
+    public MyKeyboardView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public void setContext(Context context) {
+        this.context = context;
+    }
+
+    @Override
+    public void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+       /* List<Keyboard.Key> keys = getKeyboard().getKeys();
+        for(Keyboard.Key key: keys) {
+            if(key.label.equals("delete"))
+                resetOKBtn(key, canvas);
+        }*/
+    }
+
+    /**
+     * 绘制OK键的点9图
+     * @author Song
+     * @param key
+     * @param canvas
+     */
+    private void resetOKBtn(Keyboard.Key key, Canvas canvas) {
+        //将OK键重新绘制
+       /* Drawable npd = (Drawable) context.getResources().getDrawable(R.mipmap.icon_number_del);
+        npd.setBounds(key.x, key.y + 1, key.x + key.width, key.y + key.height + 1);
+        npd.draw(canvas);*/
+    }
+}

+ 1 - 0
app/src/main/java/com/hw/nativeapp/utils/MaskUtil.java

@@ -14,6 +14,7 @@ public class MaskUtil {
             mProgressDialog.setCanceledOnTouchOutside(false);
             mProgressDialog.setCancelable(false);
         }
+        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
         mProgressDialog.setMessage(message);
         if(!mProgressDialog.isShowing()){
             mProgressDialog.show();

+ 9 - 0
app/src/main/res/drawable/bg_keyboard_btn.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item android:state_pressed="true" >
+        <color android:color="#d1d5db"/>
+    </item>
+    <item android:state_pressed="false" >
+        <color android:color="#ffffff"/>
+    </item>
+</selector>

+ 14 - 0
app/src/main/res/layout/activity_info_input.xml

@@ -134,5 +134,19 @@
             </LinearLayout>
         </LinearLayout>
     </LinearLayout>
+    <com.hw.nativeapp.ui.widgets.MyKeyboardView
+        android:id="@+id/customKeyboard"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_gravity="bottom"
+        android:background="#e6e6e6"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:keyBackground="@drawable/bg_keyboard_btn"
+        android:keyTextColor="#000000"
+        android:keyTextSize="31dp"
+        android:labelTextSize="23.04sp"
+        android:shadowRadius="0" />
 
 </RelativeLayout>

+ 0 - 1
app/src/main/res/layout/activity_issue_tickets.xml

@@ -34,7 +34,6 @@
             app:leftTitle="返回"
             app:rightColor="@color/white"
             app:rightSize="@dimen/inedx_btn_size"
-            app:rightTitle="120s"
             app:title="自助取票"
             app:titleColor="@color/white"
             app:titleSize="@dimen/text_30dp_size" />

+ 26 - 15
app/src/main/res/layout/activity_main.xml

@@ -14,21 +14,33 @@
             android:layout_height="wrap_content"
             android:gravity="center"
             android:orientation="vertical">
-
-            <LinearLayout
+            <ViewFlipper
+                android:id="@+id/flipper"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center"
-                android:orientation="vertical">
-
-                <ImageView
-                    android:id="@+id/main_img"
-                    android:layout_width="match_parent"
-                    android:layout_height="650dp"
-                    android:scaleType="fitXY"
-                    android:src="@mipmap/main_top" />
-
-            </LinearLayout>
+                android:layout_height="650dp"
+                android:layout_weight="1"
+                android:inAnimation="@xml/anim_left_in"
+                android:outAnimation="@xml/anim_right_out">
+<!--                <ImageView-->
+<!--                    android:layout_width="match_parent"-->
+<!--                    android:layout_height="650dp"-->
+<!--                    android:scaleType="fitXY"-->
+<!--                    android:src="@mipmap/main_top" />-->
+            </ViewFlipper>
+<!--            <LinearLayout-->
+<!--                android:layout_width="match_parent"-->
+<!--                android:layout_height="wrap_content"-->
+<!--                android:gravity="center"-->
+<!--                android:orientation="vertical">-->
+
+<!--                <ImageView-->
+<!--                    android:id="@+id/main_img"-->
+<!--                    android:layout_width="match_parent"-->
+<!--                    android:layout_height="650dp"-->
+<!--                    android:scaleType="fitXY"-->
+<!--                    android:src="@mipmap/main_top" />-->
+
+<!--            </LinearLayout>-->
 
             <LinearLayout
                 android:layout_width="420dp"
@@ -137,7 +149,6 @@
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="50dp"
                     android:gravity="center"
                     android:orientation="vertical">
 

+ 109 - 103
app/src/main/res/layout/activity_purchase_info.xml

@@ -41,133 +41,139 @@
             app:titleSize="@dimen/text_30dp_size" />
     </LinearLayout>
 
-    <ScrollView
-        android:layout_marginTop="600dp"
-        android:layout_marginBottom="30dp"
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_below="@+id/tb_main_bar">
-        <LinearLayout
+        android:layout_height="wrap_content"
+        android:layout_gravity="top"
+        android:layout_marginTop="640sp"
+        android:orientation="vertical">
+        <ScrollView
+            android:layout_marginBottom="30dp"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="top"
-            android:orientation="vertical"
-            android:padding="60dp">
+            android:layout_height="match_parent"
+            android:layout_below="@+id/tb_main_bar">
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:layout_marginTop="20sp"
-                android:background="@drawable/bg_take"
+                android:layout_gravity="top"
                 android:orientation="vertical"
                 android:padding="60dp">
-
-                <ScrollView
-                    android:id="@+id/sv"
+                <LinearLayout
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_below="@+id/tb_main_bar">
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_marginTop="20sp"
+                    android:background="@drawable/bg_take"
+                    android:orientation="vertical"
+                    android:padding="60dp">
 
-                    <LinearLayout
+                    <ScrollView
+                        android:id="@+id/sv"
                         android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:gravity="center"
-                        android:layout_marginBottom="20sp"
-                        android:orientation="vertical">
-                        <TextView
-                            android:id="@+id/tx_noDataShow"
-                            android:layout_below="@+id/tb_main_bar"
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent"
-                            android:layout_marginTop="40sp"
-                            android:gravity="center"
-                            android:textSize="@dimen/text_30dp_size"
-                            android:visibility="gone"
-                            android:text="没有对应票据"/>
+                        android:layout_height="match_parent"
+                        android:layout_below="@+id/tb_main_bar">
 
-                        <com.scwang.smartrefresh.layout.SmartRefreshLayout
+                        <LinearLayout
                             android:layout_width="match_parent"
-                            android:layout_below="@+id/tb_main_bar"
-                            android:layout_marginTop="60sp"
-                            android:id="@+id/refreshLayout"
-                            android:layout_height="match_parent">
-
-                            <androidx.recyclerview.widget.RecyclerView
-                                android:id="@+id/list_stock"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:layout_marginBottom="20sp"
+                            android:orientation="vertical">
+                            <TextView
+                                android:id="@+id/tx_noDataShow"
+                                android:layout_below="@+id/tb_main_bar"
                                 android:layout_width="match_parent"
                                 android:layout_height="match_parent"
-                                app:layout_constraintBottom_toBottomOf="parent"
-                                app:layout_constraintEnd_toEndOf="parent"
-                                app:layout_constraintStart_toStartOf="parent"
-                                app:layout_constraintTop_toTopOf="parent" />
+                                android:layout_marginTop="40sp"
+                                android:gravity="center"
+                                android:textSize="@dimen/text_30dp_size"
+                                android:visibility="gone"
+                                android:text="没有对应票据"/>
 
-                        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
-                    </LinearLayout>
+                            <com.scwang.smartrefresh.layout.SmartRefreshLayout
+                                android:layout_width="match_parent"
+                                android:layout_below="@+id/tb_main_bar"
+                                android:layout_marginTop="60sp"
+                                android:id="@+id/refreshLayout"
+                                android:layout_height="match_parent">
 
-                </ScrollView>
+                                <androidx.recyclerview.widget.RecyclerView
+                                    android:id="@+id/list_stock"
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent"
+                                    app:layout_constraintBottom_toBottomOf="parent"
+                                    app:layout_constraintEnd_toEndOf="parent"
+                                    app:layout_constraintStart_toStartOf="parent"
+                                    app:layout_constraintTop_toTopOf="parent" />
 
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="50dp"
-                    android:gravity="right"
-                    android:orientation="horizontal">
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:id="@+id/tx_num"
-                        android:text="共2张, 合计"
-                        android:textColor="@color/black"
-                        android:textFontWeight="800"
-                        android:textSize="@dimen/text_30dp_size" />
-                    <TextView
-                        android:id="@+id/tx_total"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="¥488"
-                        android:paddingRight="10dp"
-                        android:textColor="@color/login_bk"
-                        android:textFontWeight="800"
-                        android:textSize="@dimen/text_30dp_size" />
-                </LinearLayout>
+                            </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+                        </LinearLayout>
 
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_marginTop="80dp"
-                    android:gravity="center"
-                    android:paddingBottom="30sp"
-                    android:orientation="horizontal">
+                    </ScrollView>
 
-                    <TextView
-                        android:id="@+id/continue_btn"
+                    <LinearLayout
                         android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_btn_01"
-                        android:gravity="center"
-                        android:padding="10sp"
-                        android:layout_marginRight="20sp"
-                        android:text="继续添加观影人"
-                        android:textColor="@color/white"
-                        android:textFontWeight="800"
-                        android:textSize="@dimen/text_30dp_size" />
-                    <TextView
-                        android:id="@+id/determine_btn"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="50dp"
+                        android:gravity="right"
+                        android:orientation="horizontal">
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:id="@+id/tx_num"
+                            android:text="共2张, 合计"
+                            android:textColor="@color/black"
+                            android:textFontWeight="800"
+                            android:textSize="@dimen/text_30dp_size" />
+                        <TextView
+                            android:id="@+id/tx_total"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="¥488"
+                            android:paddingRight="10dp"
+                            android:textColor="@color/login_bk"
+                            android:textFontWeight="800"
+                            android:textSize="@dimen/text_30dp_size" />
+                    </LinearLayout>
+
+                    <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_btn_01"
+                        android:layout_marginTop="80dp"
                         android:gravity="center"
-                        android:padding="10sp"
-                        android:text="确定付款"
-                        android:layout_marginLeft="20sp"
-                        android:textColor="@color/white"
-                        android:textFontWeight="800"
-                        android:textSize="@dimen/text_30dp_size" />
+                        android:paddingBottom="30sp"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:id="@+id/continue_btn"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1"
+                            android:background="@drawable/bg_btn_01"
+                            android:gravity="center"
+                            android:padding="10sp"
+                            android:layout_marginRight="20sp"
+                            android:text="继续添加观影人"
+                            android:textColor="@color/white"
+                            android:textFontWeight="800"
+                            android:textSize="@dimen/text_30dp_size" />
+                        <TextView
+                            android:id="@+id/determine_btn"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1"
+                            android:background="@drawable/bg_btn_01"
+                            android:gravity="center"
+                            android:padding="10sp"
+                            android:text="确定付款"
+                            android:layout_marginLeft="20sp"
+                            android:textColor="@color/white"
+                            android:textFontWeight="800"
+                            android:textSize="@dimen/text_30dp_size" />
+                    </LinearLayout>
                 </LinearLayout>
             </LinearLayout>
-        </LinearLayout>
-    </ScrollView>
+        </ScrollView>
+    </LinearLayout>
 
 </RelativeLayout>

+ 42 - 37
app/src/main/res/layout/activity_ticket_purchase.xml

@@ -40,50 +40,55 @@
             app:titleColor="@color/white"
             app:titleSize="@dimen/text_30dp_size" />
     </LinearLayout>
-
-    <ScrollView
-        android:id="@+id/sv"
-        android:layout_marginTop="600dp"
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_below="@+id/tb_main_bar">
-
-        <LinearLayout
+        android:layout_height="wrap_content"
+        android:layout_gravity="top"
+        android:layout_marginTop="640sp"
+        android:orientation="vertical">
+        <ScrollView
+            android:id="@+id/sv"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center"
-            android:layout_marginBottom="60sp"
-            android:orientation="vertical">
-            <TextView
-                android:id="@+id/tx_noDataShow"
-                android:layout_below="@+id/tb_main_bar"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_marginTop="120sp"
-                android:gravity="center"
-                android:visibility="gone"
-                android:textSize="@dimen/text_30dp_size"
-                android:text="没有对应票据"/>
+            android:layout_height="match_parent"
+            android:layout_below="@+id/tb_main_bar">
 
-            <com.scwang.smartrefresh.layout.SmartRefreshLayout
+            <LinearLayout
                 android:layout_width="match_parent"
-                android:layout_below="@+id/tb_main_bar"
-                android:layout_marginTop="60sp"
-                android:id="@+id/refreshLayout"
-                android:layout_height="match_parent">
-
-                <androidx.recyclerview.widget.RecyclerView
-                    android:id="@+id/list_stock"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:layout_marginBottom="60sp"
+                android:orientation="vertical">
+                <TextView
+                    android:id="@+id/tx_noDataShow"
+                    android:layout_below="@+id/tb_main_bar"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
+                    android:layout_marginTop="120sp"
+                    android:gravity="center"
+                    android:visibility="gone"
+                    android:textSize="@dimen/text_30dp_size"
+                    android:text="没有对应票据"/>
+
+                <com.scwang.smartrefresh.layout.SmartRefreshLayout
+                    android:layout_width="match_parent"
+                    android:layout_below="@+id/tb_main_bar"
+                    android:layout_marginTop="30sp"
+                    android:id="@+id/refreshLayout"
+                    android:layout_height="match_parent">
+
+                    <androidx.recyclerview.widget.RecyclerView
+                        android:id="@+id/list_stock"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
 
-            </com.scwang.smartrefresh.layout.SmartRefreshLayout>
-        </LinearLayout>
+                </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+            </LinearLayout>
 
-    </ScrollView>
+        </ScrollView>
+    </LinearLayout>
 
 </RelativeLayout>

+ 2 - 2
app/src/main/res/layout/item_ticket_collection.xml

@@ -32,12 +32,12 @@
                     android:scaleY="2" />
             </LinearLayout>
             <LinearLayout
-                android:layout_width="120dp"
+                android:layout_width="180dp"
                 android:layout_marginLeft="10sp"
                 android:layout_height="200dp">
                 <ImageView
                     android:id="@+id/iv_showImg"
-                    android:layout_width="120dp"
+                    android:layout_width="180dp"
                     android:layout_height="200dp"
                     android:scaleType="fitXY"
                     android:src="@mipmap/ticket_img" />

+ 3 - 3
app/src/main/res/layout/item_ticket_purchase.xml

@@ -19,14 +19,14 @@
             android:background="@drawable/bg_take"
             android:layout_height="wrap_content">
             <LinearLayout
-                android:layout_width="150dp"
+                android:layout_width="180dp"
                 android:background="@drawable/bg_take"
                 android:layout_height="200dp">
 
                 <ImageView
                     android:id="@+id/ip_showImg"
-                    android:layout_width="300dp"
-                    android:layout_height="400dp"
+                    android:layout_width="180dp"
+                    android:layout_height="200dp"
                     android:scaleType="fitXY"
                     android:src="@mipmap/ticket_img" />
             </LinearLayout>

BIN
app/src/main/res/mipmap-hdpi/icon_number_del.png


BIN
app/src/main/res/mipmap-hdpi/icon_number_del_b.png


+ 9 - 0
app/src/main/res/xml/anim_left_in.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <translate
+        android:duration="2000"
+        android:fromXDelta="-100%p"
+        android:toXDelta="0" />
+
+</set>

+ 8 - 0
app/src/main/res/xml/anim_right_out.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <translate
+        android:duration="2000"
+        android:fromXDelta="0"
+        android:toXDelta="100%p"/>
+</set>

+ 52 - 0
app/src/main/res/xml/keyboard.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
+    android:horizontalGap="3px"
+    android:verticalGap="3px"
+    android:keyHeight="60dp"
+    android:keyWidth="33.33%p">
+    <Row>
+        <Key
+            android:codes="49"
+            android:keyLabel="1" />
+        <Key
+            android:codes="50"
+            android:keyLabel="2" />
+        <Key
+            android:codes="51"
+            android:keyLabel="3" />
+    </Row>
+    <Row>
+        <Key
+            android:codes="52"
+            android:keyLabel="4" />
+        <Key
+            android:codes="53"
+            android:keyLabel="5" />
+        <Key
+            android:codes="54"
+            android:keyLabel="6" />
+    </Row>
+    <Row>
+        <Key
+            android:codes="55"
+            android:keyLabel="7" />
+        <Key
+            android:codes="56"
+            android:keyLabel="8" />
+        <Key
+            android:codes="57"
+            android:keyLabel="9" />
+    </Row>
+    <Row>
+        <Key
+            android:codes="88"
+            android:keyLabel="X"
+            />
+        <Key
+            android:codes="48"
+            android:keyLabel="0" />
+        <Key
+            android:codes="-5"
+            android:keyIcon="@mipmap/icon_number_del_b"/>
+    </Row>
+</Keyboard>

+ 2 - 2
config.gradle

@@ -17,8 +17,8 @@ ext {
     ]
 
     release = [
-            "apiHost"      : '""',
-            "apiName"      : '""',
+            "apiHost"      : '"https://admin.wdzzgs.com"',
+            "apiName"      : '"scenicprod-api"',
             "fileApiHost"      : '""',
             "fileApiName"      : '""',
             "prjectName" : '"正式"',