Przeglądaj źródła

1.修改Android Apex Drivers更换用户登陆后仍旧使用前一个账户。
2.修改Android Apex Drivers国际化。

Pen Li 7 lat temu
rodzic
commit
9774d4de25

+ 6 - 6
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/login/RetrievePasswordActivity.java

@@ -223,7 +223,7 @@ public class RetrievePasswordActivity extends BasicActivity
 		{
 			// Show a progress spinner, and kick off a background task to
 			// perform the user login attempt.
-			mLoginStatusMessageView.setText(R.string.login_progress_signing_in);
+			mLoginStatusMessageView.setText(R.string.sending);
 			showProgress(true);
 			mAuthTask = new UserLoginTask();
 			mAuthTask.execute((Void) null);
@@ -284,7 +284,7 @@ public class RetrievePasswordActivity extends BasicActivity
 		new AlertDialog.Builder(this)
 				.setTitle(title)
 				.setMessage(msg)
-				.setPositiveButton("Ok",null)
+				.setPositiveButton(R.string.btn_ok,null)
 				.show();
 
 	}
@@ -341,14 +341,14 @@ public class RetrievePasswordActivity extends BasicActivity
 
 					String msg = json.optString("err_msg");
 					if (msg == null || msg.length() == 0) {
-						msg = "Sorry,there is something wrong";
+						msg = getResources().getString(R.string.sorry);
 					}
-					showAlert("Warning",msg);
+					showAlert(getResources().getString(R.string.warning),msg);
 				}
 			} else {
 
-				String msg = "Sorry,there is something wrong";
-				showAlert("Warning",msg);
+				String msg = getResources().getString(R.string.sorry);
+				showAlert(getResources().getString(R.string.warning),msg);
 			}
 
 		}

+ 15 - 5
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/network/Network.java

