Ejemplo n.º 1
0
        public void showFocusMap(int position)
        {
            //mapImage.ZoomTo(0,Configuration.getWidth(320),Configuration.getWidth(320));
            mapImage.SetImageBitmap(currentMap);
            var posXY = _positionCurrentPlaces [position];

            //mapImage.PivotX = posXY.Item1;
            //mapImage.PivotY = posXY.Item2;
            //mapImage.ScaleX = 3;
            //mapImage.ScaleY = 3;
            //int x =  950*posXY.Item1/1000;

            //! Esta es la parte del Zoom
            int x = 800 * posXY.Item1 / 1000;
            int y = 800 * posXY.Item2 / 1000;

            mapImage.ZoomTo((float)0, x, y);
            mapImage.Cutting();


            //HUILLCA-------------------------

            /*int addx = 60, addy = 40;//para mejorar la precisión
             * //800 es el 80% del tamaño del mapa(1000x1000)
             * if (posXY.Item1 > 800) addx=0;
             * if (posXY.Item2 > 800) addy=0;*/

            int   spaceMapXY = Configuration.getWidth(640);
            float x2         = (spaceMapXY * (posXY.Item1) / 1000);
            float y2         = (spaceMapXY * (posXY.Item2) / 1000);

            iconMarker.SetX(x2 - Configuration.getWidth(30));          //se resta el ancho del icono
            iconMarker.SetY(y2 - Configuration.getWidth(30));          //se resta la altitud del icono
            iconMarker.Visibility = ViewStates.Visible;

            iconMarker.StartAnimation(fadeOut);
            //-----------------------------------------------------------
        }
Ejemplo n.º 2
0
        public void showFocusMap(int position)
        {
            //mapImage.ZoomTo(0,Configuration.getWidth(320),Configuration.getWidth(320));
            mapImage.SetImageBitmap(currentMap);
            var posXY = _positionCurrentPlaces [position];

            //mapImage.PivotX = posXY.Item1;
            //mapImage.PivotY = posXY.Item2;
            //mapImage.ScaleX = 3;
            //mapImage.ScaleY = 3;
            int x = 950 * posXY.Item1 / 1000;
            int y = 900 * posXY.Item2 / 1000;

            mapImage.ZoomTo((float)1.5, x, y);
            mapImage.Cutting();


            //HUILLCA----------
            iconMarker.SetX(Configuration.getWidth(posXY.Item1));
            iconMarker.SetY(Configuration.getHeight(posXY.Item2));
            iconMarker.Visibility = ViewStates.Visible;
            iconMarker.StartAnimation(fadeOut);
            //----------------------
        }
Ejemplo n.º 3
0
        public void iniPlancesList()
        {
            //_currentPlaces.Clear ();
            _listLinearPlaces.Clear();
            placeSpace.RemoveAllViews();
            placesContainer.RemoveAllViews();

            VerticalScrollView listScrollPlaces = new VerticalScrollView(context);

            listScrollPlaces.LayoutParameters         = new VerticalScrollView.LayoutParams(-1, Configuration.getHeight(345));
            listScrollPlaces.VerticalScrollBarEnabled = false;

            LinearLayout listSpaceLayout = new LinearLayout(context);

            listSpaceLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
            listSpaceLayout.Orientation      = Orientation.Vertical;

            for (int i = 0; i < _currentPlaces.Count; i++)
            {
                var item = _currentPlaces [i];

                LinearLayoutLO linearItem = new LinearLayoutLO(context);
                linearItem.index = i;
                TextView  txtName = new TextView(context);
                ImageView imgIcon = new ImageView(context);

                txtName.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(420), -1);
                txtName.Gravity          = GravityFlags.CenterVertical;

                txtName.Text = item.titulo;
                //txtName.SetTextColor (Color.ParseColor ("#ffffff"));
                txtName.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
                txtName.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(32));
                //imgIcon.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset (item.Asset), Configuration.getWidth (30), Configuration.getWidth (30), true));

                int H = 80;
                int W = 120;

                linearItem.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(H));
                //linearItem.SetBackgroundDrawable (background_row);
                linearItem.Orientation = Orientation.Horizontal;
                linearItem.SetGravity(Android.Views.GravityFlags.CenterVertical);
                //linearItem.AddView (imgIcon);


                RelativeLayout imageLayout = new RelativeLayout(context);
                imageLayout.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H));
                ImageView iconImage = new ImageView(context);
                Picasso.With(context).Load(item.pathIcon).Resize(Configuration.getWidth(W), Configuration.getHeight(H)).CenterCrop().Into(iconImage);
                imageLayout.AddView(iconImage);

                LinearLayout gradiente = new LinearLayout(context);
                gradiente.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H));

                imageLayout.AddView(gradiente);

                ImageIconMap icon = new ImageIconMap(context);
                icon.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(60), Configuration.getWidth(60));

                icon.index = 0;
                icon.SetImageBitmap(_leyendaIcon[item.tipoIndex]);
                //icon.SetPadding (Configuration.getWidth (20), ,0,0);
                icon.SetX(Configuration.getWidth(30));
                icon.SetY(Configuration.getHeight(10));

                RelativeLayout iconLayout = new RelativeLayout(context);
                iconLayout.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H));
                iconLayout.SetGravity(GravityFlags.Center);

                LinearLayout gradiente2 = new LinearLayout(context);
                gradiente2.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H));

                iconLayout.AddView(icon);
                iconLayout.AddView(gradiente2);

                linearItem.AddView(imageLayout);
                linearItem.AddView(txtName);
                linearItem.AddView(iconLayout);
                int space = Configuration.getWidth(30);
                //linearItem.SetPadding (space,0,space,0);
                //imgIcon.SetPadding (Configuration.getWidth(68), 0, 0, 0);
                txtName.SetPadding(Configuration.getWidth(10), 0, 0, 0);

                if (i % 2 == 0)
                {
                    gradiente.SetBackgroundResource(Resource.Drawable.gradiente2);
                    gradiente2.SetBackgroundResource(Resource.Drawable.gradiente22);
                    linearItem.SetBackgroundColor(Color.ParseColor("#F0AE11"));
                    txtName.SetTextColor(Color.White);
                }
                else
                {
                    gradiente.SetBackgroundResource(Resource.Drawable.gradiente1);
                    gradiente2.SetBackgroundResource(Resource.Drawable.gradiente11);
                    txtName.SetTextColor(Color.ParseColor("#F0AE11"));
                }

                _listLinearPlaces.Add(linearItem);
                _listLinearPositonPlaces.Add(icon);
                listSpaceLayout.AddView(linearItem);
            }

            /*
             * listPlaces = new ListView (context);
             * listPlaces.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(345));
             *
             * listPlaces.Adapter = new PlaceAdapter (context, _currentPlaces);
             * listPlaces.DividerHeight = 0;
             *
             * placesContainer.AddView (listPlaces);
             */
            placesContainer.AddView(listSpaceLayout);
            placeSpace.AddView(placesContainer);

            titulo_header.Text = titulo_map_header;
            header.AddView(titulo_header);
            header.AddView(_leyendaMap);
        }
Ejemplo n.º 4
0
		public void iniPlancesList()
		{
			//_currentPlaces.Clear ();
			_listLinearPlaces.Clear();
			placeSpace.RemoveAllViews ();
			placesContainer.RemoveAllViews ();

			VerticalScrollView listScrollPlaces = new VerticalScrollView (context);
			listScrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight (345));
			listScrollPlaces.VerticalScrollBarEnabled = false;

			LinearLayout listSpaceLayout = new LinearLayout(context);
			listSpaceLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			listSpaceLayout.Orientation = Orientation.Vertical;

			for (int i = 0; i < _currentPlaces.Count; i++) {

				var item = _currentPlaces [i];

				LinearLayoutLO linearItem = new LinearLayoutLO (context);
				linearItem.index = i;
				TextView txtName = new TextView (context);
				ImageView imgIcon = new ImageView (context);

				txtName.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (420), -1);
				txtName.Gravity = GravityFlags.CenterVertical;

				txtName.Text = item.titulo;
				//txtName.SetTextColor (Color.ParseColor ("#ffffff"));
				txtName.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
				txtName.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(32));
				//imgIcon.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset (item.Asset), Configuration.getWidth (30), Configuration.getWidth (30), true));

				int H = 80;
				int W = 120;

				linearItem.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (H));
				//linearItem.SetBackgroundDrawable (background_row);
				linearItem.Orientation = Orientation.Horizontal;
				linearItem.SetGravity (Android.Views.GravityFlags.CenterVertical);
				//linearItem.AddView (imgIcon);


				RelativeLayout imageLayout = new RelativeLayout (context);
				imageLayout.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (W), Configuration.getHeight (H));
				ImageView iconImage = new ImageView (context);
				Picasso.With (context).Load (item.pathIcon).Resize(Configuration.getWidth(W),Configuration.getHeight(H)).CenterCrop().Into (iconImage);
				imageLayout.AddView (iconImage);

				LinearLayout gradiente = new LinearLayout (context);
				gradiente.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (W), Configuration.getHeight (H));

				imageLayout.AddView (gradiente);

				ImageIconMap icon = new ImageIconMap (context);
				icon.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (60), Configuration.getWidth (60));

				icon.index = 0;
				icon.SetImageBitmap(_leyendaIcon[item.tipoIndex]);
				//icon.SetPadding (Configuration.getWidth (20), ,0,0);
				icon.SetX(Configuration.getWidth (30));
				icon.SetY(Configuration.getHeight (10));

				RelativeLayout iconLayout = new RelativeLayout (context);
				iconLayout.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (W), Configuration.getHeight (H));
				iconLayout.SetGravity (GravityFlags.Center);

				LinearLayout gradiente2 = new LinearLayout (context);
				gradiente2.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (W), Configuration.getHeight (H));

				iconLayout.AddView (icon);
				iconLayout.AddView (gradiente2);

				linearItem.AddView (imageLayout);
				linearItem.AddView (txtName);
				linearItem.AddView (iconLayout);
				int space = Configuration.getWidth (30);
				//linearItem.SetPadding (space,0,space,0);
				//imgIcon.SetPadding (Configuration.getWidth(68), 0, 0, 0);
				txtName.SetPadding (Configuration.getWidth(10), 0, 0, 0);

				if (i % 2 == 0) {
				gradiente.SetBackgroundResource (Resource.Drawable.gradiente2);
				gradiente2.SetBackgroundResource (Resource.Drawable.gradiente22);
				linearItem.SetBackgroundColor (Color.ParseColor ("#F0AE11"));
				txtName.SetTextColor (Color.White);
				} else {
				gradiente.SetBackgroundResource (Resource.Drawable.gradiente1);
				gradiente2.SetBackgroundResource (Resource.Drawable.gradiente11);
				txtName.SetTextColor (Color.ParseColor("#F0AE11"));
				}

				_listLinearPlaces.Add (linearItem);
				_listLinearPositonPlaces.Add (icon);
				listSpaceLayout.AddView (linearItem);

			}

			/*
			listPlaces = new ListView (context);
			listPlaces.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(345));

			listPlaces.Adapter = new PlaceAdapter (context, _currentPlaces);
			listPlaces.DividerHeight = 0;

			placesContainer.AddView (listPlaces);
*/
			placesContainer.AddView (listSpaceLayout);
			placeSpace.AddView(placesContainer);

			titulo_header.Text = titulo_map_header;
			header.AddView (titulo_header);
			header.AddView (_leyendaMap);


		}
