clarify enum and flag

This commit is contained in:
REAndroid 2023-01-03 05:03:34 -05:00
parent 6ed3de8991
commit ea83939f03
2 changed files with 5 additions and 4 deletions

View File

@ -240,4 +240,7 @@ public class AttributeBag {
AttributeBagItem[] bagItems=AttributeBagItem.create(resValueBag.getBagItems()); AttributeBagItem[] bagItems=AttributeBagItem.create(resValueBag.getBagItems());
return bagItems!=null; return bagItems!=null;
} }
public static final short TYPE_ENUM = 0x0001;
public static final short TYPE_FLAG = 0x0002;
} }

View File

@ -107,8 +107,7 @@ public class AttributeBagItem {
return false; return false;
} }
ResValueBagItem item=getBagItem(); ResValueBagItem item=getBagItem();
short low=item.getDataHigh(); return item.getDataHigh()==AttributeBag.TYPE_ENUM;
return low==0x0001;
} }
public boolean isFlag(){ public boolean isFlag(){
AttributeItemType type=getItemType(); AttributeItemType type=getItemType();
@ -116,8 +115,7 @@ public class AttributeBagItem {
return false; return false;
} }
ResValueBagItem item=getBagItem(); ResValueBagItem item=getBagItem();
short low=item.getDataHigh(); return item.getDataHigh()==AttributeBag.TYPE_FLAG;
return low==0x0002;
} }
@Override @Override
public String toString(){ public String toString(){