StatusEnum.java 682 B

12345678910111213141516171819202122232425262728
  1. package com.qy.agv.activity.appEnum;
  2. import android.graphics.Color;
  3. import com.qy.agv.activity.adapter.HomeListViewAdapter;
  4. public enum StatusEnum {
  5. STATUS_1(Color.BLUE, "就绪"),
  6. STATUS_2(Color.GREEN, "执行中"),
  7. STATUS_3(Color.YELLOW, "已完成"),
  8. STATUS_4(Color.RED, "异常中"),
  9. STATUS_5(Color.BLACK, "已取消");
  10. private final Integer color;
  11. private final String text;
  12. public String getText() {
  13. return text;
  14. }
  15. StatusEnum(Integer color, String text) {
  16. this.color = color;
  17. this.text = text;
  18. }
  19. public static StatusEnum filter(int code){
  20. return StatusEnum.valueOf("STATUS_"+code);
  21. }
  22. }