Git Product home page Git Product logo

xamarin.plugins's People

Contributors

andooown avatar jsmarcus avatar kvpt 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xamarin.plugins's Issues

IconToolbarItem/FreshMVVM Dilema

I've been attempting to get IconToolbarItem to play nicely with FreshMVVM.. When run on iOS (Xamarin Forms), I am getting the following exception

Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.

It appears the instance of IconToolbarItem is interpreting the Icon property ("fa-refresh" in this case) as a file name. I'm fairly certain that this issue is caused by the fact that FreshMVVM is internally creating and utilizing NavagationPage pages instead of IconNavigationPage. All of the other Iconize views are working normally, so it is not a configuration issue.

While this is not strictly an issue with IconToolbarItem, it is a nasty roadblock preventing one from using these two superb libraries together. I'm hoping the contributors here, have a suggestion for how I might best proceed with getting this to work.

IconTabbedPage IOS crash

I try to use IconTabbedPage on IOS but I have this error:

Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.

It works great on Android.
If I remove the "Icon" property from my childrens pages it works.
Any idea?

This is so awesome!

I know the issues page isn't really for this, but since private messages aren't a feature anymore...

I just wanted to tell you: You rock! I'm new to Xamarin development, and maintaining bitmaps for all those resolutions would have been a nightmare! So glad I found your project - keep up the good work!

Thanks,
Philipp

Resource.Id does not contain a definition for tabs

Great plugin, loving it!

In the getting started guide, it says to add this line in Android:

        FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.tabs);

I'm on the latest version of Xamarin / Xamarin.Forms, and it's complaining that there's no definition for tabs. I've run it without providing a value and it is working fine (just using icon labels).

throw ArgumentNullException on UIApplication.Main (args, null, "AppDelegate")

throw ArgumentNullException on UIApplication.Main (args, null, "AppDelegate");
when adding FormsPlugin.Iconize.iOS.IconControls.Init() to AppDelegate

Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.MaterialModule());
global::Xamarin.Forms.Forms.Init();
FormsPlugin.Iconize.iOS.IconControls.Init();
LoadApplication(new App());

Documentation

Would really appreciate a more detailed documentation. Ive seen other people comments asking. Looks awesome but not easy to use...

TabbedPage and ToolbarItems not working together

When i use a tabbed page the IconToolbarItems are not showing any icons.
After reading on another issue, i changed my page to IconTabbedPage and i encountered another problem.
While the IconToolbarItems are working just fine the childern Pages have to have an icon or an exception is thrown in line 44 of the IconTabbedPageRenderer on Android.
I am building a tabbed page without icons just text on the tabs, while using IconToolbarItems.

IconToolbarItems's icons replaced by text when Text binding of any item changes

I have a Toolbar with a few IconToolbarItems, some of them displaying Icons via the Icon property, some displaying Text using the Text property. The Toolbar is part of a IconCarouselPage.
I noticed the following bug:
When the Text property of an icon displaying Text is changed, all other, unrelated IconToolbarItem's icons vanish and only reappear, as soon as there is some major "change" like pushing a new Page or swiping left and right.

Method CGSize..ctor not found, XamarinForms 1.0.6

Thanks for a great plugin. I just updated my packages and now my Forms project won't run (it builds fine though).

Exception, when loading the first tabbed view, is: Method 'CGSize..ctor' not found.

I can add a stacktrace if that will help. Let me know.

Forms-project:
Xam.FormsPlugin.Iconize 1.0.6
Xam.Plugin.Iconize 1.0.6
Xamarin.Forms 2.2.0.31

iOS-project:
Xam.FormsPlugin.Iconize 1.0.6
Xam.Plugin.Iconize 1.0.6
Xamarin.Forms 2.2.0.31
Xam.Plugin.Iconize.FontAwesome 1.0.6

xaml example: <iconize:IconImage Icon="fa-heart-o" IconColor="#555555" />

IconButton shows horizontal bar under each icon for iOS 10.1.1

Hi,

Right after I upgraded my iPhone to iOS 10.1.1 (14B150) my app started showing icons for IconButton with a horizontal bar right below them.
It looks as if each icon would be underlined.

IconImages, IconLabels are not affected. Also Material icons are not affected even for IconButtons.

I confirmed that the Iconize Samples solution has this issue as well.

However, if I run on the simulator, the problem does not show - iOS 10.1(14B72)

Thanks!!

Hector

Fonts are not working on UWP App..

Created a very simple app but the icons are not working on windows app. I used your Page1.xaml and App.xaml.cs and the project compiles fine without errors but only shows [] where the icons should be. It runs fine on Android. I must be missing something...

Thanks in advance.
capture

unable to install

Could not install package 'Xam.Plugin.Iconize.FontAwesome 1.0.10'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I am getting the above error if I try to install, could you please help me

How to use IconToolbarItem?

Hi,

really love your work, makes scaling icons very easy in xamarin forms. Is there a sample available for IconToolbarItem? I cant manage to make it work.

Thanks :)

👍

Still problem with IconButton

I decided to report the problem again because my previous issue was closed without a right response

Answered:

I am planning on getting some documentation together but it's basically a port of Iconify. So to add an icon (or more than one) you just put it in the text. Ex: "{fa-500px} 500px"

I appreciate that but unfortunately didn't work :(

Tested and failed

I tried that one and others combinations several times without success;

iconize:IconButton Text="{fa-500px} 500px" 

above code throw this: System.Exception: Expression must end with '}'

this code doesn't fail at compile time but just print: {fa-500px} 500px and desired is to replace {fa-500px} for font icon:

iconize:IconButton Text="{}{fa-500px} 500px" 
iconize:IconButton Text="{Binding Key, StringFormat='{}{{{0}}} {0}'}" 
iconize:IconButton Text="{Binding Key, StringFormat='{{{0}}} {0}'}" 

Tried to pass text from ViewModel fail too:

xaml:

iconize:IconButton  Text="{Binding TestIcon}" 

ViewModel:
TestIcon = "{fa-500px} fa-500px";

Doesn't seem to Work on Android with Xamarin Forms new Themes (Preview I know)

I've been creating a new Xamarin Forms app and have been using iconize. I am also using the new Xamarin Themes. This has worked without issue on the IOS device but I cannot get it running on Android.

The first error I got was You need to use a Theme.AppCompat theme (or descendant) with this activity So I added Theme = "@style/Theme.AppCompat" to the activity but then got this error instead :
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

There were no issues with the Theme on IOS, I am aware that I am using a preview of the Themes but thought you'd like a heads up on the issues I'm having with this on Droid.

My Droid Project Targets Minimum API 19, compiles against API 23 (Tried it 23 & 23 too)

reproducible Infinite Loop - ListView / IconLabelRenderer combination at UpdateLayout

Error located in source
Edit 4: Added 'Error located in source'

@jsmarcus I think I've located the actual source of the error. In your IconLabelRender.cs you hook onto the OnTextChanged Event in the OnElementChanged eventhandler with the followin code.

        /// <summary>
        /// Raises the <see cref="E:ElementChanged" /> event.
        /// </summary>
        /// <param name="e">The <see cref="ElementChangedEventArgs{Label}" /> instance containing the event data.</param>
        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);

            if (Control == null || Element == null)
                return;

            UpdateText();
            Control.TextChanged += OnTextChanged;
        }

         /// <summary>
        /// Updates the text.
        /// </summary>
        private void UpdateText()
        {
            Control.TextChanged -= OnTextChanged;

            var icon = Plugin.Iconize.Iconize.FindIconForKey(Element.Text);
            if (icon != null)
            {
                Control.Text = $"{icon.Character}";
                Control.Typeface = Plugin.Iconize.Iconize.FindModuleOf(icon).ToTypeface(Context);
            }

            Control.TextChanged += OnTextChanged;
        }

You correctly unsubscribe the event Control.TextChanged -= OnTextChanged; before you update the text, but afterwards you add it twice, once at the end of your UpdateText() method, and once right after in the OnElementChanged(...) method. This means that next time you do a UpdateText you have one too many event handlers subscribed and it will create a infinite loop, when the text is updated.

I would normally make a pull request, but it seems your build is failing, so I'd rather not mess with it.

Original Post
I've encountered what seems like an infinite or near infinite loop, that happens in one of my views with a listview and some IsVisible hide/show logic. It only happens when i have initialized iconize in MainActivity.cs. Removing the inits makes the view run just fine.

Removing the ListView also stops the problem.

I've reproduced the issue in a selfcontained view.

Edit1: Spelling.
Edit2: Added reproducible page / setup.
Edit3: Fixed code markup.

MainActivity.cs

using System;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace EmployeeApp.Droid
{
    [Activity(Label = "EmployeeApp", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
    {
        private readonly bool EnableIconize = true;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            //Android Setup
            ActionBar.SetIcon(Android.Resource.Color.Transparent);
            //Init Plugins
            PluginInit();
            //Init Forms
            FormsInit(bundle);
            try
            {
                LoadApplication(new EmployeeApp.App());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                System.Diagnostics.Debugger.Break();
            }
        }

        private void FormsInit(Bundle bundle)
        {
            global::Xamarin.Forms.Forms.Init(this, bundle);

            if (EnableIconize)
                FormsPlugin.Iconize.Droid.IconControls.Init();
        }

        private void PluginInit()
        {
            if (EnableIconize)
                Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule());
        }
    }
}

