Coder Social home page Coder Social logo

xfshapeview's People

Contributors

henningms avatar rmenezes avatar vincentgury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xfshapeview's Issues

Animations

Is it possible to animate drawing the circle ? I want a label and a the outer circle would be animated while drawing (think of a percentage).

Could not load type 'XFShapeView.Droid.ShapeRenderer'

Based on the ReadMe.md there is no call for any Init(); but it seems that there should be one because the mono droid cannot load the 'XFShapeView.Droid.ShapeRenderer', or is there any other cause for this error:

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'XFShapeView.Droid.ShapeRenderer' from assembly 'XFShapeView.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

My Environment is:

  • Compile Using Android Version: "Use Latest Platform(Android 7.0(Nougat))"
  • Minimum Android To Target: "Android 4.0.3(API Level 15-Ice Cream Sandwich)" (Tried with API 16 - Same Results!)
  • Target Android Version: "Android 6.0(API Level 23 - Marshmallow)"
  • Xamarin Forms: 2.3.3.152-pre2

On iOS there is no error but no view either.

My ShapeView Implementation:

 var simpleCircle = new ShapeView()
            {
                ShapeType = ShapeType.Circle,
                HeightRequest = 75,
                MinimumHeightRequest = 50,
                WidthRequest = 75,
                MinimumWidthRequest = 50,
                Color = Color.White,
                BorderColor = Color.White,
                Content = new Label
                {
                    Text = "Dummy Text",
                    TextColor = Color.White,
                    FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)),
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions = LayoutOptions.Center,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment = TextAlignment.Center
                }
            };

BackgroundColor transparent problem with Opacity less than 1

Hello.
I have a complex Path shape to create a "border path" with an empty zone in the middle of the shape.

For example (points):
[0,0]
[100,0]
[100,100]
[0,100]
[0,0]
[10,10]
[10,90]
[90,90]
[90,10]
[10,10]

If I set BackgroundColor = Transparent and Opacity = 0.5 to the ShapeView the background is rendered as Black instead of Transparent.

My workaround is to set Opacity = 1 and change the alpha channel of the Color (fill), for example #aa000000 (for a transparent black), but I think that previous indicated behaviour is an issue.

Progress Circle not rendering in iOS

Here is the xaml I'm using
<xfShapeView:ShapeView ShapeType="ProgressCircle" Opacity=".75" Progress="{Binding UploadProgress}" IsVisible="{Binding ShowProgress}" BorderColor="Transparent" BorderWidth="7" Color="Transparent" ProgressBorderColor="White" ProgressBorderWidth="5" AbsoluteLayout.LayoutBounds=".5,.5,.5,.5" AbsoluteLayout.LayoutFlags="All">

This works great on Android, but nothing renders on iOS (I tried 9.3 and 10).
I'm a missing an Init() call maybe? Didn't notice any special requirements.

iOS : ShapeRenderer.Init() is not exposed

Thanks for awesome plugin to to draw some custom shapes, it is really cool. I have tested on Android, but unable to test it on iOS , because Init function is not available in iOS, I checked the implementation, the function is defined in iOS project as a Static Method, but not available when I try to use it throught Nuget package manager. I will be nice if you could fix this issue. or am I missing some setup?

XAML version

Hi there!

I am trying to get this great package working in my xaml.
I created the control like this:

 <ContentPage  xmlns:shape="clr-namespace:XFShapeView;assembly=XFShapeView">

Then, I create this:

<shape:ShapeView x:Name="shp">
				<shape:ShapeView.Content>
		 <controls:ImageButton x:Name="TwitterButton"
                                  BackgroundColor="#335465"
                                  HeightRequest="75"
								
                                  ImageHeightRequest="50"
                                  ImageWidthRequest="50"
                                  Orientation="ImageOnTop"
                                  Text="Lijst"
                                  TextColor="#ffffff"
				FontFamily="Sansa"

                                >
                <controls:ImageButton.Source>
                 
                            <FileImageSource File="notebook.png" />
                      
                </controls:ImageButton.Source>
            </controls:ImageButton>
					</shape:ShapeView.Content>
	</shape:ShapeView>

But I see my own ImageButton, but not the shape around it. What am I doing wrong?

progress in background color of the shape

Hi friend, how do I make progress not be on the border of the shape if not in the background color?, that if the progress is 50%, just the background color to be half

Sorry for my english

Content Label Text Binding

I tried a few ways to update the Text on the Content, event set Binding to a value and it doesn't update. Am I doing something incorrect or this doesn't work?

iOS throwing exception on Init() method - Unhandled managed exception

Hi there,

Plugin is throwing excpetion when calling the Init() method from the AppDelegate file on app launch - iOS:

2019-09-24 11:07:06.490 MyApp.iOS[588:149395] Unhandled managed exception: Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
  at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00018] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:944 
  at System.Reflection.RuntimeConstructorInfo.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00086] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:926 
  at System.Reflection.RuntimeConstructorInfo.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globali
