Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The Android.Grahpics.Paint.Color property is an `int`. It should be a Android.Graphics.Color, so that you can do sane things like:
Paint p = GetSomePaint();
p.Color = Color.Black;
p.Color = Color.Black.ToArgb ();
See also: http://docs.mono-android.net/index.aspx?link=P%3aAndroid.Graphics.Paint.Color
Fixed in commit 60346ad8, and should be part of the final 4.2.0 release.
This changes the public members:
I don't see any other 'getColor' or 'setColor' methods within API 15.
This doesn't change any method overloads, though a quick look at the API 15 XML description suggests that there are 32 methods that take a `int color` parameter that should either be replaced with a Color variant over overloaded with a Color version.
Constructor and method parameters which represent "Color" parameters are fixed in commit 1f2b952e. A parameter is considered to be a "color" parameter if it's of type `int` and it has one of the following names:
For example, this changes the `ColorDrawable(int)` constructor to `ColorDrawable(Color)`, which is much saner.
Is this really the right thing to do on a Paint? Often Paint color properties are set inside of a call to onDraw, and allocating a new Color object seems unnecessarily costly.
Android.Graphics.Color is a struct. Allocations are cheap, and have no GREF or GC implications (unless boxed, and there's still no GREF implications).
(This is one of the rare deviations from the Java API that we expose; Android/Java uses `int` for Color instances, and we replaced most of the `int`s with the `Android.Graphics.Color` struct.)
Great, thanks for the clarification.
I have checked this issue on following builds:
Mac OS X 10.9.2
Xamarin Studio : 4.2.3 (build 60)
Xamarin.Android : 4.13.0 (Enterprise Edition)
This issue is working fine. Hence, I am closing this issue.