IconizeInfiniteReproduction.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="EmployeeApp.Content.Components.Stock.IconizeInfiniteReproduction">
  <StackLayout>
    <!--<Switch IsToggled="{Binding ShowSearchResults}"></Switch>-->
    <SearchBar x:Name="searchBar" Placeholder="Find råvare" Text="{Binding SearchText}" TextChanged="SearchTextChanged" IsFocused="{Binding ShowSearchResults}" />
    <ListView IsVisible="{Binding ShowSearchResults}" ItemsSource="{Binding SearchResults}" ItemTapped="SearchSelectIngredient">
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
            <Label FontSize="14" Text="{Binding Name}" />
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>


  <ScrollView IsVisible="{Binding HidePageContent}">
    <StackLayout>
      <Label Text="{Binding SelectedSearch.Name}"></Label>
    </StackLayout>
  </ScrollView>
  </StackLayout>
</ContentPage>

IconizeInfiniteReproduction.xaml.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace EmployeeApp.Content.Components.Stock
{
    public partial class IconizeInfiniteReproduction : ContentPage
    {
        private IconizeInfiniteReproductionViewModel _Model
        {
            get
            {
                return BindingContext as IconizeInfiniteReproductionViewModel;
            }
            set
            {
                BindingContext = value;
            }
        }

        private List<IconizeInfiniteReproductionSearchViewModel> ServiceDataEmulator { get; set; }
        public IconizeInfiniteReproduction ()
        {
            InitializeComponent();
            ServiceDataEmulator = new List<IconizeInfiniteReproductionSearchViewModel>()
            {
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random0" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random1" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random2" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random3" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random4" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random5" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random6" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random7" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random8" },
                new IconizeInfiniteReproductionSearchViewModel() {Name = "Random9" },
            };
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            Initialize();
        }

        private void Initialize()
        {
            _Model = new IconizeInfiniteReproductionViewModel();
            _Model.SelectedSearch = ServiceDataEmulator.First();
        }

        public void SearchTextChanged(object sender, TextChangedEventArgs e)
        {
            var search = e.NewTextValue.ToLower();
            if (string.IsNullOrEmpty(search))
            {
                _Model.SearchResults = new List<IconizeInfiniteReproductionSearchViewModel>();
            }
            else
            {
                var searchPool = ServiceDataEmulator;
                var results = searchPool.Where(x => x.Name.ToLower().Contains(search)).OrderBy(x => x.Name.ToLower().StartsWith(search));
                _Model.SearchResults = results.ToList();
            }
        }

        public void SearchSelectIngredient(object sender, ItemTappedEventArgs e)
        {
            var selected = e.Item as IconizeInfiniteReproductionSearchViewModel;
            if (selected == null)
                return;

            _Model.SelectedSearch = selected;
            _Model.SearchText = string.Empty;
            searchBar.Unfocus();
        }
    }

    public class IconizeInfiniteReproductionViewModel : PropertyChangedBase
    {
        public IconizeInfiniteReproductionViewModel()
        {
            SearchResults = new List<IconizeInfiniteReproductionSearchViewModel>();
        }

        private IconizeInfiniteReproductionSearchViewModel _SelectedSearch;
        public IconizeInfiniteReproductionSearchViewModel SelectedSearch
        {
            get { return _SelectedSearch; }
            set
            {
                SetField(ref _SelectedSearch, value, nameof(SelectedSearch));
            }
        }

        #region [//--- Search ---//]

        private string _SearchText;
        public string SearchText
        {
            get { return _SearchText; }
            set
            {
                SetField(ref _SearchText, value, nameof(SearchText));
            }
        }

        private bool _ShowSearchResults;
        public bool ShowSearchResults
        {
            get { return _ShowSearchResults; }
            set
            {
                SetField(ref _ShowSearchResults, value, nameof(ShowSearchResults));
                OnPropertyChanged(nameof(HidePageContent));
            }
        }

        public bool HidePageContent
        {
            get { return !ShowSearchResults; } // comment to Change
        }

        public List<IconizeInfiniteReproductionSearchViewModel> _SearchResults;
        public List<IconizeInfiniteReproductionSearchViewModel> SearchResults
        {
            get { return _SearchResults; }
            set { SetField(ref _SearchResults, value, nameof(SearchResults)); }
        }
        #endregion [//--- Search END ---//]
    }

    public class IconizeInfiniteReproductionSearchViewModel 
    {
        public string Name { get; set; }
    }

    public class PropertyChangedBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPropertyChanged(string propertyName)
        {
            //Debug.WriteLine($"PropertyChanged: {propertyName}");
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        protected INotifier SetField<T>(ref T field, T value, string propertyName)
        {
            //Debug.WriteLine($"{this.GetType().Name}#{this.GetHashCode()}.{propertyName} <- {value} (was {field}) - {(EqualityComparer<T>.Default.Equals(field, value) ? "" : "not ")} swallowed");



            field = value;

            OnPropertyChanged(propertyName);
            return new ChangeNotifier(OnPropertyChanged);
        }


        protected INotifier SetProperty<T>(Func<T> getProperty, Action<T> setProperty, T value, string propertyName)
        {


            setProperty(value);

            OnPropertyChanged(propertyName);
            return new ChangeNotifier(OnPropertyChanged);
        }

    }
    public interface INotifier
    {
        INotifier Notify(params string[] propertyNames);

        INotifier OnChange(Action action);
    }
    public class NoChangeNotifier : INotifier
    {
        public INotifier OnChange(Action action)
        {
            return this;
        }

        public INotifier Notify(params string[] propertyNames)
        {
            return this;
        }
    }

    public class ChangeNotifier : INotifier
    {
        private Action<string> _NotifyAction { get; }

        public ChangeNotifier(Action<string> notifyAction)
        {
            _NotifyAction = notifyAction;
        }

        public INotifier Notify(params string[] propertyNames)
        {
            foreach (var propertyName in propertyNames)
                _NotifyAction(propertyName);

            return this;
        }

        public INotifier OnChange(Action action)
        {
            action();
            return this;
        }
    }
}

