public class Vector3 {
private final int x;
private final int y;
private final int z;
public Vector3(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZ() {
return z;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Vector3 vector3 = (Vector3) o;
return x == vector3.getX() &&
y == vector3.getY() &&
z == vector3.getZ();
}
@Override
public int hashCode() {
return Objects.hash(x, y, z);
}
}
mButton.setBackgroundTintList(getContext().getResources().getColorStateList(R.color.your_xml_name));
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:color="#000" />
</selector>