internal LegendItemView(Context context)
                    : base(context)
                {
                    Orientation      = Orientation.Horizontal;
                    LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
                    SetGravity(GravityFlags.Top);

                    _textView = new TextView(context)
                    {
                        LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                        {
                            Gravity = GravityFlags.CenterVertical | GravityFlags.Left
                        }
                    };
                    var maxSize = (int)(Resources.DisplayMetrics.Density * 40);

                    _symbol = new SymbolDisplay(context)
                    {
                        LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                        {
                            Gravity = GravityFlags.Center, Width = maxSize
                        }
                    };
                    _symbol.SetMaxHeight(maxSize);
                    _symbol.SetMaxWidth(maxSize);
                    AddView(_symbol);
                    AddView(_textView);
                    RequestLayout();
                }
Exemple #2
0
        internal LayerLegendItemView(Context context)
            : base(context)
        {
            Orientation      = Orientation.Horizontal;
            LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            SetGravity(GravityFlags.Top);

            _symbolDisplay = new SymbolDisplay(context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.MatchParent),
            };
            _symbolDisplay.SetMaxHeight(40);
            _symbolDisplay.SetMaxWidth(40);
            AddView(_symbolDisplay);

            _textView = new TextView(context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.MatchParent),
            };
            _textView.Gravity = GravityFlags.CenterVertical;
            AddView(_textView);
            RequestLayout();
        }