Ejemplo n.º 5
0
		public void ini(){

			Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/1header.png"));
			header = new LinearLayout(context);
			header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
			header.Orientation = Orientation.Horizontal;
			header.SetGravity (GravityFlags.Center);
			header.SetBackgroundDrawable (dr);


			titulo_header = new TextView (context);
			titulo_header.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(550), -1);
			titulo_header.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
			titulo_header.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
			titulo_header.SetTextColor (Color.White);
			titulo_header.Gravity = GravityFlags.Center;
			//titulo_header.TextAlignment = TextAlignment.Center;

			placesInfoLayout = new LinearLayout (context);
			placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			int space = Configuration.getWidth (30);
			placesInfoLayout.SetPadding(space,space,space,space);
			placesInfoLayout.Orientation = Orientation.Vertical;

			_mainLayout = new RelativeLayout (context);
			_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);

			_mainLayout.AddView (header);

			mapImage = new ScaleImageView (context, null);
			mapImage.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
			mapSpace = new LinearLayout (context);
			mapSpace.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
			mapSpace.SetY (Configuration.getHeight (125));
			mapSpace.SetGravity (GravityFlags.Left);
			mapSpace.SetBackgroundColor (Color.ParseColor ("#DFC6BB"));
			//HUILLCA-----------------------------------------
			mapSpaceMarker = new RelativeLayout (context);
			mapSpaceMarker.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
			mapSpaceMarker.SetY (Configuration.getHeight (125));
			mapSpaceMarker.SetGravity (GravityFlags.Left);
			mapSpaceMarker.SetBackgroundColor (Color.Transparent);

			iconMarker = new ImageIconMap (context);
			iconMarker.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (60), Configuration.getWidth (60));
			int w = Configuration.getWidth (70);
			int h = Configuration.getWidth (70);
			iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/iconmap12.png"), w, h, true));
			iconMarker.SetX (-100);
			iconMarker.SetY (-100);
			mapSpaceMarker.AddView (iconMarker);

			var fadeIn = new AlphaAnimation(0, 1);
			fadeIn.Interpolator = new AccelerateInterpolator();
			fadeIn.Duration = 1000;

			fadeOut = new AlphaAnimation(1, 0);
			fadeOut.Interpolator = new DecelerateInterpolator();
			fadeOut.Duration = 3000;
			fadeOut.AnimationEnd += (s, e) => 
			{
				 /*ThreadPool.QueueUserWorkItem(state =>
					{
						Thread.Sleep(2000); //wait 2 sec
						//RunOnUiThread(() => iconMarker.StartAnimation(fadeOut));
					});*/
					iconMarker.StartAnimation(fadeIn);
					iconMarker.Visibility = ViewStates.Invisible;
			};
			//-------------------------------------------------------
			mapSpace.AddView (mapImage);



			placeSpace = new VerticalScrollView (context);
			placeSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
			placeSpace.SetY (Configuration.getHeight (125)+Configuration.getWidth(640));
			placeSpace.SetBackgroundColor (Color.White);

			placesContainer = new LinearLayout (context);
			placesContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
			placesContainer.Orientation = Orientation.Vertical;


			_mainLayout.AddView (mapSpace);
			_mainLayout.AddView (mapSpaceMarker);//HUILLCA
			_mainLayout.AddView (placeSpace);

			_publicidadLayout = new LinearLayout (context);
			_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
			Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
			_publicidadLayout.SetBackgroundDrawable (drp);
			_publicidadLayout.SetY (Configuration.getHeight(1136-85));
			_mainLayout.AddView (_publicidadLayout);
			_publicidadLayout.Click += delegate {
				if (adOpen) {


					hideAd ();
				} else {
					Random rnd = new Random();
					showAd (rnd.Next(3));
				}
			};



			_mainLayout.AddView (leyendaLayout);

			scrollPlaces = new VerticalScrollView (context);
			scrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams (-1,Configuration.getHeight(1136-125-85));
			scrollPlaces.AddView (placesInfoLayout);
			scrollPlaces.SetY (Configuration.getHeight (125));


			//mainLayout.AddView (placesInfoLayout);

			//iniPlancesList ();

		}
