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

Colorpicker #20

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

nguyenhAtMsg
Copy link

[WORK IN PROGRESS!]

Hello Javier,

This is my first feature in Xamarin and it's still in progress. I create the pull request in order to get feedback from others to improve.

Thanks in Advance.

* ColorNumberConverter.cs:
* ColorPicker.cs:

* ColorPicker.xaml: [feature] Ändern der Farben über Textfelder
* ColorPicker.xaml:
* RoundEffect.cs:
* RoundEffect.cs:
* ColorPicker.cs:
* RadialPicker.cs:
* ColorPickerGallery.xaml:
* GradientLayout.cs:
* RoundEffect.cs:
* TemplateUI.Gallery.iOS.csproj:
* RadialPickerRenderer.cs:
* GradientLayoutRenderer.cs:
* TemplateUI.Gallery.Android.csproj:
* GradientLayoutRenderer.cs:
* OpacityGradientLayoutRenderer.cs:
* CornerRadiusOutlineProvider.cs:
* OpacityGradientLayoutRenderer.cs:

* ColorNumberHelper.cs: [feature] radial color picker [work in
  progress]
[feature] Luminosity thumb changes
@jsuarezruiz
Copy link
Owner

@nguyenhAtMsg Awesome, will review it!

Copy link
Owner

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

This is a fantastic job. With a few changes I think we can add a great new control. Let me know if I can help you with something.

ColorPicker

// @author: https://stackoverflow.com/users/9654227/na2axl
namespace TemplateUI.Gallery.Droid.Renderers
{
public class GradientLayoutRenderer : VisualElementRenderer<AbsoluteLayout>
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need this rendererer? Using Xamarin.Forms Brushes we would also support other platforms such as macOS.

int endX;
int endY;

switch (this.gradientLayout.Mode)
Copy link
Owner

Choose a reason for hiding this comment

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

In case we need this, we could move this code to extension methods. Pass a Color collection and return the LinearGradient to draw.

@@ -51,6 +50,9 @@
<Reference Include="System.Xml" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
<Reference Include="Xamarin.iOS">
Copy link
Owner

Choose a reason for hiding this comment

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

Xamarin.iOS reference in the Android sample?

* LAYER 1: MaskLayer
* LAYER 2: GradientLayer
*/
if (NativeView.Layer.Sublayers.Length == 1)
Copy link
Owner

Choose a reason for hiding this comment

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

The Sublayers could be null at this point.

@@ -61,6 +61,7 @@ void LoadData()
new GalleryItem { Title = "ChatBubble", SubTitle = "Allow to show a speech bubble message.", Icon = "chatbubble.png", Color = Color.DarkSeaGreen },
new GalleryItem { Title = "CircularLayout", SubTitle = "Is a simple Layout derivative that lays out its children in a circular arrangement.", Icon = "circularlayout.png", Color = Color.BlueViolet },
//new GalleryItem { Title = "CircleProgressBar", SubTitle = "Shows a control that indicates the progress percentage of an on-going operation by circular shape.", Icon = "circleprogressbar.png", Color = Color.LightGray, Status = GalleryItemStatus.InProgress },
new GalleryItem { Title = "ColorPicker", SubTitle = "Picker for choosing Color.", Icon = "circularlayout.png", Color = Color.Red},
Copy link
Owner

Choose a reason for hiding this comment

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

Could we include a new specific icon?

<ContentPage
Title="Avatar Size"
IconImageSource="customize.png">
<!--<ContentPage.Content>
Copy link
Owner

Choose a reason for hiding this comment

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

This tabs do not seem necessary, better remove to avoid confusions.

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Owner

Choose a reason for hiding this comment

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

There are some binding issues in the Template:

Binding: 'B' property not found on '[Color: A=1, R=0.104443669319153, G=0.408039718866348, B=0.65434455871582, Hue=0.574651300907135, Saturation=0.724709272384644, Luminosity=0.379394114017487]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'G' property not found on '[Color: A=1, R=0.105486810207367, G=0.405179709196091, B=0.648317933082581, Hue=0.574651300907135, Saturation=0.720121681690216, Luminosity=0.376902371644974]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'B' property not found on '[Color: A=1, R=0.105486810207367, G=0.405179709196091, B=0.648317933082581, Hue=0.574651300907135, Saturation=0.720121681690216, Luminosity=0.376902371644974]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'G' property not found on '[Color: A=1, R=0.105543076992035, G=0.400331497192383, B=0.639490783214569, Hue=0.574651300907135, Saturation=0.716675817966461, Luminosity=0.372516930103302]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'B' property not found on '[Color: A=1, R=0.105543076992035, G=0.400331497192383, B=0.639490783214569, Hue=0.574651300907135, Saturation=0.716675817966461, Luminosity=0.372516930103302]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'Luminosity' property not found on '[Color: A=1, R=0.105543076992035, G=0.400331497192383, B=0.639490783214569, Hue=0.574651300907135, Saturation=0.716675817966461, Luminosity=0.372516930103302]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'Saturation' property not found on '[Color: A=1, R=0.106933355331421, G=0.401164650917053, B=0.639871954917908, Hue=0.574651300907135, Saturation=0.713624477386475, Luminosity=0.373402655124664]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'G' property not found on '[Color: A=1, R=0.105764865875244, G=0.396856516599655, B=0.633016645908356, Hue=0.574651300907135, Saturation=0.713677525520325, Luminosity=0.3693907558918]', target property: 'Xamarin.Forms.Entry.Text'
Binding: 'B' property not found on '[Color: A=1, R=0.105764865875244, G=0.396856516599655, B=0.633016645908356, Hue=0.574651300907135, Saturation=0.713677525520325, Luminosity=0.3693907558918]', target property: 'Xamarin.Forms.Entry.Text'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants