Exemple #1
0
		void LoadPagesDataSource()
		{


			//LOViewModel vm = ViewModel as LOViewModel;
			//var styles = new StyleConstants();
			//vm.IsLoading.Execute(null);
			bool is_main = true;
			int space = Configuration.getWidth (30);
		//	for (int i = 0; i < 3; i++)
		//	{
			var s_listp = vm.LOsInCircle[vm._currentUnidad].stack.StacksList;
				int indice = 0;

				if (s_listp != null) {



					for (int j = 0; j < s_listp.Count; j++) {						

						for (int k = 0; k < s_listp [j].PagesList.Count; k++) {

							VerticalScrollViewPager scrollPager = new VerticalScrollViewPager (this);
							scrollPager.setOnScrollViewListener (this); 
							LinearLayout linearScroll = new LinearLayout (this);
							linearScroll.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
							linearScroll.Orientation = Orientation.Vertical;

							var content = s_listp [j].PagesList [k].content;
							FrontContainerViewPager front = new FrontContainerViewPager (this);
							front.Tag = "pager";


							front.ImageChapter = s_listp [j].PagesList [k].page.url_img;


							front.Title = s_listp [j].PagesList [k].page.title;
							front.Description = s_listp [j].PagesList [k].page.description;
							var slides = s_listp [j].PagesList [k].content.lopage.loslide;
							front.setBack (drBack);


							linearScroll.AddView (front);

						LinearLayout descriptionLayout = new LinearLayout (this);
						descriptionLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);

						descriptionLayout.Orientation = Orientation.Vertical;

						int padW = Configuration.getWidth(30);
						int padH = Configuration.getHeight (30);

						descriptionLayout.SetPadding (padW, 0, padW, 0);


						TextView titulo_detalle = new TextView (this);
						titulo_detalle.Text = "Descripción";
						titulo_detalle.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
						titulo_detalle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
						titulo_detalle.SetTextColor(Color.ParseColor(Configuration.ListaColores [indice % 6]));
						descriptionLayout.AddView (titulo_detalle);

						TextView detalle = new TextView (this);
						detalle.TextFormatted = Html.FromHtml (slides[0].loparagraph);
						detalle.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
						detalle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(32));
						descriptionLayout.AddView (detalle);
					


						ViewTreeObserver vto = detalle.ViewTreeObserver;
						int H = 0;
						vto.GlobalLayout += (sender, args) => {     
							H = detalle.Height;
							detalle.LayoutParameters.Height = H - Configuration.getHeight (50);

						};  


						LinearLayout separationLinear = new LinearLayout (this);
						separationLinear.LayoutParameters = new LinearLayout.LayoutParams (-1, 5);
						separationLinear.SetBackgroundColor (Color.ParseColor ("#D8D8D8"));
						separationLinear.Orientation = Orientation.Horizontal;

						linearScroll.AddView (descriptionLayout);
						linearScroll.AddView (separationLinear);

						separationLinear.SetPadding (0,padH,0,padH);


							listFrontPager.Add (front);

							var currentpage = s_listp [j].PagesList [k];

				


							for (int m = 1; m < slides.Count; m++) {
								LOSlideSource slidesource = new LOSlideSource (this);

							var _id_ = vm.LOsInCircle [vm._currentUnidad].lo.color_id;
								is_main = !is_main;


								slidesource.ColorS = Configuration.ListaColores [indice % 6];

								slidesource.Type = slides [m].lotype;
								if (slides [m].lotitle != null)
									slidesource.Title = slides [m].lotitle;
								if (slides [m].loparagraph != null)
									slidesource.Paragraph = slides [m].loparagraph;
								if (slides [m].loimage != null)
									slidesource.ImageUrl = slides [m].loimage;
								if (slides [m].lotext != null)
									slidesource.Paragraph = slides [m].lotext;
								if (slides [m].loauthor != null)
									slidesource.Author = slides [m].loauthor;
								if (slides [m].lovideo != null)
									slidesource.VideoUrl = slides [m].lovideo;

								var c_slide = slides [m];


								if (c_slide.loitemize != null) {
									slidesource.Itemize = new ObservableCollection<LOItemSource> ();
									var items = c_slide.loitemize.loitem;

									for (int n = 0; n < items.Count; n++) { 
										LOItemSource item = new LOItemSource ();
										if (items [n].loimage != null)
											item.ImageUrl = items [n].loimage;
										if (items [n].lotext != null)
											item.Text = items [n].lotext;


										var c_item_ize = items [n];

										slidesource.Itemize.Add (item);
									}
								}



								linearScroll.AddView (slidesource.getViewSlide ());


							} 
							

						//linearScroll.SetPadding (padW,padH,padW,padH);
							
							scrollPager.VerticalScrollBarEnabled = false;
							if (k == 0) {
								scrollPager.AddView (linearScroll);
								listaScroll.Add (scrollPager);
								indice++;
							}



						}

					}




				} else {
					Console.WriteLine ("ERROR");
				}



		//	}
			mainLayoutPages.RemoveAllViews ();
			//_progresD.Hide ();
			mainLayoutPages.AddView (viewPager);
			mainLayoutPages.SetX (0);
			mainLayoutPages.SetY (0);
			_mainLayout.AddView (mainLayoutPages);

			_publicidadLayout = new LinearLayout (this);
			_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));
				}
			};


			LOViewAdapter adapter = new LOViewAdapter (this, listaScroll);
			viewPager.Adapter = adapter;
			//viewPager.CurrentItem = IndiceSection;
			viewPager.SetCurrentItem (vm._currentSection, true);
		}
Exemple #2
0
        void LoadPagesDataSource()
        {
            bool is_main = true;
            int  space   = Configuration.getWidth(30);

            var s_listp = vm.LOsInCircle[vm._currentUnidad].stack.StacksList;
            int indice  = 0;

            if (s_listp != null)
            {
                int j = vm._currentSection;
                //	for (int j = 0; j < s_listp.Count; j++) {

                for (int k = 0; k < s_listp [j].PagesList.Count; k++)
                {
                    //		if (j == vm._currentSection) {

                    VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this);
                    scrollPager.setOnScrollViewListener(this);
                    LinearLayout linearScroll = new LinearLayout(this);
                    linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
                    linearScroll.Orientation      = Orientation.Vertical;

                    var content = s_listp [j].PagesList [k].content;
                    FrontContainerViewPager front = new FrontContainerViewPager(this);
                    front.Tag = "pager";


                    front.ImageChapter = s_listp [j].PagesList [k].page.url_img;


                    front.Title       = s_listp [j].PagesList [k].page.title;
                    front.Description = s_listp [j].PagesList [k].page.description;


                    var slides = s_listp [j].PagesList [k].content.lopage.loslide;
                    front.setBack(drBack);


                    linearScroll.AddView(front);

                    LinearLayout descriptionLayout = new LinearLayout(this);
                    descriptionLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
                    descriptionLayout.SetPadding(space, 0, space, space);
                    descriptionLayout.Orientation = Orientation.Vertical;

                    TextView titulo_detalle = new TextView(this);
                    titulo_detalle.Text     = "Descripción";
                    titulo_detalle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
                    titulo_detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(38));
                    titulo_detalle.SetTextColor(Color.ParseColor(Configuration.ListaColores [indice % 6]));
                    titulo_detalle.SetPadding(0, 0, 0, space);
                    descriptionLayout.AddView(titulo_detalle);

                    TextView detalle = new TextView(this);
                    detalle.TextFormatted = Html.FromHtml(slides [0].loparagraph);
                    detalle.Typeface      = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
                    detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(32));
                    descriptionLayout.AddView(detalle);

                    ViewTreeObserver vto = detalle.ViewTreeObserver;
                    int H = 0;
                    vto.GlobalLayout += (sender, args) =>
                    {
                        H = detalle.Height;
                        Console.WriteLine("TAM:::1:" + H);
                        detalle.LayoutParameters.Height = H - Configuration.getHeight(60);
                    };



                    LinearLayout separationLinear = new LinearLayout(this);
                    separationLinear.LayoutParameters = new LinearLayout.LayoutParams(-1, 5);
                    separationLinear.SetBackgroundColor(Color.ParseColor("#D8D8D8"));
                    separationLinear.Orientation = Orientation.Horizontal;
                    //separationLinear.SetPadding (0,0,0,50);

                    //Añadir mis-Favoritos-----------------------------------------------------------
                    iconFavorito = Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/notas.png"), Configuration.getWidth(40), Configuration.getWidth(30), true);
                    //Colocando icono de Favoritos
                    ImageView favorit_ = new ImageView(this);
                    favorit_.Tag = j;
                    favorit_.SetImageBitmap(iconFavorito);
                    favorit_.SetX(Configuration.getWidth(20));
                    favorit_.SetY(Configuration.getHeight(0));
                    favorit_.Click += delegate { funcFavoritos(favorit_); };

                    TextView tomar_notas = new TextView(this);
                    tomar_notas.Text = "Tomar notas";
                    tomar_notas.SetTextColor(Color.ParseColor("#E65100"));
                    tomar_notas.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(21));
                    tomar_notas.SetX(Configuration.getWidth(60));
                    tomar_notas.SetY(Configuration.getHeight(0));
                    tomar_notas.Click += delegate
                    {
                        Bundle bundle = new Bundle();
                        bundle.PutString("Titulo", front.Title);
                        bundle.PutInt("TaskID", isListNotas(front.Title));

                        //Intent nos permite enlazar dos actividades
                        Intent intent = new Intent(this, typeof(NotasItemScreen));
                        //añadir parametros
                        intent.PutExtras(bundle);
                        //ejuta intent
                        StartActivity(intent);
                    };

                    RelativeLayout misFavoritos = new RelativeLayout(this);
                    misFavoritos.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(60));
                    misFavoritos.SetX(Configuration.getWidth(0));
                    misFavoritos.SetY(Configuration.getHeight(0));
                    misFavoritos.AddView(tomar_notas);
                    misFavoritos.AddView(favorit_);
                    linearScroll.AddView(misFavoritos);
                    //FIN FAVoritos-----------------------------------------------------------
                    linearScroll.AddView(descriptionLayout);
                    linearScroll.AddView(separationLinear);

                    listFrontPager.Add(front);

                    var currentpage = s_listp [j].PagesList [k];



                    for (int m = 1; m < slides.Count; m++)
                    {
                        LOSlideSource slidesource = new LOSlideSource(this);

                        var _id_ = vm.LOsInCircle [vm._currentUnidad].lo.color_id;
                        is_main = !is_main;


                        slidesource.ColorS = Configuration.ListaColores [indice % 6];

                        slidesource.Type = slides [m].lotype;
                        if (slides [m].lotitle != null)
                        {
                            slidesource.Title = slides [m].lotitle;
                        }
                        if (slides [m].loparagraph != null)
                        {
                            slidesource.Paragraph = slides [m].loparagraph;
                        }
                        if (slides [m].loimage != null)
                        {
                            slidesource.ImageUrl = slides [m].loimage;
                        }
                        if (slides [m].lotext != null)
                        {
                            slidesource.Paragraph = slides [m].lotext;
                        }
                        if (slides [m].loauthor != null)
                        {
                            slidesource.Author = slides [m].loauthor;
                        }
                        if (slides [m].lovideo != null)
                        {
                            slidesource.VideoUrl = slides [m].lovideo;
                        }

                        var c_slide = slides [m];


                        if (c_slide.loitemize != null)
                        {
                            slidesource.Itemize = new ObservableCollection <LOItemSource> ();
                            var items = c_slide.loitemize.loitem;

                            for (int n = 0; n < items.Count; n++)
                            {
                                LOItemSource item = new LOItemSource();
                                if (items [n].loimage != null)
                                {
                                    item.ImageUrl = items [n].loimage;
                                }
                                if (items [n].lotext != null)
                                {
                                    item.Text = items [n].lotext;
                                }


                                var c_item_ize = items [n];

                                slidesource.Itemize.Add(item);
                            }
                        }



                        slidesource.title_page = front.Title;
                        linearScroll.AddView(slidesource.getViewSlide());                                          //Toda la info menos la descripcion
                    }

                    scrollPager.VerticalScrollBarEnabled = false;
                    if (k == 0)
                    {
                        scrollPager.AddView(linearScroll);
                        listaScroll.Add(scrollPager);
                        indice++;
                    }


                    //	}
                }

                //}
            }
            else
            {
                Console.WriteLine("ERROR");
            }


            mainLayoutPages.RemoveAllViews();
            mainLayoutPages.AddView(viewPager);
            mainLayoutPages.SetX(0);
            mainLayoutPages.SetY(0);
            _mainLayout.AddView(mainLayoutPages);

            _publicidadLayout = new LinearLayout(this);
            _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));
                }
            };


            LOViewAdapter adapter = new LOViewAdapter(this, listaScroll);

            viewPager.Adapter = adapter;
            //viewPager.CurrentItem = IndiceSection;
            //viewPager.SetCurrentItem (vm._currentSection, true);
        }
Exemple #3
0
		protected override void OnCreate(Bundle bundle)
		{
			this.Window.AddFlags(WindowManagerFlags.Fullscreen);
			base.OnCreate(bundle);
			SetContentView(Resource.Layout.MainView);
			player = new Android.Media.MediaPlayer();
			_currentCurso = 0;
			_lectorOpen = false;
			_mapOpen = false;
			_playerOn = false;
			_isHome = false;


			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header1.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header2.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header3.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header4.png")));

			drBack = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondocondiagonalm.png"), 640, 1136, true));

			vm = this.ViewModel as MainViewModel;

			lo = new WallView(this);
			frontView = new frontView (this);
			lector = new FrontContainerViewPager (this);
			//map = new MapView (this);


			frontView._listLinearItem [0].Click += delegate {showRutas ();};
			frontView._listLinearItem [1].Click += delegate {showServicios ();};
			frontView._listLinearItem [2].Click += delegate {showGuiaSilvestre ();};
			frontView._listLinearItem [3].Click += delegate {showCifras ();};


			LinearLayout linearMainLayout = FindViewById<LinearLayout>(Resource.Id.left_drawer);

			var metrics = Resources.DisplayMetrics;
			widthInDp = ((int)metrics.WidthPixels);
			heightInDp = ((int)metrics.HeightPixels);
			Configuration.setWidthPixel (widthInDp);
			Configuration.setHeigthPixel (heightInDp);

			pausePlayer = Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/pause.png"),Configuration.getWidth(60),Configuration.getWidth(60),true);

			task = new TaskView (this);


			initRutas ();
			initLinearInfo ();
			iniMenu ();

			mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
			SetSupportActionBar(mToolbar);
			mToolbar.SetNavigationIcon (Resource.Drawable.transparent);

			mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			mLeftDrawer = FindViewById<LinearLayout>(Resource.Id.left_drawer);
			//mRightDrawer = FindViewById<LinearLayout>(Resource.Id.right_drawer);

			mLeftDrawer.Tag = 0;
			//mRightDrawer.Tag = 1;

			frameLayout = FindViewById<FrameLayout> (Resource.Id.content_frame);

			main_ContentView = new RelativeLayout (this);
			main_ContentView.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);


			lo.header.SetBackgroundDrawable (headersDR[1]);
			main_ContentView.AddView (lo);
			lo.getWorkSpaceLayout.AddView (frontView);

			frameLayout.AddView (main_ContentView);


			//RL.SetBackgroundDrawable (dr);

			//seting up chat view content

			//title_view = FindViewById<TextView> (Resource.Id.chat_view_title);




			linearMainLayout.AddView (mainLayout);

			vm.PropertyChanged += new PropertyChangedEventHandler(logout_propertyChanged);

			RegisterWithGCM();

			mDrawerToggle = new MyActionBarDrawerToggle(
				this,							//Host Activity
				mDrawerLayout,					//DrawerLayout
				Resource.String.openDrawer,		//Opened Message
				Resource.String.closeDrawer		//Closed Message
			);

			mDrawerLayout.SetDrawerListener(mDrawerToggle);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled(false);

			mDrawerToggle.SyncState();

			if (bundle != null)
			{
				if (bundle.GetString("DrawerState") == "Opened")
				{
					SupportActionBar.SetTitle(Resource.String.openDrawer);
				}

				else
				{
					SupportActionBar.SetTitle(Resource.String.closeDrawer);
				}
			}
			else
			{
				SupportActionBar.SetTitle(Resource.String.closeDrawer);
			}


			initListCursos ();
			initListTaskTop ();
			initListTaskBotton ();

			viewPager = new ViewPager (this);

			viewPager.SetOnPageChangeListener (new MyPageChangeListenerPager (this, listFrontPager));


		}
Exemple #4
0
        void LoadPagesDataSource()
        {
            //LOViewModel vm = ViewModel as LOViewModel;
            //var styles = new StyleConstants();
            //vm.IsLoading.Execute(null);
            bool is_main = true;
            int  space   = Configuration.getWidth(30);
            //	for (int i = 0; i < 3; i++)
            //	{
            var s_listp = vm.LOsInCircle[vm._currentUnidad].stack.StacksList;
            int indice  = 0;

            if (s_listp != null)
            {
                for (int j = 0; j < s_listp.Count; j++)
                {
                    for (int k = 0; k < s_listp [j].PagesList.Count; k++)
                    {
                        VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this);
                        scrollPager.setOnScrollViewListener(this);
                        LinearLayout linearScroll = new LinearLayout(this);
                        linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
                        linearScroll.Orientation      = Orientation.Vertical;

                        var content = s_listp [j].PagesList [k].content;
                        FrontContainerViewPager front = new FrontContainerViewPager(this);
                        front.Tag = "pager";


                        front.ImageChapter = s_listp [j].PagesList [k].page.url_img;


                        front.Title       = s_listp [j].PagesList [k].page.title;
                        front.Description = s_listp [j].PagesList [k].page.description;
                        var slides = s_listp [j].PagesList [k].content.lopage.loslide;
                        front.setBack(drBack);


                        linearScroll.AddView(front);

                        LinearLayout descriptionLayout = new LinearLayout(this);
                        descriptionLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);

                        descriptionLayout.Orientation = Orientation.Vertical;

                        int padW = Configuration.getWidth(30);
                        int padH = Configuration.getHeight(30);

                        descriptionLayout.SetPadding(padW, 0, padW, 0);


                        TextView titulo_detalle = new TextView(this);
                        titulo_detalle.Text     = "Descripción";
                        titulo_detalle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
                        titulo_detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(38));
                        titulo_detalle.SetTextColor(Color.ParseColor(Configuration.ListaColores [indice % 6]));
                        descriptionLayout.AddView(titulo_detalle);

                        TextView detalle = new TextView(this);
                        detalle.TextFormatted = Html.FromHtml(slides[0].loparagraph);
                        detalle.Typeface      = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf");
                        detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(32));
                        descriptionLayout.AddView(detalle);



                        ViewTreeObserver vto = detalle.ViewTreeObserver;
                        int H = 0;
                        vto.GlobalLayout += (sender, args) => {
                            H = detalle.Height;
                            detalle.LayoutParameters.Height = H - Configuration.getHeight(50);
                        };


                        LinearLayout separationLinear = new LinearLayout(this);
                        separationLinear.LayoutParameters = new LinearLayout.LayoutParams(-1, 5);
                        separationLinear.SetBackgroundColor(Color.ParseColor("#D8D8D8"));
                        separationLinear.Orientation = Orientation.Horizontal;

                        linearScroll.AddView(descriptionLayout);
                        linearScroll.AddView(separationLinear);

                        separationLinear.SetPadding(0, padH, 0, padH);


                        listFrontPager.Add(front);

                        var currentpage = s_listp [j].PagesList [k];



                        for (int m = 1; m < slides.Count; m++)
                        {
                            LOSlideSource slidesource = new LOSlideSource(this);

                            var _id_ = vm.LOsInCircle [vm._currentUnidad].lo.color_id;
                            is_main = !is_main;


                            slidesource.ColorS = Configuration.ListaColores [indice % 6];

                            slidesource.Type = slides [m].lotype;
                            if (slides [m].lotitle != null)
                            {
                                slidesource.Title = slides [m].lotitle;
                            }
                            if (slides [m].loparagraph != null)
                            {
                                slidesource.Paragraph = slides [m].loparagraph;
                            }
                            if (slides [m].loimage != null)
                            {
                                slidesource.ImageUrl = slides [m].loimage;
                            }
                            if (slides [m].lotext != null)
                            {
                                slidesource.Paragraph = slides [m].lotext;
                            }
                            if (slides [m].loauthor != null)
                            {
                                slidesource.Author = slides [m].loauthor;
                            }
                            if (slides [m].lovideo != null)
                            {
                                slidesource.VideoUrl = slides [m].lovideo;
                            }

                            var c_slide = slides [m];


                            if (c_slide.loitemize != null)
                            {
                                slidesource.Itemize = new ObservableCollection <LOItemSource> ();
                                var items = c_slide.loitemize.loitem;

                                for (int n = 0; n < items.Count; n++)
                                {
                                    LOItemSource item = new LOItemSource();
                                    if (items [n].loimage != null)
                                    {
                                        item.ImageUrl = items [n].loimage;
                                    }
                                    if (items [n].lotext != null)
                                    {
                                        item.Text = items [n].lotext;
                                    }


                                    var c_item_ize = items [n];

                                    slidesource.Itemize.Add(item);
                                }
                            }



                            linearScroll.AddView(slidesource.getViewSlide());
                        }


                        //linearScroll.SetPadding (padW,padH,padW,padH);

                        scrollPager.VerticalScrollBarEnabled = false;
                        if (k == 0)
                        {
                            scrollPager.AddView(linearScroll);
                            listaScroll.Add(scrollPager);
                            indice++;
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("ERROR");
            }



            //	}
            mainLayoutPages.RemoveAllViews();
            //_progresD.Hide ();
            mainLayoutPages.AddView(viewPager);
            mainLayoutPages.SetX(0);
            mainLayoutPages.SetY(0);
            _mainLayout.AddView(mainLayoutPages);

            _publicidadLayout = new LinearLayout(this);
            _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));
                }
            };


            LOViewAdapter adapter = new LOViewAdapter(this, listaScroll);

            viewPager.Adapter = adapter;
            //viewPager.CurrentItem = IndiceSection;
            viewPager.SetCurrentItem(vm._currentSection, true);
        }
Exemple #5
0
		void LoadPagesDataSource()
		{


			//LOViewModel vm = ViewModel as LOViewModel;
			//var styles = new StyleConstants();
			//vm.IsLoading.Execute(null);
			bool is_main = true;

			for (int i = 0; i < vm.LOsInCircle.Count; i++)
			{
				var s_list = vm.LOsInCircle[i].stack.StacksList;
				//if (Configuration.IndiceActual == i) {
				int indice = 0;
				for (int j = 0; j < s_list.Count; j++) {						



					for (int k = 0; k < s_list [j].PagesList.Count; k++) {
						VerticalScrollViewPager scrollPager = new VerticalScrollViewPager (this);
						scrollPager.setOnScrollViewListener (this); 
						LinearLayout linearScroll = new LinearLayout (this);
						linearScroll.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
						linearScroll.Orientation = Orientation.Vertical;
						//LOPageSource page = new LOPageSource();
						var content = s_list [j].PagesList [k].content;
						FrontContainerViewPager front = new FrontContainerViewPager (this);
						front.Tag = "pager";

						//front.ImageChapter = vm.LOsInCircle [i].lo.url_background;
						front.ImageChapter = s_list [j].PagesList[k].page.url_img;
						/*
						Bitmap bm = BitmapFactory.DecodeByteArray (s_list [j].PagesList [k].cover_bytes, 0, s_list [j].PagesList [k].cover_bytes.Length);
						front.ImageChapterBitmap = bm;
						bm = null;
						*/

						front.Title = s_list [j].PagesList [k].page.title;
						front.Description =  s_list [j].PagesList [k].page.description;
						var slides = s_list [j].PagesList [k].content.lopage.loslide;
						front.setBack (drBack);

						//revisar si slides == null;

						//vm.OpenPageCommand.Execute (s_list [j].PagesList [k]);
						//var slides2 = s_list [j].PagesList [k].content.lopage.loslide.
						linearScroll.AddView (front);
						listFrontPager.Add (front);
						//listFrontPager [i].setBack (drBack);
						//vm.OpenPageCommand.Execute(s_list[j].PagesList[k]);
						var currentpage = s_list [j].PagesList [k];
						//var pagerr = s_list[j].PagesList[k].content.lopage.loslide

						for (int m = 1; m < slides.Count; m++) {
							LOSlideSource slidesource = new LOSlideSource(this);

							var _id_ = vm.LOsInCircle [i].lo.color_id;
							is_main = !is_main;
							//Console.WriteLine ("TIPOOOOOOOOOO = " + slides [m].lotype);	

							slidesource.ColorS = Configuration.ListaColores [indice % 6];

							slidesource.Type = slides[m].lotype;
							if (slides[m].lotitle != null) slidesource.Title = slides[m].lotitle;
							if (slides[m].loparagraph != null) slidesource.Paragraph = slides[m].loparagraph;
							if (slides[m].loimage != null) slidesource.ImageUrl = slides[m].loimage;
							if (slides[m].lotext != null) slidesource.Paragraph = slides[m].lotext;
							if (slides[m].loauthor != null) slidesource.Author = slides[m].loauthor;
							if (slides[m].lovideo != null) slidesource.VideoUrl = slides[m].lovideo;
							//if (slides[m].image_bytes != null) slidesource.ImageBytes = slides[m].image_bytes; 


							var c_slide = slides[m];
							/*
							c_slide.PropertyChanged+=(s,e)=>{
								if (e.PropertyName == "image_bytes" && c_slide.image_bytes != null)
									slidesource.ImageBytes = c_slide.image_bytes; 
							};
							*/

							if (c_slide.loitemize != null){
								slidesource.Itemize = new ObservableCollection<LOItemSource>();
								var items = c_slide.loitemize.loitem;
								for (int n = 0; n < items.Count; n++){ 
									LOItemSource item = new LOItemSource();
									if (items[n].loimage != null) item.ImageUrl = items[n].loimage;
									if (items[n].lotext!= null) item.Text = items[n].lotext;
									//imagebytes
									//if (items[n].image_bytes != null) item.ImageBytes = items[n].image_bytes; 

									var c_item_ize = items[n];
									/*
									c_item_ize.PropertyChanged += (s1, e1) =>{
										if (e1.PropertyName == "image_bytes" && c_item_ize.image_bytes != null)
											item.ImageBytes = c_item_ize.image_bytes; 

										
									};
									*/
									slidesource.Itemize.Add(item);
								}
							}

							linearScroll.AddView (slidesource.getViewSlide());

						} 
						scrollPager.VerticalScrollBarEnabled = false;
						scrollPager.AddView (linearScroll);
						listaScroll.Add (scrollPager);
						indice++;
					}


					//}

				}

				//}

			}
			mainLayoutPages.RemoveAllViews ();
			//_progresD.Hide ();
			mainLayoutPages.AddView (viewPager);
			mainLayoutPages.SetX (0);
			mainLayoutPages.SetY (0);
			mainLayout.AddView (mainLayoutPages);
			LOViewAdapter adapter = new LOViewAdapter (this, listaScroll);
			viewPager.Adapter = adapter;
			viewPager.CurrentItem = IndiceSection;

		}
Exemple #6
0
        void LoadPagesDataSource()
        {
            //LOViewModel vm = ViewModel as LOViewModel;
            //var styles = new StyleConstants();
            //vm.IsLoading.Execute(null);
            bool is_main = true;

            for (int i = 0; i < vm.LOsInCircle.Count; i++)
            {
                var s_listp = vm.LOsInCircle[i].stack.StacksList;
                int indice  = 0;

                if (s_listp != null)
                {
                    for (int j = 0; j < s_listp.Count; j++)
                    {
                        for (int k = 0; k < s_listp [j].PagesList.Count; k++)
                        {
                            VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this);
                            scrollPager.setOnScrollViewListener(this);
                            LinearLayout linearScroll = new LinearLayout(this);
                            linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);
                            linearScroll.Orientation      = Orientation.Vertical;

                            var content = s_listp [j].PagesList [k].content;
                            FrontContainerViewPager front = new FrontContainerViewPager(this);
                            front.Tag = "pager";


                            front.ImageChapter = s_listp [j].PagesList [k].page.url_img;


                            front.Title       = s_listp [j].PagesList [k].page.title;
                            front.Description = s_listp [j].PagesList [k].page.description;
                            var slides = s_listp [j].PagesList [k].content.lopage.loslide;
                            front.setBack(drBack);


                            linearScroll.AddView(front);
                            listFrontPager.Add(front);

                            var currentpage = s_listp [j].PagesList [k];


                            for (int m = 1; m < slides.Count; m++)
                            {
                                LOSlideSource slidesource = new LOSlideSource(this);

                                var _id_ = vm.LOsInCircle [i].lo.color_id;
                                is_main = !is_main;


                                slidesource.ColorS = Configuration.ListaColores [indice % 6];

                                slidesource.Type = slides [m].lotype;
                                if (slides [m].lotitle != null)
                                {
                                    slidesource.Title = slides [m].lotitle;
                                }
                                if (slides [m].loparagraph != null)
                                {
                                    slidesource.Paragraph = slides [m].loparagraph;
                                }
                                if (slides [m].loimage != null)
                                {
                                    slidesource.ImageUrl = slides [m].loimage;
                                }
                                if (slides [m].lotext != null)
                                {
                                    slidesource.Paragraph = slides [m].lotext;
                                }
                                if (slides [m].loauthor != null)
                                {
                                    slidesource.Author = slides [m].loauthor;
                                }
                                if (slides [m].lovideo != null)
                                {
                                    slidesource.VideoUrl = slides [m].lovideo;
                                }

                                var c_slide = slides [m];


                                if (c_slide.loitemize != null)
                                {
                                    slidesource.Itemize = new ObservableCollection <LOItemSource> ();
                                    var items = c_slide.loitemize.loitem;

                                    for (int n = 0; n < items.Count; n++)
                                    {
                                        LOItemSource item = new LOItemSource();
                                        if (items [n].loimage != null)
                                        {
                                            item.ImageUrl = items [n].loimage;
                                        }
                                        if (items [n].lotext != null)
                                        {
                                            item.Text = items [n].lotext;
                                        }


                                        var c_item_ize = items [n];

                                        slidesource.Itemize.Add(item);
                                    }
                                }


                                linearScroll.AddView(slidesource.getViewSlide());
                            }

                            scrollPager.VerticalScrollBarEnabled = false;
                            if (k == 0)
                            {
                                scrollPager.AddView(linearScroll);
                                listaScroll.Add(scrollPager);
                                indice++;
                            }
                        }
                    }
                }
                else
                {
                    Console.WriteLine("ERROR");
                }
            }
            mainLayoutPages.RemoveAllViews();
            //_progresD.Hide ();
            mainLayoutPages.AddView(viewPager);
            mainLayoutPages.SetX(0);
            mainLayoutPages.SetY(0);
            _mainLayout.AddView(mainLayoutPages);
            LOViewAdapter adapter = new LOViewAdapter(this, listaScroll);

            viewPager.Adapter     = adapter;
            viewPager.CurrentItem = IndiceSection;
        }