zation.CultureInfo culture) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:960 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/corefx/src/Common/src/CoreLib/System/Reflection/ConstructorInfo.cs:22 
  at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0003b] in <1b20576ce73640d782f136af13e79af3>:0 
  at ObjCRuntime.Runtime.GetNSObject[T] (System.IntPtr ptr) [0x000d1] in <1b20576ce73640d782f136af13e79af3>:0 
  at UIKit.UIKeyCommand.Create (Foundation.NSString keyCommandInput, UIKit.UIKeyModifierFlags modifierFlags, ObjCRuntime.Selector action) [0x0003b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKeyCommand.g.cs:107 
  at Xamarin.Forms.Platform.iOS.Visual
ElementRenderer`1[TElement]..ctor () [0x00043] in <4e367b2cd46d4a02b980ea2aa2a1115b>:0 
  at XFShapeView.iOS.ShapeRenderer..ctor () [0x00000] in E:\Projets\GitHub\XFShapeView\src\XFShapeView.iOS\ShapeRenderer.cs:41 
  at XFShapeView.iOS.ShapeRenderer.Init () [0x00000] in E:\Projets\GitHub\XFShapeView\src\XFShapeView.iOS\ShapeRenderer.cs:48 
  at MyApp.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x000bd] in C:\Users\Admin\Apps\MyApp\MyApp\MyApp.iOS\AppDelegate.cs:60 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [
0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at MyApp.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\Admin\Apps\MyApp\MyApp\MyApp.iOS\Main.cs:18 
 --- inner exception ---
This API is not supported on this version of iOS (System.PlatformNotSupportedException)
  at UIKit.UIMenuElement..ctor (System.IntPtr handle) [0x00007] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIMenuElement.g.cs:91 
  at UIKit.UICommand..ctor (System.IntPtr handle) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UICommand.g.cs:88 
  at UIKit.UIKeyCommand..ctor (System.IntPtr handle) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKeyCommand.g.cs:91 
  at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,obje
ct,object[],System.Exception&)
  at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936 
Plugin version of Xamarin Forms is: 4.2.0.815419
Plugin version of ShapeView is: 1.0.5

Was previously working prior to this version of XF

Circle in Listview

Hi Guys,
I have a custom Cell for a List view
I have a Circle, but only displays as square, can someone Help?

TIA.

Label  lbl_Init = new Label
            {
                FontAttributes = FontAttributes.Bold,
                FontSize = Device.GetNamedSize(NamedSize.Large,typeof(Label)),
                TextColor=Color.White,
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,
                VerticalTextAlignment = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center,
            };
            lbl_Init.SetBinding(Label.TextProperty, new Binding("FullName", BindingMode.Default, new NameInitConverter(), null));
            sv = new ShapeView {
                ShapeType = ShapeType.Circle,
                Content = lbl_Init,
                HeightRequest = 50,
                WidthRequest = 50,
                BackgroundColor = Color.LightGray
            
            };

ShapeView circle not rendering on iOS Devices (working in emulator)

**Edit - I've actually just confirmed I'm able to see the circle render on physical iOS devices when connected in debug mode, just not when I've installed the adhoc build.

I'm using a shapeview to draw a simple circle in a Xamarin Forms application. It's defined in Xaml and bound to a property in my VM using a value converter (enum -> color). This works fine on android (devices and emulators), and fine in the iOS emulators, but I see nothing on actual iOS devices.

        <shapes:ShapeView x:Name="rarityCircle"
                          HorizontalOptions="End" VerticalOptions="Start" 
                          ShapeType="Circle" 
                          BorderColor="White" BorderWidth="2" 
                          Opacity=".7" 
                          Margin="5" 
                          HeightRequest="20" WidthRequest="20"
                          Color="{Binding Rarity, Converter={StaticResource Key=RarityColor}}}"/>

image

Circles missing on iOS hardware:
image

Xaml usage

Is it possible to use this in Xaml code? I tried but couldn't find the right namespace.

Refresh list not updating Color

I have list with items and in every item I have circle shape with image content:
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" BackgroundColor="White" Orientation="Vertical"> <xfShapeView:ShapeView x:Name="StepOneNumber" ShapeType="Circle" HeightRequest="48" WidthRequest="48" Color="{Binding IconBackgroundColorCode}" VerticalOptions="CenterAndExpand" HorizontalOptions="StartAndExpand" Margin="5, 0, 0, 0"> <xfShapeView:ShapeView.Content> <Image Source="{Binding IconUrl}" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" WidthRequest="32" HeightRequest="32" /> </xfShapeView:ShapeView.Content> </xfShapeView:ShapeView> </StackLayout>

When I change image on server and pull list to refresh it's ok, images are updated, but if I change color on server, color in circle around image doesn't update. Also if I pull list to refresh several times in short period, colors get mess up some times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.