Ejemplo n.º 6
0
        public void ini()
        {
            Drawable dr = new BitmapDrawable(getBitmapFromAsset("images/1header.png"));

            header = new LinearLayout(context);
            header.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(125));
            header.Orientation      = Orientation.Horizontal;
            header.SetGravity(GravityFlags.Center);
            header.SetBackgroundDrawable(dr);


            titulo_header = new TextView(context);
            titulo_header.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(550), -1);
            titulo_header.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(38));
            titulo_header.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
            titulo_header.SetTextColor(Color.White);
            titulo_header.Gravity = GravityFlags.Center;
            //titulo_header.TextAlignment = TextAlignment.Center;

            placesInfoLayout = new LinearLayout(context);
            placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
            int space = Configuration.getWidth(30);

            placesInfoLayout.SetPadding(space, space, space, space);
            placesInfoLayout.Orientation = Orientation.Vertical;

            _mainLayout = new RelativeLayout(context);
            _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1);

            _mainLayout.AddView(header);

            mapImage = new ScaleImageView(context, null);
            mapImage.LayoutParameters = new LinearLayout.LayoutParams(-1, -1);
            mapSpace = new LinearLayout(context);
            mapSpace.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(640), Configuration.getWidth(640));
            mapSpace.SetY(Configuration.getHeight(125));
            mapSpace.SetGravity(GravityFlags.Left);
            mapSpace.SetBackgroundColor(Color.ParseColor("#DFC6BB"));

            //HUILLCA-----------------------------------------
            mapSpaceMarker = new RelativeLayout(context);
            mapSpaceMarker.LayoutParameters = new RelativeLayout.LayoutParams(Configuration.getWidth(640), Configuration.getWidth(640));
            mapSpaceMarker.SetY(Configuration.getHeight(125));
            mapSpaceMarker.SetGravity(GravityFlags.Left);
            mapSpaceMarker.SetBackgroundColor(Color.Transparent);

            iconMarker = new ImageIconMap(context);
            iconMarker.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(40), Configuration.getWidth(40));
            int w = Configuration.getWidth(40);
            int h = Configuration.getWidth(40);

            iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/iconmap12.png"), w, h, true));
            iconMarker.SetX(-100);
            iconMarker.SetY(-100);
            iconMarker.SetAlpha(185);             //hace que la imagen sea mas transparente
            mapSpaceMarker.AddView(iconMarker);

            var fadeIn = new AlphaAnimation(0, 1);

            fadeIn.Interpolator = new AccelerateInterpolator();
            fadeIn.Duration     = 1000;

            fadeOut = new AlphaAnimation(1, 0);
            fadeOut.Interpolator  = new DecelerateInterpolator();
            fadeOut.Duration      = 3000;
            fadeOut.AnimationEnd += (s, e) =>
            {
                /*ThreadPool.QueueUserWorkItem(state =>
                 *     {
                 *             Thread.Sleep(2000); //wait 2 sec
                 *             //RunOnUiThread(() => iconMarker.StartAnimation(fadeOut));
                 *     });*/
                iconMarker.StartAnimation(fadeIn);
                iconMarker.Visibility = ViewStates.Invisible;
            };
            //-------------------------------------------------------
            mapSpace.AddView(mapImage);



            placeSpace = new VerticalScrollView(context);
            placeSpace.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(375 - 85));
            placeSpace.SetY(Configuration.getHeight(125) + Configuration.getWidth(640));
            placeSpace.SetBackgroundColor(Color.White);

            placesContainer = new LinearLayout(context);
            placesContainer.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(375 - 85));
            placesContainer.Orientation      = Orientation.Vertical;


            _mainLayout.AddView(mapSpace);
            _mainLayout.AddView(mapSpaceMarker);             //HUILLCA
            _mainLayout.AddView(placeSpace);

            _publicidadLayout = new LinearLayout(context);
            _publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(85));
            Drawable drp = new BitmapDrawable(getBitmapFromAsset("images/footerad.jpg"));

            _publicidadLayout.SetBackgroundDrawable(drp);
            _publicidadLayout.SetY(Configuration.getHeight(1136 - 85));
            _mainLayout.AddView(_publicidadLayout);
            _publicidadLayout.Click += delegate {
                if (adOpen)
                {
                    hideAd();
                }
                else
                {
                    Random rnd = new Random();
                    showAd(rnd.Next(adsImagesPath.Count));
                }
            };



            _mainLayout.AddView(leyendaLayout);

            scrollPlaces = new VerticalScrollView(context);
            scrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams(-1, Configuration.getHeight(1136 - 125 - 85));
            scrollPlaces.AddView(placesInfoLayout);
            scrollPlaces.SetY(Configuration.getHeight(125));


            //mainLayout.AddView (placesInfoLayout);

            //iniPlancesList ();
        }