Kaynağa Gözat

功能开发--动态表单基本完成,---待优化速度

Arison 9 yıl önce
ebeveyn
işleme
c0918c31dc

+ 1 - 1
WeiChat/build.gradle

@@ -24,7 +24,7 @@ android {
     defaultConfig {
         applicationId "com.xzjmyk.pm.activity"
         minSdkVersion 9
-        targetSdkVersion 23
+        targetSdkVersion 22
         compileOptions {
             sourceCompatibility JavaVersion.VERSION_1_7
             targetCompatibility JavaVersion.VERSION_1_7

+ 1 - 1
WeiChat/src/main/AndroidManifest.xml

@@ -761,7 +761,7 @@
 
         <activity
             android:name=".ui.erp.activity.form.DataFormDetailActivity"
-            android:windowSoftInputMode="adjustPan|stateHidden" />
+            />
         <activity android:name=".ui.erp.activity.form.DataFormControllActivity" >
         </activity>
     </application>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 304 - 302
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/form/DataFormDetailActivity.java


+ 117 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/RegexUtil.java

@@ -0,0 +1,117 @@
+package com.xzjmyk.pm.activity.ui.erp.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**正则表达式工具类
+ * Created by Administrator on 2016/3/25.
+ */
+public class RegexUtil {
+//    isEmail(String email)	判断是否为合法的电子邮件地址
+//    isPhoneNum(String phoneNum)	判断是否为合法的手机号
+//    isPersonIdValidation(String personId)	判断是否为身份证号
+//    isQQ(String qqStr)	判断是否为QQ号
+//    isNumber(String str)	判断是否为数字
+
+
+    public static boolean checkEmail(String email) {
+        String regex = "\\w+@\\w+\\.[a-z]+(\\.[a-z]+)?";
+        return Pattern.matches(regex, email);
+    }
+
+
+    public static boolean checkIdCard(String idCard) {
+        String regex = "[1-9]\\d{13,16}[a-zA-Z0-9]{1}";
+        return Pattern.matches(regex, idCard);
+    }
+
+
+    public static boolean checkMobile(String mobile) {
+        String regex = "(\\+\\d+)?1[3458]\\d{9}$";
+        return Pattern.matches(regex, mobile);
+    }
+
+
+    public static boolean checkPhone(String phone) {
+        String regex = "(\\+\\d+)?(\\d{3,4}\\-?)?\\d{7,8}$";
+        return Pattern.matches(regex, phone);
+    }
+    /**
+     * @desc:数字
+     * @author:Arison on 2016/11/22
+     */
+    public static boolean checkDigit(String digit) {
+        String regex = "^-?[1-9]\\d*$";
+        return Pattern.matches(regex, digit);
+    }
+
+
+    /**
+     * @desc:正整数
+     * @param digit
+     * @author Arison
+     */
+    public static boolean checkPositiveDigit(String digit){
+        String regex = "^[1-9]\\d*$";
+        return Pattern.matches(regex, digit);
+    }
+    /**
+      * @desc:小数
+      * @author:Arison on 2016/11/22
+      */
+    public static boolean checkDecimals(String decimals) {
+        String regex = "\\-?[1-9]\\d+(\\.\\d+)?";
+        return Pattern.matches(regex, decimals);
+    }
+
+    /**
+      * @desc:空行
+      * @author:Arison on 2016/11/22
+      */
+    public static boolean checkBlankSpace(String blankSpace) {
+        String regex = "\\s+";
+        return Pattern.matches(regex, blankSpace);
+    }
+
+    /**
+      * @desc:中文
+      * @author:Arison on 2016/11/22
+      */
+    public static boolean checkChinese(String chinese) {
+        String regex = "^[\u4E00-\u9FA5]+$";
+        return Pattern.matches(regex, chinese);
+    }
+
+   
+    public static boolean checkBirthday(String birthday) {
+        String regex = "[1-9]{4}([-./])\\d{1,2}\\1\\d{1,2}";
+        return Pattern.matches(regex, birthday);
+    }
+
+
+    public static boolean checkURL(String url) {
+//        String regex = "(https?://(w{3}\\.)?)?\\w+\\.\\w+(\\.[a-zA-Z]+)*(:\\d{1,5})?(/\\w*)*(\\??(.+=.*)?(&.+=.*)?)?";
+        String regex = "(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?";
+        return Pattern.matches(regex, url);
+    }
+
+    public static String getDomain(String url) {
+        Pattern p = Pattern.compile("(?<=http://|\\.)[^.]*?\\.(com|cn|net|org|biz|info|cc|tv)", Pattern.CASE_INSENSITIVE);
+        // 获取完整的域名
+        // Pattern p=Pattern.compile("[^//]*?\\.(com|cn|net|org|biz|info|cc|tv)", Pattern.CASE_INSENSITIVE);
+        Matcher matcher = p.matcher(url);
+        matcher.find();
+        return matcher.group();
+    }
+
+    public static boolean checkPostcode(String postcode) {
+        String regex = "[1-9]\\d{5}";
+        return Pattern.matches(regex, postcode);
+    }
+
+
+    public static boolean checkIpAddress(String ipAddress) {
+        String regex = "[1-9](\\d{1,2})?\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))";
+        return Pattern.matches(regex, ipAddress);
+    }
+}

+ 63 - 57
WeiChat/src/main/res/layout/activity_data_form_detail.xml

@@ -1,71 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
     tools:context="com.xzjmyk.pm.activity.ui.erp.activity.form.DataFormDetailActivity">
-    
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical">
-        <!--com.xzjmyk.pm.activity.ui.erp.view.ListViewInScroller-->
-        <com.xzjmyk.pm.activity.ui.erp.view.ListViewInScroller
-            android:id="@+id/lv_datas"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:dividerHeight="0.1dp"
-            android:listSelector="@color/transparent"
-            android:divider="@color/item_line"/>
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        tools:context="com.xzjmyk.pm.activity.ui.erp.activity.form.DataFormDetailActivity">
         <LinearLayout
-            android:id="@+id/ll_item_add"
+            android:id="@+id/ll_top"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
-            <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:background="@color/item_line" />
-            <TextView
-                android:id="@+id/tv_item_add"
+            <com.xzjmyk.pm.activity.ui.erp.view.ListViewInScroller
+                android:id="@+id/lv_datas"
                 android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:layout_gravity="center"
-                android:gravity="center"
-                android:background="@color/white"
-                android:textColor="@color/titleBlue"
-                android:text="新增明细"/>
-        </LinearLayout>
+                android:layout_height="match_parent"
+                android:dividerHeight="0.1dp"
+                android:listSelector="@color/transparent"
+                android:divider="@color/item_line"/>
+            <LinearLayout
+                android:id="@+id/ll_item_add"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="0.5dp"
+                    android:background="@color/item_line" />
+                <TextView
+                    android:id="@+id/tv_item_add"
+                    android:layout_width="match_parent"
+                    android:layout_height="40dp"
+                    android:layout_gravity="center"
+                    android:gravity="center"
+                    android:background="@color/white"
+                    android:textColor="@color/titleBlue"
+                    android:text="新增明细"/>
+            </LinearLayout>
 
-        <Button
-            android:id="@+id/click_btn"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@+id/info"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="10dp"
-            android:layout_marginTop="20dp"
-            android:background="@drawable/bg_orange_btn"
-            android:padding="10dp"
-            android:text="提交"
-            android:textColor="@color/white"
-            android:layout_marginBottom="150dp"
-            android:textSize="@dimen/text_main" />
-    <!--    <Button
-        
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@+id/info"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="10dp"
-            android:layout_marginTop="20dp"
-            android:background="@drawable/bg_orange_btn"
-            android:padding="10dp"
-            android:text="反提交"
-            android:textColor="@color/white"
-            android:visibility="gone"
-            android:textSize="@dimen/text_main" />-->
+            <Button
+                android:id="@+id/click_btn"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/info"
+                android:layout_marginLeft="10dp"
+                android:layout_marginRight="10dp"
+                android:layout_marginTop="20dp"
+                android:background="@drawable/bg_orange_btn"
+                android:padding="10dp"
+                android:text="提交"
+                android:textColor="@color/white"
+                android:layout_marginBottom="150dp"
+                android:textSize="@dimen/text_main" />
+            <!--    <Button
+                
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_below="@+id/info"
+                    android:layout_marginLeft="10dp"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginTop="20dp"
+                    android:background="@drawable/bg_orange_btn"
+                    android:padding="10dp"
+                    android:text="反提交"
+                    android:textColor="@color/white"
+                    android:visibility="gone"
+                    android:textSize="@dimen/text_main" />-->
+
+        </LinearLayout>
+    </ScrollView>
+</LinearLayout>
 
-    </LinearLayout>
-</ScrollView>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor