コード例 #1
0
 public void AddtoView(RelativeLayout Root)
 {
     RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(RtGraphicsLayouts.ConvertPxDp(120), RtGraphicsLayouts.ConvertPxDp(120));
     params1.TopMargin  = ((int)(RtGraphicsLayouts.ConvertPxDp(1800) * YNorm)) - RtGraphicsLayouts.ConvertPxDp(120);
     params1.LeftMargin = ((int)(RtGraphicsLayouts.ConvertPxDp(1800) * XNorm)) - RtGraphicsLayouts.ConvertPxDp(60);
     Root.AddView(_MarkerView, params1);
 }
コード例 #2
0
        public void Redraw(string StationCRSCode, ScrollView ParentScroller)
        {
            this._ParentScrollView = ParentScroller;

            _RootMap.RemoveAllViews();

            _MapImage = new ImageView(this.Context);
            float XPos, YPos = 0.0f;

            if (StationCRSCode == "LAN")
            {
                _MapImage.SetBackgroundResource(Resource.Drawable.Map_LAN);

                XPos = 0.4f;
                YPos = -0.1f;

                _RootMap.SetX(RtGraphicsLayouts.ConvertPxDp(1800) * (XPos / 2.0f));
                _RootMap.SetY(RtGraphicsLayouts.ConvertPxDp(1800) * (YPos / 2.0f));

                _MapImage.LayoutParameters = RtGraphicsLayouts.LayoutParameters(1800, 1800);
                _RootMap.AddView(_MapImage);

                //Draw Markers for LAN
                StationFacilitiesMarker MarkerDoor1 = new StationFacilitiesMarker(Context, 0.60f, 0.645f, StationFacilitiesMarker.MarkerTypes.EnteranceExit);
                MarkerDoor1.AddtoView(_RootMap);

                StationFacilitiesMarker MarkerDoor2 = new StationFacilitiesMarker(Context, 0.425f, 0.635f, StationFacilitiesMarker.MarkerTypes.EnteranceExit);
                MarkerDoor2.AddtoView(_RootMap);
            }
            else if (StationCRSCode == "PRE")
            {
                _MapImage.SetBackgroundResource(Resource.Drawable.Map_PRE);

                XPos = 0.4f;
                YPos = -0.1f;

                _RootMap.SetX(RtGraphicsLayouts.ConvertPxDp(1800) * (XPos / 2.0f));
                _RootMap.SetY(RtGraphicsLayouts.ConvertPxDp(1800) * (YPos / 2.0f));

                _MapImage.LayoutParameters = RtGraphicsLayouts.LayoutParameters(1800, 1800);
                _RootMap.AddView(_MapImage);

                //Draw Markers for LAN
                //StationFacilitiesMarker MarkerDoor1 = new StationFacilitiesMarker(Context, 0.60f, 0.645f, StationFacilitiesMarker.MarkerTypes.EnteranceExit);
                //MarkerDoor1.AddtoView(_RootMap);

                //StationFacilitiesMarker MarkerDoor2 = new StationFacilitiesMarker(Context, 0.425f, 0.635f, StationFacilitiesMarker.MarkerTypes.EnteranceExit);
                //MarkerDoor2.AddtoView(_RootMap);
            }
        }
コード例 #3
0
        public StationFacilitiesView(Context Context)
        {
            this.Context = Context;

            RtGraphicsLayouts = new RtGraphicsLayouts(this.Context);

            _RootLayout = new LinearLayout(this.Context);
            _RootLayout.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            _RootLayout.SetOnTouchListener(this);

            _RootPan = new RelativeLayout(this.Context);
            _RootPan.LayoutParameters = new ViewGroup.LayoutParams(10000, 10000);
            _RootLayout.AddView(_RootPan);

            _RootMap = new RelativeLayout(this.Context);
            _RootMap.LayoutParameters = new ViewGroup.LayoutParams(10000, 10000);
            RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(10000, 10000);
            params1.TopMargin  = -RtGraphicsLayouts.ConvertPxDp(900);
            params1.LeftMargin = -RtGraphicsLayouts.ConvertPxDp(900);
            _RootPan.AddView(_RootMap, params1);

            Redraw("LAN", null);
        }