void loadLOsInCircle(int index) { //var vm = this.ViewModel as LOViewModel; if (vm.LOsInCircle != null) { for (int i = 0; i < vm.LOsInCircle.Count; i++) { VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this); scrollPager.setOnScrollViewListener(this); LinearLayout linearScroll = new LinearLayout(this); linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearScroll.Orientation = Orientation.Vertical; // if(Configuration.IndiceActual==i){ FrontContainerView front = new FrontContainerView(this); front.Tag = "indice"; front.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; front.Chapter = vm.LOsInCircle [i].lo.description; front.NameLO = vm.LOsInCircle [i].lo.title; front.Like = "10"; front.ImageChapter = vm.LOsInCircle [i].lo.url_background; listFront.Add(front); listFront [i].setBack(drBack, bmLike); /* * if (vm.LOsInCircle [i].background_bytes != null) { * Bitmap bm = BitmapFactory.DecodeByteArray (vm.LOsInCircle [i].background_bytes, 0, vm.LOsInCircle [i].background_bytes.Length); * * front.ImageChapterBitmap = bm; * bm = null; * } */ vm.LOsInCircle[i].PropertyChanged += (s1, e1) => { if (e1.PropertyName == "background_bytes") { /* * Bitmap bm = BitmapFactory.DecodeByteArray (vm.LOsInCircle [i].background_bytes, 0, vm.LOsInCircle [i].background_bytes.Length); * front.ImageChapterBitmap = bm; * bm = null; */ front.ImageChapter = vm.LOsInCircle [i].lo.url_background; } }; linearScroll.AddView(front); if (vm.LOsInCircle [i].stack.IsLoaded) { var s_list = vm.LOsInCircle [i].stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView(this); section.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap(bm_user); section.Image = s_list [j].PagesList [k].page.url_img; /* * if (s_list [j].PagesList [k].cover_bytes != null) { * Bitmap bm = BitmapFactory.DecodeByteArray (s_list [j].PagesList [k].cover_bytes, 0, s_list [j].PagesList[k].cover_bytes.Length); * section.ImageBitmap = bm; * bm = null; * } */ section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem = IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView(section); indice++; } } } else { vm.LOsInCircle [i].stack.PropertyChanged += (s3, e3) => { var s_list = vm.LOsInCircle [i].stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView(this); section.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap(bm_user); section.Image = s_list [j].PagesList [k].page.url_img; section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem = IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView(section); indice++; } } }; } scrollPager.VerticalScrollBarEnabled = false; scrollPager.AddView(linearScroll); listaScrollIni.Add(scrollPager); } mainLayoutIndice.RemoveAllViews(); //_progresD.Hide (); mainLayoutIndice.AddView(viewPagerIni); mainLayoutIndice.SetX(0); mainLayoutIndice.SetY(0); //mainLayout.AddView (mainLayoutIndice); LOViewAdapter adapter = new LOViewAdapter(this, listaScrollIni); viewPagerIni.Adapter = adapter; //viewPager.CurrentItem = IndiceSection; } }
void loadLOsInCircle(int index){ //var vm = this.ViewModel as LOViewModel; if (vm.LOsInCircle != null) { for (int i = 0; i < vm.LOsInCircle.Count; i++) { VerticalScrollViewPager scrollPager = new VerticalScrollViewPager (this); scrollPager.setOnScrollViewListener (this); LinearLayout linearScroll = new LinearLayout (this); linearScroll.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearScroll.Orientation = Orientation.Vertical; // if(Configuration.IndiceActual==i){ FrontContainerView front = new FrontContainerView (this); front.Tag = "indice"; front.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; front.Chapter = vm.LOsInCircle [i].lo.description; front.NameLO = vm.LOsInCircle [i].lo.title; front.Like = "10"; front.ImageChapter = vm.LOsInCircle [i].lo.url_background; listFront.Add (front); listFront [i].setBack (drBack,bmLike); /* if (vm.LOsInCircle [i].background_bytes != null) { Bitmap bm = BitmapFactory.DecodeByteArray (vm.LOsInCircle [i].background_bytes, 0, vm.LOsInCircle [i].background_bytes.Length); front.ImageChapterBitmap = bm; bm = null; } */ vm.LOsInCircle[i].PropertyChanged += (s1, e1) => { if (e1.PropertyName == "background_bytes") { /* Bitmap bm = BitmapFactory.DecodeByteArray (vm.LOsInCircle [i].background_bytes, 0, vm.LOsInCircle [i].background_bytes.Length); front.ImageChapterBitmap = bm; bm = null; */ front.ImageChapter = vm.LOsInCircle [i].lo.url_background; } }; linearScroll.AddView (front); if (vm.LOsInCircle [i].stack.IsLoaded) { var s_list = vm.LOsInCircle [i].stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView (this); section.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap (bm_user); section.Image = s_list [j].PagesList [k].page.url_img; /* if (s_list [j].PagesList [k].cover_bytes != null) { Bitmap bm = BitmapFactory.DecodeByteArray (s_list [j].PagesList [k].cover_bytes, 0, s_list [j].PagesList[k].cover_bytes.Length); section.ImageBitmap = bm; bm = null; } */ section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem= IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView (section); indice++; } } } else { vm.LOsInCircle [i].stack.PropertyChanged+= (s3, e3) => { var s_list = vm.LOsInCircle [i].stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView (this); section.Author = vm.LOsInCircle [i].lo.name + " " + vm.LOsInCircle [i].lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap (bm_user); section.Image = s_list [j].PagesList [k].page.url_img; section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem= IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView (section); indice++; } } }; } scrollPager.VerticalScrollBarEnabled = false; scrollPager.AddView (linearScroll); listaScrollIni.Add (scrollPager); } mainLayoutIndice.RemoveAllViews (); //_progresD.Hide (); mainLayoutIndice.AddView (viewPagerIni); mainLayoutIndice.SetX (0); mainLayoutIndice.SetY (0); //mainLayout.AddView (mainLayoutIndice); LOViewAdapter adapter = new LOViewAdapter (this, listaScrollIni); viewPagerIni.Adapter = adapter; //viewPager.CurrentItem = IndiceSection; } }
void Vm_LOsInCircle_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { //loadLOsInCircle (e.NewStartingIndex); if (e.NewItems != null) { int i = 0; foreach (LOViewModel.lo_by_circle_wrapper lobycircle in e.NewItems) { VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this); scrollPager.setOnScrollViewListener(this); LinearLayout linearScroll = new LinearLayout(this); linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearScroll.Orientation = Orientation.Vertical; // if(Configuration.IndiceActual==i){ FrontContainerView front = new FrontContainerView(this); front.Tag = "indice"; front.Author = lobycircle.lo.name + " " + vm.LOsInCircle [i].lo.lastname; front.Chapter = lobycircle.lo.description; front.NameLO = lobycircle.lo.title; front.Like = "10"; front.ImageChapter = lobycircle.lo.url_background; listFront.Add(front); listFront [i].setBack(drBack, bmLike); lobycircle.PropertyChanged += (s1, e1) => { if (e1.PropertyName == "background_bytes") { front.ImageChapter = lobycircle.lo.url_background; } }; linearScroll.AddView(front); if (lobycircle.stack.IsLoaded) { var s_list = lobycircle.stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView(this); section.Author = lobycircle.lo.name + " " + lobycircle.lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap(bm_user); section.Image = s_list [j].PagesList [k].page.url_img; section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem = IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView(section); indice++; } } } scrollPager.VerticalScrollBarEnabled = false; scrollPager.AddView(linearScroll); listaScrollIni.Add(scrollPager); i++; } mainLayoutIndice.RemoveAllViews(); //_progresD.Hide (); mainLayoutIndice.AddView(viewPagerIni); mainLayoutIndice.SetX(0); mainLayoutIndice.SetY(0); //mainLayout.AddView (mainLayoutIndice); LOViewAdapter adapter = new LOViewAdapter(this, listaScrollIni); viewPagerIni.Adapter = adapter; } }
void Vm_LOsInCircle_CollectionChanged (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { //loadLOsInCircle (e.NewStartingIndex); if (e.NewItems != null) { int i = 0; foreach (LOViewModel.lo_by_circle_wrapper lobycircle in e.NewItems) { VerticalScrollViewPager scrollPager = new VerticalScrollViewPager (this); scrollPager.setOnScrollViewListener (this); LinearLayout linearScroll = new LinearLayout (this); linearScroll.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearScroll.Orientation = Orientation.Vertical; // if(Configuration.IndiceActual==i){ FrontContainerView front = new FrontContainerView (this); front.Tag = "indice"; front.Author = lobycircle.lo.name + " " + vm.LOsInCircle [i].lo.lastname; front.Chapter = lobycircle.lo.description; front.NameLO = lobycircle.lo.title; front.Like = "10"; front.ImageChapter = lobycircle.lo.url_background; listFront.Add (front); listFront [i].setBack (drBack,bmLike); lobycircle.PropertyChanged += (s1, e1) => { if (e1.PropertyName == "background_bytes") { front.ImageChapter = lobycircle.lo.url_background; } }; linearScroll.AddView (front); if (lobycircle.stack.IsLoaded) { var s_list = lobycircle.stack.StacksList; int indice = 0; for (int j = 0; j < s_list.Count; j++) { for (int k = 0; k < s_list [j].PagesList.Count; k++) { ChapterContainerView section = new ChapterContainerView (this); section.Author = lobycircle.lo.name + " " + lobycircle.lo.lastname; section.Title = s_list [j].PagesList [k].page.title; section.Container = s_list [j].PagesList [k].page.description; section.ColorText = Configuration.ListaColores [indice % 6]; section.setDefaultProfileUserBitmap (bm_user); section.Image = s_list [j].PagesList [k].page.url_img; section.Indice = indice; section.Click += delegate { IndiceSection = section.Indice; mainLayoutIndice.Visibility = ViewStates.Invisible; if (ISLOADED == false) { LoadPagesDataSource(); } else { viewPager.CurrentItem= IndiceSection; mainLayoutPages.Visibility = ViewStates.Visible; mainLayoutIndice.Visibility = ViewStates.Invisible; } }; linearScroll.AddView (section); indice++; } } } scrollPager.VerticalScrollBarEnabled = false; scrollPager.AddView (linearScroll); listaScrollIni.Add (scrollPager); i++; } mainLayoutIndice.RemoveAllViews (); //_progresD.Hide (); mainLayoutIndice.AddView (viewPagerIni); mainLayoutIndice.SetX (0); mainLayoutIndice.SetY (0); //mainLayout.AddView (mainLayoutIndice); LOViewAdapter adapter = new LOViewAdapter (this, listaScrollIni); viewPagerIni.Adapter = adapter; } }