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