Stacktrace:

    [External Code] 
>   0xB in Android.Runtime.JNIEnv.DeleteLocalRef at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:713,4   C#
    0x3A in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2789,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x46 in FormsPlugin.Iconize.Droid.IconLabelRenderer.UpdateText at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:88,17   C#
    0x1 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnTextChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:75,13 C#
    0x1E in Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91,5  C#
    0x18 in Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Text.ITextWatcher.cs:166,4 C#
    0x2F in Android.Widget.TextView.set_TextFormatted at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2787,6 C#
    0x15 in Android.Widget.TextView.set_Text at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:2798,5  C#
    0x98 in Xamarin.Forms.Platform.Android.LabelRenderer.UpdateText at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\LabelRenderer.cs:203,5  C#
    0x64 in Xamarin.Forms.Platform.Android.LabelRenderer.OnElementChanged at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\LabelRenderer.cs:89,5 C#
    0x2 in FormsPlugin.Iconize.Droid.IconLabelRenderer.OnElementChanged at D:\Projects\GitHub\Xamarin.Plugins\Iconize\FormsPlugin.Iconize.Droid\IconLabelRenderer.cs:38,13  C#
    0xFC in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Label>.SetElement at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:192,4   C#
    0x2E in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Label>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128,4 C#
    0x3C in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:79,5   C#
    0x116 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:204,6   C#
    0xD in Xamarin.Forms.Platform.Android.VisualElementPackager.<.ctor>b__6_0 at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:29,50  C#
    0x2E in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.OnElementChanged at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:282,5  C#
    0xFC in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.SetElement at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:192,4    C#
    0x2E in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128,4  C#
    0x9A in Xamarin.Forms.Platform.Android.ViewCellRenderer.ViewCellContainer.Update at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\ViewCellRenderer.cs:101,6  C#
    0x13 in Xamarin.Forms.Platform.Android.ViewCellRenderer.GetCellCore at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\ViewCellRenderer.cs:17,5    C#
    0x5D in Xamarin.Forms.Platform.Android.CellRenderer.GetCell at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\CellRenderer.cs:46,4    C#
    0x28 in Xamarin.Forms.Platform.Android.CellFactory.GetCell at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\CellFactory.cs:19,4  C#
    0x202 in Xamarin.Forms.Platform.Android.ListViewAdapter.GetView at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:253,4    C#
    0x1E in Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.BaseAdapter.cs:443,4   C#
    0x66 in Android.Views.ViewGroup.Layout at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3188,5    C#
    0x63 in Xamarin.Forms.Platform.Android.ViewRenderer<Xamarin.Forms.ListView,Android.Widget.ListView>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\ViewRenderer.cs:123,4    C#
    0x8 in Xamarin.Forms.Platform.Android.ListViewRenderer.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\ListViewRenderer.cs:165,4   C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.ListView>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5  C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5  C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5    C#
    0x8 in Xamarin.Forms.Platform.Android.NavigationRenderer.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:103,4   C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5 C#
    0xA7 in Xamarin.Forms.Platform.Android.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:1007,5    C#
    0x20 in Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:73,4 C#
    0x12 in Android.Views.ViewGroup.n_OnLayout_ZIIII at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3427,4  C#

