瀏覽代碼

增加多语言设置功能,调整优化APP逻辑保障APP语言翻译完整,发布车间程序增加国际化语言, 包含中文, 英语, 越南语

songw 1 月之前
父節點
當前提交
91f0f74754

+ 4 - 0
app/src/main/java/com/uas/hystorage/activity/MainActivity.java

@@ -11,6 +11,7 @@ import android.view.ViewGroup;
 import android.view.WindowManager;
 
 import com.uas.hystorage.R;
+import com.uas.hystorage.application.PdaApplication;
 import com.uas.hystorage.fragment.BaseFragment;
 import com.uas.hystorage.fragment.ConnectServerFragment;
 import com.uas.hystorage.fragment.LoginFragment;
@@ -129,6 +130,9 @@ public class MainActivity extends BaseActivity implements BackHandlerInterface {
 
     @Override
     public void onBackPressed() {
+        PdaApplication.removeAllDataCache();
+        System.exit(0);
+
         if (fragment.onFragmentBackPressed()) {
             return;
         }

+ 4 - 1
app/src/main/java/com/uas/hystorage/fragment/MyPagerAdapter.java → app/src/main/java/com/uas/hystorage/adapter/MyPagerAdapter.java

@@ -1,4 +1,4 @@
-package com.uas.hystorage.fragment;
+package com.uas.hystorage.adapter;
 
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
@@ -6,6 +6,9 @@ import android.support.v4.app.FragmentPagerAdapter;
 
 import com.uas.hystorage.R;
 import com.uas.hystorage.application.PdaApplication;
+import com.uas.hystorage.fragment.StorageDetailListFragment;
+import com.uas.hystorage.fragment.StorageInAddBarcodeListFragment;
+import com.uas.hystorage.fragment.StorageInAddTwoBarcodeListFragment;
 
 /**
  * Created by cjh-sail on 2024-01-23

+ 0 - 7
app/src/main/java/com/uas/hystorage/fragment/IOCOutMakeMaterial.java

@@ -138,13 +138,10 @@ public class IOCOutMakeMaterial extends BaseFragment implements StorageInAddList
                 refreshMaterialStatus();
             }
         }
-
-
     }
 
     @Override
     protected void initEvents() {
-
         listInOut.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
@@ -343,7 +340,6 @@ public class IOCOutMakeMaterial extends BaseFragment implements StorageInAddList
         PdaApplication.mRequestQueue.add(stringRequest);
     }
 
-
     private void rowClickEvent(final int i) {
         String pi_inoutno = mProdoutList.get(i).getPI_INOUTNO();
         String pi_id = mProdoutList.get(i).getPI_ID() + "";
@@ -370,11 +366,9 @@ public class IOCOutMakeMaterial extends BaseFragment implements StorageInAddList
         PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_OUT_CACHE, mProdoutList);
     }
 
-
     private TextWatcher inOutNoTextWatcher = new TextWatcher() {
         @Override
         public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
         }
 
         @Override
@@ -388,7 +382,6 @@ public class IOCOutMakeMaterial extends BaseFragment implements StorageInAddList
                 } else {
                     fuzzySearch();
                 }
-
             }
         }
 

+ 12 - 0
app/src/main/java/com/uas/hystorage/fragment/IndexSettingFragment.java

@@ -10,6 +10,7 @@ import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.provider.Settings;
 import android.support.v4.app.Fragment;
 import android.text.TextUtils;
 import android.view.Gravity;
@@ -22,6 +23,7 @@ import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -73,6 +75,7 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
     private LinearLayout settingCheckUpdateLl;
     private LinearLayout settingAboutUsLl;
     private LinearLayout settingExitCurrentAccountLl;
+    private RelativeLayout rl_language_settings;
 
     private String mUserCache;
     private String mUserName;
@@ -232,6 +235,7 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
         mIpAddressTv = (TextView) root.findViewById(R.id.setting_ip_address_name_tv);
         mAccountBookTv = root.findViewById(R.id.setting_account_name_tv);
         mVersionTextView = root.findViewById(R.id.setting_current_version);
+        rl_language_settings = root.findViewById(R.id.rl_language_settings);
 
         settingCheckUpdateLl.setOnClickListener(this);
         settingExitCurrentAccountLl.setOnClickListener(this);
@@ -248,6 +252,7 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
         root.findViewById(R.id.setting_style_rl).setOnClickListener(this);
         root.findViewById(R.id.setting_sound_rl).setOnClickListener(this);
         root.findViewById(R.id.setting_ip_address_rl).setOnClickListener(this);
+        root.findViewById(R.id.rl_language_settings).setOnClickListener(this);
     }
 
     @Override
@@ -464,6 +469,13 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
                 mFragment = new VersionUpgradeFragment();
                 FragmentUtils.switchFragment(this, mFragment);
                 break;
+            case R.id.rl_language_settings:
+                //跳转到语言和输入法设置页面
+                //Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS);
+                //跳转到语言和地区设置页面
+                Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
+                startActivity(intent);
+                break;
         }
     }
 

+ 2 - 0
app/src/main/java/com/uas/hystorage/fragment/LoginFragment.java

@@ -197,6 +197,7 @@ public class LoginFragment extends BaseFragment implements AdapterView.OnItemSel
         TextView roolLogoTv = root.findViewById(R.id.tv_root_eng_connectserver_fragment);
         String year = DateFormatUtils.getStrDate4Date(new Date(), DateFormatUtils.YEAR);
         roolLogoTv.setText("Copyright @ "+year + " All Rights Reserved");
+
     }
 
     @Override
@@ -405,4 +406,5 @@ public class LoginFragment extends BaseFragment implements AdapterView.OnItemSel
         mActivity.finish();
         return true;
     }
+
 }

+ 1 - 0
app/src/main/java/com/uas/hystorage/fragment/ViewPagerFragment.java

@@ -6,6 +6,7 @@ import android.view.KeyEvent;
 
 import com.uas.hystorage.R;
 import com.uas.hystorage.activity.FunctionActivity;
+import com.uas.hystorage.adapter.MyPagerAdapter;
 
 /**
  * Created by cjh-sail on 2024-01-23

+ 1 - 2
app/src/main/res/layout/activity_index.xml

@@ -316,7 +316,6 @@
                         android:layout_width="0dp"
                         android:layout_weight="1" />
 
-
                 </LinearLayout>
 
                 <TextView
@@ -335,7 +334,7 @@
 
                 <View
                     android:layout_width="match_parent"
-                    android:layout_height="100dp"></View>
+                    android:layout_height="100dp"/>
 
             </LinearLayout>
 

+ 18 - 0
app/src/main/res/layout/fragment_setting.xml

@@ -198,6 +198,24 @@
                         android:visibility="gone" />
                 </RelativeLayout>
 
+                <RelativeLayout
+                    android:visibility="gone"
+                    android:id="@+id/rl_language_settings"
+                    style="@style/SettingListItemStyle">
+
+                    <ImageView
+                        android:id="@+id/iv_language_settings"
+                        style="@style/SettingListImgStyle"
+                        android:layout_alignParentLeft="true"
+                        android:background="@drawable/ic_setting_default" />
+
+                    <TextView
+                        style="@style/SettingListTitleTextStyle"
+                        android:layout_toRightOf="@id/iv_language_settings"
+                        android:text="@string/Language_settings" />
+
+                </RelativeLayout>
+
                 <RelativeLayout
                     android:id="@+id/setting_style_rl"
                     style="@style/SettingListItemStyle"

+ 1 - 1
app/src/main/res/values-en-rUS/strings.xml

@@ -1598,7 +1598,7 @@ Setting description: [Supplier LotNo Collection, Supplier DateCode Collection an
     <string name="Completed">Completed</string>
     <string name="ratio">Scale</string>
     <string name="mould_number">Mold No.</string>
-
+    <string name="Language_settings">Language settings</string>
 
 
 

+ 1 - 1
app/src/main/res/values-vi-rVN/strings.xml

@@ -1596,7 +1596,7 @@ Tài liệu trả lại có thể được đánh dấu để liên kết bộ s
     <string name="Completed">Đã hoàn thành</string>
     <string name="ratio">Tỷ lệ</string>
     <string name="mould_number">Số khuôn</string>
-
+    <string name="Language_settings">Thiết lập ngôn ngữ</string>
 
 
 </resources>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -1713,6 +1713,7 @@
     <string name="Completed">已完工</string>
     <string name="ratio">比例</string>
     <string name="mould_number">模具号</string>
+    <string name="Language_settings">语言设置</string>
 
 
 

+ 2 - 2
build.gradle

@@ -58,8 +58,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 38,
-            versionName      : "v1.2.8"
+            versionCode      : 39,
+            versionName      : "v1.2.9"
     ]
 
     depsVersion = [