Fix 6-digit display of RGB value

This commit is contained in:
sonora 2015-06-17 02:01:17 +02:00
parent 9bbba8862e
commit a06ce588fc
2 changed files with 4 additions and 2 deletions

View file

@ -98,7 +98,9 @@ public class ColorDialogs {
if ((0xFF000000 & color) == 0xFF000000) {
return "#" + Integer.toHexString(color & 0x00FFFFFF); //$NON-NLS-1$
} else {
return "#" + Integer.toHexString(color); //$NON-NLS-1$
private final static String ZEROES = "000000";
String c = Integer.toHexString(color);
return "#" + c.length() <= 6 ? ZEROES.substring(c.length()) + c : c; //$NON-NLS-1$
}
}
}

View file

@ -271,7 +271,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
final TIntArrayList list = new TIntArrayList();
final Spinner colorSpinner = (Spinner) view.findViewById(R.id.ColorSpinner);
ColorDialogs.setupColorSpinner(getActivity(), getGpx().getColor(), colorSpinner, list);
ColorDialogs.setupColorSpinner(getActivity(), getGpx().getColor(0), colorSpinner, list);
final Spinner sp = (Spinner) view.findViewById(R.id.Spinner);