@@ -47,12 +47,22 @@ public class Network extends com.usai.redant.rautils.utils.Network {
         if (params == null) {
             params = new Bundle();
         }
-        String user = ApexDriverApplication.sharedApplication().encryptUser();
-        String password = ApexDriverApplication.sharedApplication().encryptPassword();
 
-        if (user != null && user.length() > 0 && password != null && password.length() != 0) {
-            params.putString("name",user); // "WMoy059hzweXPSC74plhBA=="
-            params.putString("password",password); // "CzADM7u51eNR7ScfQtJw7w=="
+        String password = params.getString("password");
+
+        String user = params.getString("name");
+        if (user == null) {
+            user = ApexDriverApplication.sharedApplication().encryptUser();
+            if (!TextUtils.isEmpty(user)) {
+                params.putString("name",user);
+            }
+        }
+
+        if (password == null) {
+            password = ApexDriverApplication.sharedApplication().encryptPassword();
+            if (!TextUtils.isEmpty(password)) {
+                params.putString("password",password);
+            }
         }
 
         params.putString("platform","android");

+ 4 - 4
ApexDrivers/apexdriverslib/src/main/res/layout/activity_retrieve_password.xml

@@ -24,7 +24,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginBottom="16dp"
-            android:text="Connecting..."
+            android:text="@string/sending"
             android:textAppearance="?android:attr/textAppearanceMedium" />
     </LinearLayout>
 
@@ -43,7 +43,7 @@
                 android:id="@+id/user"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:hint="User name"
+                android:hint="@string/prompt_user"
                 android:imeActionId="666"
                 android:imeActionLabel="@string/action_sign_in_short"
                 android:imeOptions="actionUnspecified"
@@ -74,7 +74,7 @@
                     android:layout_weight="1"
                     android:paddingLeft="32dp"
                     android:paddingRight="32dp"
-                    android:text="Close" />
+                    android:text="@string/btn_close" />
 
                 <Button
                     android:id="@+id/btn_ok"
@@ -87,7 +87,7 @@
                     android:layout_weight="1"
                     android:paddingLeft="32dp"
                     android:paddingRight="32dp"
-                    android:text="Ok" />
+                    android:text="@string/btn_ok" />
 
             </LinearLayout>
         </LinearLayout>

+ 62 - 0
ApexDrivers/apexdriverslib/src/main/res/raw-zh/setting.json

@@ -0,0 +1,62 @@
+{
+  "sections": [
+    {
+      "settings": [
+        {
+          "type": 0,
+          "keyPath": "backgroundReportType",
+          "title": "响应位置请求",
+          "options": [
+            {
+              "option": 1,
+              "title": "拒绝"
+            },
+            {
+              "option": 2,
+              "title": "每次询问"
+            },
+            {
+              "option": 3,
+              "title": "允许"
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "settings": [
+        {
+          "type": 2,
+          "actionType": 1,
+          "title": "修改密码"
+        }
+      ]
+    },
+    {
+      "settings": [
+        {
+          "type": 2,
+          "actionType": 0,
+          "title": "清除缓存"
+        }
+      ]
+    },
+    {
+      "settings": [
+        {
+          "type": 4,
+          "title": "隐私政策",
+          "link": "https://ra.apexshipping.com/t/privacyPolicy.html"
+        }
+      ]
+    },
+    {
+      "settings": [
+        {
+          "type": 3,
+          "title": "关于"
+        }
+      ]
+    }
+  ]
+}

+ 80 - 0
ApexDrivers/apexdriverslib/src/main/res/values-zh/strings.xml

@@ -0,0 +1,80 @@
+<resources>
+    <string name="app_name">Apex &amp; Drivers</string>
+
+    <string name="str_ver">版本:</string>
+
+    <string name="error_field_required">必填</string>
+    <string name="error_invalid_email">无效的邮件地址</string>
+    <string name="login_progress_signing_in">登陆...</string>
+    <string name="str_email_sent">邮件已经发送</string>
+    <string name="str_retrieve_success">成功找回密码!</string>
+    <string name="msg_connection_none">无网络连接</string>
+    <string name="msg_net_error">不能连接到服务器</string>
+    <string name="msg_net_resulterror">An error occur on server,please contact our sales.CODE</string>
+    <string name="str_invalid_pore">无效到用户名或邮件地址</string>
+    <string name="str_retrieve_failed">检索失败</string>
+
+    <string name="error_incorrect_password">密码不正确</string>
+    <string name="msg_ver_low">应用版本过低</string>
+    <string name="action_sign_in_short">登陆</string>
+    <string name="prompt_email">邮件地址</string>
+    <string name="prompt_user">用户名</string>
+    <string name="prompt_password">密码</string>
+    <string name="str_savepass">保存密码</string>
+    <string name="action_sign_in_register"><b>登陆</b></string>
+    <string name="str_retrievepass">找回密码</string>
+    <string name="title_activity_detail">DetailActivity</string>
+
+    <string name="msg_default_status">Place a barcode inside the viewfinder rectangle to scan it.</string>
+
+    <string name="preferences_actions_title">When a barcode is found\u2026</string>
+    <string name="preferences_auto_focus_title">Use auto focus</string>
+    <string name="preferences_bulk_mode_summary">Scan and save many barcodes continuously</string>
+    <string name="preferences_bulk_mode_title">Bulk scan mode</string>
+    <string name="preferences_copy_to_clipboard_title">Copy to clipboard</string>
+    <string name="preferences_custom_product_search_summary" formatted="false">Substitutions: %s = contents, %f = format, %t = type</string>
+    <string name="preferences_custom_product_search_title">Custom search URL</string>
+    <string name="preferences_decode_1D_title">1D barcodes</string>
+    <string name="preferences_decode_Data_Matrix_title">Data Matrix</string>
+    <string name="preferences_decode_QR_title">QR Codes</string>
+    <string name="preferences_device_bug_workarounds_title">Device Bug Workarounds</string>
+    <string name="preferences_disable_continuous_focus_summary">Use only standard focus mode</string>
+    <string name="preferences_disable_continuous_focus_title">No continuous focus</string>
+    <string name="preferences_front_light_summary">Improves scanning in low light on some phones, but may cause glare. Does not work on all phones.</string>
+    <string name="preferences_front_light_title">Use front light</string>
+    <string name="preferences_front_light_auto">Automatic</string>
+    <string name="preferences_front_light_off">Off</string>
+    <string name="preferences_front_light_on">On</string>
+    <string name="preferences_general_title">General settings</string>
+    <string name="preferences_invert_scan_title">Invert scan</string>
+    <string name="preferences_invert_scan_summary">Scan for white barcodes on black background. Not available on some devices.</string>
+    <string name="preferences_play_beep_title">Beep</string>
+    <string name="preferences_remember_duplicates_summary">Store multiple scans of the same barcode in History</string>
+    <string name="preferences_remember_duplicates_title">Remember duplicates</string>
+    <string name="preferences_result_title">Result settings</string>
+    <string name="preferences_scanning_title">When scanning for barcodes, decode\u2026</string>
+    <string name="preferences_search_country">Search country</string>
+    <string name="preferences_try_bsplus">Try Barcode Scanner+</string>
+    <string name="preferences_try_bsplus_summary">Enhanced with new features and interface</string>
+    <string name="preferences_supplemental_summary">Try to retrieve more information about the barcode contents</string>
+    <string name="preferences_supplemental_title">Retrieve more info</string>
+    <string name="preferences_vibrate_title">Vibrate</string>
+
+    <string name="msg_camera_framework_bug">对不起,Android相机遇到了问题。 您可能需要重新启动设备.</string>
+
+
+    <!--Common-->
+    <string name="button_ok">确定</string>
+    <string name="loading">加载中...</string>
+    <string name="sending">发送...</string>
+    <string name="warning">警告</string>
+    <string name="message">消息</string>
+    <string name="btn_cancel">取消</string>
+    <string name="sorry">对不起,发生未知错误.</string>
+
+    <!--Retrive Password-->
+    <string name="btn_close">取消</string>
+    <string name="btn_ok">确定</string>
+
+
+</resources>

+ 11 - 0
ApexDrivers/apexdriverslib/src/main/res/values/strings.xml

@@ -61,7 +61,18 @@
     <string name="preferences_vibrate_title">Vibrate</string>
 
     <string name="msg_camera_framework_bug">Sorry, the Android camera encountered a problem. You may need to restart the device.</string>
+
+    <!--Common-->
     <string name="button_ok">OK</string>
+    <string name="loading">loading...</string>
+    <string name="sending">sending...</string>
+    <string name="warning">Warning</string>
+    <string name="message">Message</string>
+    <string name="btn_cancel">Cancel</string>
+    <string name="sorry">Sorry,there is something wrong</string>
 
+    <!--Retrive Password-->
+    <string name="btn_close">取消</string>
+    <string name="btn_ok">确定</string>
 
 </resources>