Do I have to use FormsAppCompatActivity or can I use FormsApplicationActivity

trying to use in my Xamarin forms App, My app uses Xamarim.Forms.Themes so I was wanting to use FormsApplicationActivity but when I do I get System.InvalidCastException: Specified cast is not valid.. The exception comes from at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SetupToolbar () [0x00007] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:553
I have not been able to upgrade to the latest version yet as some of the libraries I use are ready for standard library.

So my question is can I use FormsApplicationActivity ok with Iconize. The issue only occurs in the Android version of the App, the IOS version seems fine.

Thanks ASh.

Setting BackgroundColor for IconButton not working

Setting the BackgroundColor or the BorderColor for an IconButton does not work for me.

  public App()
        {
            var tabbedPage = new TabbedPage();

            tabbedPage.Children.Add(new ContentPage {
                Title = "Controls",
                Content = new StackLayout {
                    Children = {
                        new IconButton() { 
                            Text = Iconize.Modules.First().Keys.First(),
                            BackgroundColor = Color.Red, // not working?
                            BorderColor = Color.Green, // not working?
                        }
                    }
                }
            });

            MainPage = tabbedPage;
        }
    }

Spin/animation support

Hi I'm using Xamarin.iOS and would like to see Spin/animation support if possible.

I get the following exception:

Unknown expression spin in "{fa-refresh spin}"

System.InvalidCastException: Specified cast is not valid.

Hi
Everything works fine in my project except when I try and set an IconNavigationPage to MainPage of my app.cs, which gives the error System.InvalidCastException: Specified cast is not valid. The exception gets thrown in the Droid MainActivity.cs at LoadApplication (new App());

It works fine using a normal NavigationPage (without the toolbaritems obviously...).

Any suggestions greatly appreciated!
Thanks

IconToolbarItem with AwesomeFont

How can I show an AwesomeFont-Icon on the ToolbarItem?

I checked out your sample, but it doesn't show me a ToolBarItem.

<ContentPage.ToolbarItems> <iconize:IconToolbarItem Icon="fa-500px" /> <iconize:IconToolbarItem Icon="fa-500px" IconColor="Red" /> </ContentPage.ToolbarItems>

or with my example nothing is displayed

var nav = new NavigationPage( new ContentPage { Content = new IconLabel { Text = "{fa-500px}" }, ToolbarItems = { new IconToolbarItem { Icon = "{fa-500px}", IconColor = Color.Aqua, } } } ); MainPage = nav;

Can you help me to solve my problem?

IconToolbarItem not displaying

In my project I have IconButtons working but the IconToolbarItem is not displaying:

<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
		xmlns:local="clr-namespace:icon_test" x:Class="icon_test.icon_testPage"
		xmlns:iconize="clr-namespace:FormsPlugin.Iconize;assembly=FormsPlugin.Iconize">
	<ContentPage.ToolbarItems>
    	<iconize:IconToolbarItem Icon="ion-plus-circled" />
  	</ContentPage.ToolbarItems>
	<Label Text="Welcome to Xamarin Forms!" VerticalOptions="Center" HorizontalOptions="Center" />
	<iconize:IconButton FontSize="20" Text="ion-plus-circled" WidthRequest="48" />
</ContentPage>

This was done using the Xamarin Forms template in Xamarin Studio, nothing else was added to the project aside from the code needed to bootstrap iconize. Thanks!

Could not load image named: {0}: fa-users in IconToolbarItem

I got the error Could not load image named: {0}: fa-users in IconToolbarItem.

The snippet is as follows:

    <ContentPage.ToolbarItems>
        <iconize:IconToolbarItem Icon="fa-users" />
    </ContentPage.ToolbarItems>

Using the icon in IconLabel works fine. So, my guess is this might be a bug in this plugin. Could you please help?

iconize:IconButton doesn't work

I tried to use the iconize:IconButton but didn't find any sample so I looked at the code and I don't see anything added to the regular Button. I checked the Mateial version: <mi:IconButton Icon="ic_check_circle" and think the iconize one should have the same binding property ?

great work, thanks.

Provide iOS icon set

Would be very interesting provide specific icon set for iOS platform, even that Android and Windows Phone share the same icon set, iOS has very different icons UI, because of this justify this isolated the iOS platform.

Support for FontAwesome 4.7