Exemple #7
0
		void LoadPagesDataSource()
		{


			//LOViewModel vm = ViewModel as LOViewModel;
			//var styles = new StyleConstants();
			//vm.IsLoading.Execute(null);
			bool is_main = true;

			for (int i = 0; i < vm.LOsInCircle.Count; i++)
			{
				var s_listp = vm.LOsInCircle[i].stack.StacksList;
				int indice = 0;

				if (s_listp != null) {
					for (int j = 0; j < s_listp.Count; j++) {						

						for (int k = 0; k < s_listp [j].PagesList.Count; k++) {

							VerticalScrollViewPager scrollPager = new VerticalScrollViewPager (this);
							scrollPager.setOnScrollViewListener (this); 
							LinearLayout linearScroll = new LinearLayout (this);
							linearScroll.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
							linearScroll.Orientation = Orientation.Vertical;

							var content = s_listp [j].PagesList [k].content;
							FrontContainerViewPager front = new FrontContainerViewPager (this);
							front.Tag = "pager";


							front.ImageChapter = s_listp [j].PagesList [k].page.url_img;


							front.Title = s_listp [j].PagesList [k].page.title;
							front.Description = s_listp [j].PagesList [k].page.description;
							var slides = s_listp [j].PagesList [k].content.lopage.loslide;
							front.setBack (drBack);


							linearScroll.AddView (front);
							listFrontPager.Add (front);

							var currentpage = s_listp [j].PagesList [k];


							for (int m = 1; m < slides.Count; m++) {
								LOSlideSource slidesource = new LOSlideSource (this);

								var _id_ = vm.LOsInCircle [i].lo.color_id;
								is_main = !is_main;


								slidesource.ColorS = Configuration.ListaColores [indice % 6];

								slidesource.Type = slides [m].lotype;
								if (slides [m].lotitle != null)
									slidesource.Title = slides [m].lotitle;
								if (slides [m].loparagraph != null)
									slidesource.Paragraph = slides [m].loparagraph;
								if (slides [m].loimage != null)
									slidesource.ImageUrl = slides [m].loimage;
								if (slides [m].lotext != null)
									slidesource.Paragraph = slides [m].lotext;
								if (slides [m].loauthor != null)
									slidesource.Author = slides [m].loauthor;
								if (slides [m].lovideo != null)
									slidesource.VideoUrl = slides [m].lovideo;

								var c_slide = slides [m];


								if (c_slide.loitemize != null) {
									slidesource.Itemize = new ObservableCollection<LOItemSource> ();
									var items = c_slide.loitemize.loitem;

									for (int n = 0; n < items.Count; n++) { 
										LOItemSource item = new LOItemSource ();
										if (items [n].loimage != null)
											item.ImageUrl = items [n].loimage;
										if (items [n].lotext != null)
											item.Text = items [n].lotext;


										var c_item_ize = items [n];

										slidesource.Itemize.Add (item);
									}
								}


								linearScroll.AddView (slidesource.getViewSlide ());


							} 

							scrollPager.VerticalScrollBarEnabled = false;
							if (k == 0) {
								scrollPager.AddView (linearScroll);
								listaScroll.Add (scrollPager);
								indice++;
							}



						}

					}




				} else {
					Console.WriteLine ("ERROR");
				}



			}
			mainLayoutPages.RemoveAllViews ();
			//_progresD.Hide ();
			mainLayoutPages.AddView (viewPager);
			mainLayoutPages.SetX (0);
			mainLayoutPages.SetY (0);
			_mainLayout.AddView (mainLayoutPages);
			LOViewAdapter adapter = new LOViewAdapter (this, listaScroll);
			viewPager.Adapter = adapter;
			viewPager.CurrentItem = IndiceSection;

		}