Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color binding changes #1225

Merged
merged 3 commits into from
Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Mono.Android/Android.Graphics/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,27 +218,27 @@ private static ArgumentException CreateColorArgumentException (int value, string

public static Color ParseColor (string colorString)
{
return new Color (_Color.ParseColor (colorString));
return new Color (ColorObject.ParseColor (colorString));
}

public static void ColorToHSV (Android.Graphics.Color color, float[] hsv)
{
_Color.ColorToHSV (color, hsv);
ColorObject.ColorToHSV (color, hsv);
}

public static Color HSVToColor (float[] hsv)
{
return new Color (_Color.HSVToColor (hsv));
return new Color (ColorObject.HSVToColor (hsv));
}

public static Color HSVToColor (int alpha, float[] hsv)
{
return new Color (_Color.HSVToColor (alpha, hsv));
return new Color (ColorObject.HSVToColor (alpha, hsv));
}

public static void RGBToHSV (int red, int green, int blue, float[] hsv)
{
_Color.RGBToHSV (red, green, blue, hsv);
ColorObject.RGBToHSV (red, green, blue, hsv);
}
#endregion

Expand Down
11 changes: 1 addition & 10 deletions src/Mono.Android/metadata
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,6 @@
<!-- FIXME: this should be correctly generated by jar2xml -->
<remove-node api-since="11" path="/api/package[@name='android.animation']/class[@name='ValueAnimator']/method[@name='getInterpolator']" />

<attr path="/api/package[@name='android.graphics']/class[@name='Color']" name="managedName">_Color</attr>
<attr path="/api/package[@name='android.graphics']/class[@name='Color']" name="visibility">internal</attr>

<!-- removed to workaround generator issue regarding non-generic type overriding generic type (FIXME: remove them) -->
<remove-node api-since="11" path="/api/package[@name='android.widget']/class[@name='AdapterViewAnimator']/method[@name='getAdapter']" />
<remove-node api-since="11" path="/api/package[@name='android.widget']/class[@name='AdapterViewAnimator']/method[@name='setAdapter']" />
Expand Down Expand Up @@ -1390,16 +1387,10 @@

We will have to enable this line and bring back some sanity.
-->
<!-- attr path="/api/package[@name='android.graphics']/class[@name='Color']" name="managedName">AndroidColor</attr -->
<attr path="/api/package[@name='android.graphics']/class[@name='Color']" name="managedName">ColorObject</attr>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ColorObject and not AndroidColor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am 100% sure that people try to look up "Color" something. AndroidColor will never give that impression to developers.


<!-- API Level 27 -->

<!-- android.graphics.Color started to be in actual use and that uncovered
Xamarin.Android design mistake above! We have to remove WallpaperColors API
until Xamarin.Android fixes their bogus API design. -->
<remove-node path="/api/package[@name='android.app']/class[@name='WallpaperColors']" />


<!-- detected field-property conflicts (e.g. see bug #60069)

Some people think it's easy to implement "check and skip property generation" without trying to do,
Expand Down