I've noticed that FontAwesome 4.7 didn't have any references/mapping in the FontAwesome collection.
This weekend I hope I could make a PR for it, so we could have FA4.7 :)

Btw love this plugin!

Update docs for Xamarin.Forms

Using Xamarin.Forms 2.3.0.107

The documentation calls for

Initialize any number of modules in Application.OnCreate().

However, I could only get it working by making all the necessary init calls in the MainActivity.OnCreate() method.

protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule())
                                  .With(new Plugin.Iconize.Fonts.TypiconsModule());
            IconControls.Init();

            InitializeHockeyApp();
            ...

Is this a bug in the doco, or am I doing something wrong?

Documentation Xamarin.iOS

Hi I'm starting to use the library in Xamarin.iOS, but I have not been able to achieve add an icon to my Main.storyboard, what would be the proper way to add an icon to my view?

Thank you.

Text With Icon

How do you add text with the icon? I am trying this with no luck.

Text="fa-sign-out Logoff"

Could not initialize and instance of the type 'UIKit.UIImage".....

My code is here for reference : https://github.com/PrintsCharming/AppZed

Getting the same error with either Typicons or Iconic (the only ones I've tried so far)...

This is pretty much a start from scratch app so it should be pretty straightforward right? I think I followed everything alright.

Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.

FormsPlugin UWP IconImage and IconToolbarIcon not working

I seem to be able to get the text based controls to work (IconButton, IconLabel), but ones that use an ImageSource don't appear to work on UWP Forms projects. They work on iOS and Droid.

I've manually added the missing .tff files to the required .nugget packages folder as noted in another bug.

Looking at the code, there is a call in IconImageRenderer.cs to UpdateImageAsync(), but the body is commented out.

Also, I cant see the implementation of ToImageSourceAsync() anywhere (which is probably why its commented out).

Is there an ETA for this to be implemented? I'm loving this library as a way to get around building icons for both Light and Dark Themes in UWP apps.

IconToolbarItem does not work correctly in a TabbedPage

Hi,

It seems that if we use IconToolbarItem in a TabbedPage (and not in a ContentPage), icons aren't showing up, but Command action works, and we can see "tap effect" on icons places. In a ContentPage, IconToolbarItem works.
Here is a sample of my code :

  <TabbedPage.ToolbarItems>
    <iconize:IconToolbarItem Icon="fa-map" IconColor="#CBCBCB" Command="{Binding Action1}" />
    <iconize:IconToolbarItem Icon="fa-calendar" IconColor="#CBCBCB" Command="{Binding Action2}" />
  </TabbedPage.ToolbarItems>

Is this a known issue ?

Documentation Incomplete

Good day

I'm struggling to implement this library in my Xamarin forms app but the documentation doesn't cover how to actually make use of the icons.

I've gone through the samples but it's not clear what is important and what is not. I've tried implementing as much as possible but keep hitting build errors.

My most recent one being:
No property, bindable property, or event found for 'Icon'

My code is:
<iconize:IconButton HorizontalOptions="FillAndExpand" BorderColor="#00d400" Clicked="scan_qr_code" BackgroundColor="White" BorderRadius="6" BorderWidth="1" TextColor="#00d400" Icon="fa-qrcode" x:Name="qr_code_button" FontSize="14" Grid.Row="0" Grid.Column="1" />

extending fonts in xamarin.ios project

I'm having problems extending the fonts in a xamarin.ios project. I have been able to do it in the android project. I'm not sure why its not working. The following describes the steps I used in the android and ios projects.

I've managed to extend the fonts in my xamarin android project using the following steps:

Added my custom.ttf file into the Assets folder

Created a mapping between keys and special characters:

`internal class CustomFontCollection
{
public static IList Icons { get; } = new List();

    static CustomFontCollection()
    {
        Icons.Add("my-usercirc", '\ue800');
        Icons.Add("my-feedcirc", '\ue801');
        Icons.Add("my-bell-ocirc", '\ue802');
        Icons.Add("my-calendar-ocirc", '\ue803');
        Icons.Add("my-callcirc", '\ue804');
        Icons.Add("my-smscirc", '\ue805');
        Icons.Add("my-envelopecirc", '\ue806');
    }
}`

Implemented IIconModule

class CustomFontModule : IconModule { public CustomFontModule() : base("CustomFont", "CustomFont", "custom.ttf", CustomFontCollection.Icons) { } }

Give it to iconize with in OnCreate()

Plugin.Iconize.Iconize.With(new CustomFontModule());

However I when I do this for the xamarin.ios project it just displays a "?" icon. I tried the following in the xamarin.ios project:

Copied the custom.ttf into the Resources folder

Created a mapping and implemented IIconModule in the same way I did in the android project

Call iconize with in FinishedLaunching()

Added the font in the info.plist

<key>UIAppFonts</key> <array> <string>iconize-fontawesome.ttf</string> <string>custom.ttf</string> </array>

Set fonts "Build Action" to "BundleResource" and the "Copy to Output Directory" to "Copy always"

Xam.Plugin.? and .net 4.5

Hi just wondering if it is possible to target .net 4.5 with the icon plugins. All of them give an error like the following:

Error Could not install package 'Xam.Plugin.Iconize.Material 1.0.10'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Very confusing to start using on Android

This is a documentation issue.

Your readme does a great job on explaining how to configure it, but there is no simple "this is how to have a button with a fontawesome icon" section.

I'm having to download your sample code and debug through it to figure out how it works :(

IconButton with Text

I needed this an option so quickly hacked this together with meets my needs, feel free to use or destroy.
I have not done a iOS version but people should get the idea

extendediconbutton.cs
using Xamarin.Forms;

namespace testproject
{
    /// <summary>
    /// Defines the <see cref="ExtendedIconButton" /> control.
    /// </summary>
    /// <seealso cref="Xamarin.Forms.Button" />
    public class ExtendedIconButton : Button
    {
        public static readonly BindableProperty IconProperty =
                            BindableProperty.Create("Icon", typeof(string), typeof(ExtendedIconButton), "");

        public string Icon
        {
            get { return (string)GetValue(IconProperty); }
            set { SetValue(IconProperty, value); }
        }
    }
}

extendediconbuttonrenderer.cs
using System;
using System.ComponentModel;
using FormsPlugin.Iconize;
using Plugin.Iconize.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using ButtonRenderer = Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer;
using testproject;
using testproject.Droid;

[assembly: ExportRenderer(typeof(ExtendedIconButton), typeof(ExtendedIconButtonRenderer))]
namespace testproject.Droid
{
    /// <summary>
    /// Defines the <see cref="IconButtonRenderer" /> renderer.
    /// </summary>
    /// <seealso cref="Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer" />
    public class ExtendedIconButtonRenderer : ButtonRenderer
    {

        /// <summary>
        /// Gets the underlying control typed as an <see cref="ImageButton"/>.
        /// </summary>
        private ExtendedIconButton ImageButton
        {
            get { return (ExtendedIconButton)Element; }
        }

        /// <summary>
        /// Called when [attached to window].
        /// </summary>
        protected override void OnAttachedToWindow()
        {
            base.OnAttachedToWindow();

            Control.TextChanged += OnTextChanged;
        }

        /// <summary>
        /// Called when [detached from window].
        /// </summary>
        protected override void OnDetachedFromWindow()
        {
            Control.TextChanged -= OnTextChanged;

            base.OnDetachedFromWindow();
        }

        /// <summary>
        /// Raises the <see cref="E:ElementChanged" /> event.
        /// </summary>
        /// <param name="e">The <see cref="ElementChangedEventArgs{Button}" /> instance containing the event data.</param>
        protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
        {
            base.OnElementChanged(e);

            if (Control == null || Element == null)
                return;

            Control.SetAllCaps(false);
            UpdateText();
        }

        /// <summary>
        /// Called when [element property changed].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="PropertyChangedEventArgs" /> instance containing the event data.</param>
        protected override void OnElementPropertyChanged(Object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            if (Control == null || Element == null)
                return;

            switch (e.PropertyName)
            {
                case nameof(IconButton.FontSize):
                case nameof(IconButton.TextColor):
                    UpdateText();
                    break;
            }
        }

        /// <summary>
        /// Called when [text changed].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="Android.Text.TextChangedEventArgs" /> instance containing the event data.</param>
        private void OnTextChanged(Object sender, Android.Text.TextChangedEventArgs e)
        {
            UpdateText();
        }

        /// <summary>
        /// Updates the text.
        /// </summary>
        private void UpdateText()
        {
            Control.TextChanged -= OnTextChanged;

            var icon = Plugin.Iconize.Iconize.FindIconForKey(ImageButton.Icon);
            if (icon != null)
            {
                Control.Text = $"{icon.Character} " + ImageButton.Text;
                Control.Typeface = Plugin.Iconize.Iconize.FindModuleOf(icon).ToTypeface(Context);
            }

            Control.TextChanged += OnTextChanged;
        }
    }
}`

Update compatibility

I try to update Xamarin.Android packages on my project but I can't because Iconize is note compatible with the new version:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Unable to resolve dependencies. 'Xamarin.Android.Support.v7.AppCompat 25.1.1' is not compatible with 'Xam.FormsPlugin.Iconize 1.0.10 constraint: Xamarin.Android.Support.v7.AppCompat (>= 23.3.0)', 'Xam.Plugin.Iconize 1.0.10 constraint: Xamarin.Android.Support.v7.AppCompat (>= 23.3.0)', 'Xamarin.Forms 2.3.1.114 constraint: Xamarin.Android.Support.v7.AppCompat (= 23.3.0)'.			0	

Do you plan to update iconize ?

Request: MasterDetailPage

Just getting my feet wet with this plugin, so far it's great.

I'd love to be able to easily use this for my MasterDetailPage's Master Page icon... Is there an easy workaround currently for this?

Propouse to add some code into IconTabbedPage

Hi, it's very exciting to use your plugins, but when I try use IconTabPage I discover that it not supported fontIcons, so I created own renderer on IconTabPage to solve this issue:

[assembly: ExportRenderer(typeof(IconTabbedPage), typeof(IconTabbedPageRenderer))]
namespace BossDesk.Droid.Controls
{
public class IconTabbedPageRenderer : TabbedPageRenderer
{
private List _fontIcons = new List();

    protected override void OnAttachedToWindow()
    {
        SetIcon();
        base.OnAttachedToWindow();
    }

    protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
    {
        var tabbetPage = e.NewElement;
        _fontIcons.Clear();
        if (tabbetPage != null || tabbetPage.Children.Any())
        {
            foreach (var page in tabbetPage.Children)
            {
                _fontIcons.Add(page.Icon.File);
                // Clear icon to solve unexisting resource
                page.Icon = null;
            }
        }

        base.OnElementChanged(e);
    }

    private void SetIcon()
    {

        var appCompatActivity = (MainActivity)Context;
        if (appCompatActivity != null)
        {
            var tabLayoutIdName = appCompatActivity.Resources
                .GetResourceName(FormsAppCompatActivity.TabLayoutResource).Replace("layout", "id");
            var tabLayoutId = appCompatActivity.Resources.GetIdentifier(tabLayoutIdName, null, null);

            var tabLayout = appCompatActivity.FindViewById<TabLayout>(tabLayoutId);

            if (tabLayout?.TabCount > 0)
            {
                for (var tabIndex = 0; tabIndex < tabLayout?.TabCount; tabIndex++)
                {
                    var tab = tabLayout.GetTabAt(tabIndex);

                    var icon = Plugin.Iconize.Iconize.FindIconForKey(_fontIcons[tabIndex]);
                    if (icon == null)
                    {
                        tab.SetIcon(Android.Resource.Color.Transparent);
                        continue;
                    }

                    var drawable = new IconDrawable(Context, icon).Color(Color.White.ToAndroid())
                        .SizeDp(20);

                    tab.SetIcon(drawable);
                }
            }
        }
    }
}

}

Now it's only for Android and AppCompat, but if you interest I will try to that for iOS and simple actionBar

p.s. my xaml:

<iconize:IconTabbedPage.Children>
    <Page Icon="fa-info-circle"></Page>
    <Page Icon="fa-paste"></Page>
    <Page Icon="fa-users"></Page>
    <Page Icon="fa-file-text"></Page>
    <Page Icon="fa-floppy-o"></Page>
    <Page Icon="fa-files-o"></Page>
</iconize:IconTabbedPage.Children>

IconToolbarItem default color is black

Hello,
At first, thank you for your work.
I'm using IconToolbarItem in my application. It works well but the icon color is black by default.
How can I tell Iconize to set the IconToolbarItem color to the inherited theme color?
I dont' want to specify a particular color, I wan't to reproduce the same behavior than the default xamarin ToolbarItem witch is black on UWP, white on Android, and blue on IOS.

Thank you!

Android IconButton - Rounded button

Hi!

Is it possible to have rounded IconButton in Android? In iOS everything is OK by design, but for Android it seems not clear how to achieve this.

Thanks!

Compatibility with portable class libraries Profile 111

Hi, do you plan to release a version for each of the Icon Fonts that is compatible with PCLs? I am trying to install the Xam.Plugin.Iconize.FontAwesome nuget which fails with some compatibility issue (using profile 111). All the icon fonts fail with the same message but Xam.Plugin.Iconize and Xam.FormsPlugin.Iconize installed successfully.

Windows samples dont build

both projects have the following error

2>D:\3rdPartyRepos\Xamarin.Plugins\Iconize\Samples\Iconize.FormsSample.UWP\Iconize.FormsSample.UWP.csproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll' 2>C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(259,5): Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

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.