fixing bad color

This commit is contained in:
Connor Tumbleson 2012-08-24 20:03:05 -05:00
parent 026b394db4
commit 5c31f4de8e
2 changed files with 3 additions and 9 deletions

View File

@ -16,22 +16,16 @@
package brut.androlib.res.data.value;
import android.util.TypedValue;
/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
*/
public class ResColorValue extends ResIntValue {
private int type;
public ResColorValue(int value, String rawValue, int type) {
public ResColorValue(int value, String rawValue) {
super(value, rawValue, "color");
this.type = type;
}
@Override
protected String encodeAsResXml() {
return TypedValue.coerceToString(type, mValue);
return String.format("#%08x", mValue);
}
}

View File

@ -52,7 +52,7 @@ public class ResValueFactory {
if (type >= TypedValue.TYPE_FIRST_COLOR_INT
&& type <= TypedValue.TYPE_LAST_COLOR_INT) {
return new ResColorValue(value, rawValue, type);
return new ResColorValue(value, rawValue);
}
if (type >= TypedValue.TYPE_FIRST_INT
&& type <= TypedValue.TYPE_LAST_INT) {