From 43b5ed53583d501f3451a767b6840e7fde7330f6 Mon Sep 17 00:00:00 2001 From: ZHD <123456> Date: Wed, 15 Apr 2020 10:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0gradle=E7=89=88=E6=9C=AC=20?= =?UTF-8?q?=E5=9E=83=E5=9C=BE=E5=88=86=E7=B1=BB=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../community/pocket/data/model/GarbageSorting.java | 10 +++++----- .../ui/garbage/sorting/GarbageSortingFragment.java | 10 +++++++++- app/src/main/res/values-en-rUS/strings.xml | 5 +++++ app/src/main/res/values-zh-rCN/strings.xml | 5 +++++ app/src/main/res/values/strings.xml | 5 +++++ 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c1fefcd..a385347 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,8 +1,8 @@ ext { //本地服务端测试地址,把ip地址部分改成ipconfig /all找到的内网地址 - API_HOST = 'http://192.168.3.132:8080/' + API_HOST = 'http://192.168.101.3:8080/' //本地rap2服务端测试地址,把ip地址部分改成ipconfig /all找到的内网地址 - RAP2_API_HOST = 'http://192.168.3.132:38080/app/mock/1' + RAP2_API_HOST = 'http://192.168.101.3:38080/app/mock/1' } apply plugin: 'com.android.application' apply plugin: 'multi-languages' diff --git a/app/src/main/java/com/community/pocket/data/model/GarbageSorting.java b/app/src/main/java/com/community/pocket/data/model/GarbageSorting.java index bb2fc41..fc37034 100644 --- a/app/src/main/java/com/community/pocket/data/model/GarbageSorting.java +++ b/app/src/main/java/com/community/pocket/data/model/GarbageSorting.java @@ -5,7 +5,7 @@ public class GarbageSorting { //名称 private String name; //分类 - private String sorting; + private Integer category; //垃圾图片 private String image; @@ -17,12 +17,12 @@ public class GarbageSorting { this.name = name; } - public String getSorting() { - return sorting; + public Integer getCategory() { + return category; } - public void setSorting(String sorting) { - this.sorting = sorting; + public void setCategory(Integer category) { + this.category = category; } public String getImage() { diff --git a/app/src/main/java/com/community/pocket/ui/main/ui/garbage/sorting/GarbageSortingFragment.java b/app/src/main/java/com/community/pocket/ui/main/ui/garbage/sorting/GarbageSortingFragment.java index c9b06dc..a7a2b80 100644 --- a/app/src/main/java/com/community/pocket/ui/main/ui/garbage/sorting/GarbageSortingFragment.java +++ b/app/src/main/java/com/community/pocket/ui/main/ui/garbage/sorting/GarbageSortingFragment.java @@ -93,7 +93,15 @@ public class GarbageSortingFragment extends BaseFragment { */ private void initView(GarbageSorting garbageSorting) { name.setText(garbageSorting.getName()); - sorting.setText(garbageSorting.getSorting()); + int resId=R.string.unknow_error; + switch (garbageSorting.getCategory()){ + case 1:resId=R.string.garbage_category_1;break; + case 2:resId=R.string.garbage_category_2;break; + case 4:resId=R.string.garbage_category_4;break; + case 8:resId=R.string.garbage_category_8;break; + case 16:resId=R.string.garbage_category_16;break; + } + sorting.setText(resId); } /** diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml index 1d2a57d..5da6d5f 100644 --- a/app/src/main/res/values-en-rUS/strings.xml +++ b/app/src/main/res/values-en-rUS/strings.xml @@ -178,4 +178,9 @@ connect server ok connect server:%1s fail api error%1s + recoverable + hazardous waste + wet garbage + dry refuse + Bulky Waste \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 08cef4a..df8341d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -178,4 +178,9 @@ 连接服务端成功 调试信息:无法连接到服务端:%1s 非法服务端配置:%1s + 可回收垃圾 + 有害垃圾 + 湿垃圾 + 干垃圾 + 大件垃圾 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6206619..139eb60 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -179,6 +179,11 @@ connect server ok connect server:%1s fail api error%1s + recoverable + hazardous waste + wet garbage + dry refuse + Bulky Waste