private void SetWheelView() { if (MainActivity.Choices.Count == 0) { var toast = Toast.MakeText(this, "Really no choices? I don't believe you ! Go back and fill in them! ", ToastLength.Long); toast.SetGravity(GravityFlags.Top, 0, 250); WheelPicker.Visibility = ViewStates.Invisible; DecideView.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.CantDecide)); toast.Show(); return; } WheelPicker.Data = MainActivity.Choices; WheelPicker.Curved = true; WheelPicker.Cyclic = true; WheelPicker.SetIndicator(true); WheelPicker.ItemTextColor = Color.LightBlue.ToArgb(); WheelPicker.CurtainColor = Color.Transparent.ToArgb(); WheelPicker.SelectedItemTextColor = Color.DarkOrchid.ToArgb(); WheelPicker.SetBackgroundColor(Android.Graphics.Color.Honeydew); WheelPicker.SetCurtain(true); WheelPicker.ItemSelected += WheelPicker_ItemSelected; }
private void Initialize() { LinearLayout container = new LinearLayout(Context); container.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.FillParent, LayoutParams.FillParent); container.Orientation = Orientation.Horizontal; mContainer = container; var lLayout = new LinearLayout(Context); var lytParams = new LinearLayout.LayoutParams(LayoutParams.FillParent, LayoutParams.FillParent); lytParams.SetMargins(0, 0, 0, 0); lLayout.LayoutParameters = lytParams; lLayout.Orientation = Orientation.Horizontal; //lLayout.SetBackgroundColor (Color.Red); if (DSToolbarTheme.CurrentTheme.Color != null) { var ptn = DSToolbarTheme.CurrentTheme.Color.ToAndroidColorDrawable(); lLayout.SetBackgroundDrawable(ptn); } mContentView = lLayout; mContainer.AddView(lLayout); this.AddView(mContainer); }
private void initUi() { _mainLayout = new RelativeLayout(context); _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); _scrollItems = new VerticalScrollView(context); _scrollItems.LayoutParameters = new VerticalScrollView.LayoutParams(-1, Configuration.getHeight(965)); _scrollItems.SetY(Configuration.getHeight(125)); initItems(); _scrollItems.AddView(_linearContentLayout); _mainLayout.AddView(_scrollItems); _publicidadLayout = new LinearLayout(context); _publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(85)); Drawable dr = new BitmapDrawable(getBitmapFromAsset("images/footerad.jpg")); _publicidadLayout.SetBackgroundDrawable(dr); _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)); } }; }
public void setBack(Drawable dr, Bitmap bm) { //drBack = dr; linearContainerFisrst.SetBackgroundDrawable(dr); //Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true) imgHeart.SetImageBitmap(bm); }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { var bitmap = e.LoadedImage; if (_linStructuredPlanRelationshipsMain != null) { _linStructuredPlanRelationshipsMain.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { var bitmap = e.LoadedImage; if (_automaticThoughtsRoot != null) { _automaticThoughtsRoot.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { var bitmap = e.LoadedImage; if (_linList != null) { _linList.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { var bitmap = e.LoadedImage; if (_alternativeThoughtsMain != null) { _alternativeThoughtsMain.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { var bitmap = e.LoadedImage; if (_problemSolvingReviewScrollerContainer != null) { _problemSolvingReviewScrollerContainer.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } }
public static void addBorderNoRadius(LinearLayout lc) { Random random = new Random(); GradientDrawable gd = new GradientDrawable(); //gd.SetColor(Color.Rgb(random.Next(100, 150), random.Next(100, 150), random.Next(100, 150))); gd.SetCornerRadius(0); gd.SetStroke(1, Color.White); lc.SetBackgroundDrawable(gd); }
private static void Initialize(FrameLayout rootView) { var layoutParent = new LinearLayout(_activity.ApplicationContext); _layoutCenter = new LinearLayout(_activity.ApplicationContext); _layoutImage = new LinearLayout(_activity.ApplicationContext); var layoutParentParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layoutParent.LayoutParameters = layoutParentParameters; layoutParent.SetBackgroundDrawable(_activity.Resources.GetDrawable(Resource.Drawable.loading_overlay)); var layoutCenterParameters = new LinearLayout.LayoutParams(-2, 0); layoutCenterParameters.Weight = 1.0f; layoutCenterParameters.SetMargins(0, 0, 0, 0); layoutCenterParameters.Gravity = GravityFlags.CenterVertical; var layoutImageParameters = new LinearLayout.LayoutParams(-1, -1); layoutCenterParameters.Weight = 1.0f; layoutCenterParameters.SetMargins(0, 0, 0, 0); _layoutCenter.LayoutParameters = layoutCenterParameters; _layoutCenter.SetBackgroundColor(Android.Graphics.Color.White); _layoutImage.LayoutParameters = layoutImageParameters; _layoutCenter.AddView(_layoutImage); layoutParent.AddView(_layoutCenter); rootView.AddView(layoutParent, layoutParentParameters); layoutParent.BringToFront(); _layoutCenter.ClearAnimation(); _layoutImage.SetBackgroundDrawable(null); if (_car == null) { _colorToUse = _activity.Resources.GetColor(Resource.Color.company_color); _car = DrawHelper.ApplyThemeColorToImage(Resource.Drawable.taxi_progress, true, new SizeF(52, 20), Android.Graphics.Color.Argb(255, 0, 122, 255), new System.Drawing.Point(25, 10)); } var displaySize = _activity.Resources.DisplayMetrics; var windowHeight = (int)(_car.Width * 1.5f); _windowSize = new Size(displaySize.WidthPixels, windowHeight); var _radius = _car.Width * 1.3f; _zoneCircle = new RectF((_windowSize.Width * 0.5f) - _radius / 2f, (_windowSize.Height * 0.5f) - _radius / 2f, (_windowSize.Width * 0.5f) + _radius / 2f, (_windowSize.Height * 0.5f) + _radius / 2f); StartAnimationLoop(layoutParent); }
private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e) { if (_isLoadingBackground) { var bitmap = e.LoadedImage; if (_summaryMain != null) { _summaryMain.SetBackgroundDrawable(new BitmapDrawable(bitmap)); } _isLoadingBackground = false; } }
void showAd(int idAd) { adOpen = true; _adLayout = new LinearLayout (context); _adLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (255)); Drawable dr = new BitmapDrawable (getBitmapFromAsset (adsImagesPath[idAd])); _adLayout.SetBackgroundDrawable (dr); _adLayout.SetY (Configuration.getHeight(1136-85-255)); _mainLayout.AddView (_adLayout); _adLayout.Click += delegate { context.StartActivity(Configuration.getOpenFacebookIntent(context,"fb://page/114091405281757","http://www.hi-tec.com/pe/")); }; }
private static async void StartAnimationLoop(LinearLayout overlay) { Progress = 0; _isLoading = true; await Task.Run(async() => { while (_isLoading) { await IncreaseProgressDependingOnCurrentProgress(); } }); Progress = 100; _activity.RunOnUiThread(async() => { try { _layoutImage.SetBackgroundDrawable(GetCircleForProgress()); } catch { } await Task.Delay(500); if (overlay != null) { var root = overlay.Parent as ViewGroup; if (root != null) { root.RemoveView(overlay); } } }); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); linearLayout1 = FindViewById <LinearLayout>(Resource.Id.linearLayout1); _sensorManager = (SensorManager)GetSystemService(Context.SensorService); _sensorTextView = FindViewById <TextView>(Resource.Id.accelerometer_text); Deltas = FindViewById <TextView>(Resource.Id.Deltas); ; button = FindViewById <Button>(Resource.Id.button); button.Click += delegate { linearLayout1.SetBackgroundDrawable(GetDrawable(Resource.Drawable.hap));// @android: drawable / dialog_holo_dark_frame); = Color.Pink; }; }
void showAd(int idAd) { adOpen = true; _adLayout = new LinearLayout(context); _adLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(255)); Drawable dr = new BitmapDrawable(getBitmapFromAsset(adsImagesPath[idAd])); _adLayout.SetBackgroundDrawable(dr); _adLayout.SetY(Configuration.getHeight(1136 - 85 - 255)); _mainLayout.AddView(_adLayout); _adLayout.Click += delegate { context.StartActivity(Configuration.getOpenFacebookIntent(context, "fb://page/114091405281757", "http://www.hi-tec.com/pe/")); }; }
public void DisplayImageLinearLayOut(string url, LinearLayout linearlo, int defaultResourceId) { m_StubID = defaultResourceId; if (m_LinearLayOutViews.ContainsKey(linearlo)) { if (defaultResourceId != -1) { linearlo.SetBackgroundResource(defaultResourceId); } m_LinearLayOutViews.Remove(linearlo); } m_MemoryCache.PopCache(m_MaxImages); //if (m_ImageList.Contains(imageView)) // m_ImageList.Remove(imageView); /*if (m_MemoryCache..Count == 10) * { * var tempImageView = m_ImageList[0]; * tempImageView.SetImageResource(m_StubID); * m_ImageViews.Remove(tempImageView); * m_ImageList.RemoveAt(0); * }*/ m_LinearLayOutViews.Add(linearlo, url); //m_ImageList.Add(imageView); var bitmap = m_MemoryCache.Get(url); if (bitmap != null) { Drawable mDrawable = new BitmapDrawable(bitmap); linearlo.SetBackgroundDrawable(mDrawable); } else { QueueImage(url, linearlo); if (defaultResourceId != -1) { linearlo.SetBackgroundResource(defaultResourceId); } } }
void showAd(int idAd) { adOpen = true; _adLayout = new LinearLayout(context); _adLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(255)); Drawable dr = new BitmapDrawable(getBitmapFromAsset(adsImagesPath[idAd])); _adLayout.SetBackgroundDrawable(dr); _adLayout.SetY(Configuration.getHeight(1136 - 85 - 255)); _mainLayout.AddView(_adLayout); _adLayout.Click += delegate { String url = "https://www.facebook.com/HiTecPe/"; Intent i = new Intent(Intent.ActionView); i.SetData(Android.Net.Uri.Parse(url)); context.StartActivity(i); }; }
/// <summary> /// Adds a default popup and returns the new view. /// </summary> /// <param name="width"></param> /// <param name="height"></param> /// <returns>The view representing the popup.</returns> /// <remarks>Add subviews to the view to show stuff on the marker.</remarks> public LinearLayout AddNewPopup(int width, int height) { var layout = new LinearLayout(_context); // create default ninepatch. var ninepatchImage = global::Android.Graphics.BitmapFactory.DecodeStream( Assembly.GetExecutingAssembly().GetManifestResourceStream( "OsmSharp.Android.UI.Images.marker_popup.9.png")); var ninepatchDrawable = NinePatchChunk.createNinePatchDrawable(this.View.Resources, ninepatchImage, "marker_popup"); layout.SetBackgroundDrawable(ninepatchDrawable); // calculate offset. var xOffset = -(width / 2) + 47; var yOffset = 0; this.AddPopup(layout, width, height, xOffset, yOffset); return(layout); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // set our layout to be the home screen SetContentView(Resource.Layout.NotasScreen); //Find our controls mainLayout = FindViewById<LinearLayout>(Resource.Id.LayoutAllNotas); taskListView = new ListView(this); taskListView.LayoutParameters = new LinearLayout.LayoutParams (-1,-1); //addTaskButton = FindViewById<Button> (Resource.Id.AddButton); // wire up add task button handler /*if(addTaskButton != null) { addTaskButton.Click += (sender, e) => { StartActivity(typeof(NotasItemScreen)); }; }*/ // wire up task click handler if(taskListView != null) { taskListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var taskDetails = new Intent (this, typeof (NotasItemScreen)); taskDetails.PutExtra ("TaskID", tasks[e.Position].ID); StartActivity (taskDetails); Finish(); }; } Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header5.png")); header = new LinearLayout(this); header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125)); header.Orientation = Orientation.Vertical; header.SetBackgroundDrawable (dr); mainLayout.AddView(header); mainLayout.AddView (taskListView); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create your application here SetContentView(Resource.Layout.loading); mainlayout = (LinearLayout)FindViewById(Resource.Id.mainlayout); mSharedPreference = GetSharedPreferences(Constant.Com_Fra, FileCreationMode.WorldWriteable); lodimgsrc = mSharedPreference.GetString(Constant.Lod_Img, ""); if (lodimgsrc != "") { Bitmap bmp = getLoacalBitmap(lodimgsrc); if (bmp != null) { mainlayout.SetBackgroundDrawable(new BitmapDrawable(bmp)); } } else { } mHandler.mcontext = this; //timeoutrunable = new Runnable(() => //{ // isTimeout = true; // Message msg = Message.Obtain(); // msg.What = MSG_INIT_TIMEOUT; // mHandler.SendMessage(msg); //}); //mHandler.PostDelayed(timeoutrunable, 60000); LoadThread loadthread = new LoadThread(); loadthread.context = this; loadthread.Start(); }
private void AddItem(SwipeMenuItem item, int id) { LayoutParams param = new LayoutParams(item.Width, LayoutParams.MatchParent); LinearLayout parent = new LinearLayout(Context); parent.Id = id; parent.SetGravity(GravityFlags.Center); parent.Orientation = global::Android.Widget.Orientation.Vertical; parent.LayoutParameters = param; parent.SetBackgroundDrawable(item.Background); parent.SetOnClickListener(this); AddView(parent); if (item.Icon != null) { parent.AddView(CreateIcon(item)); } if (!String.IsNullOrEmpty(item.Title)) { parent.AddView(CreateTitle(item)); } }
private void initItems() { var textFormat = Android.Util.ComplexUnitType.Px; _linearContentLayout = new LinearLayout(context); _linearContentLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _linearContentLayout.Orientation = Orientation.Vertical; List <string> title = new List <string> (); List <string> type = new List <string> (); List <string> coverImagePath = new List <string> (); List <string> numLikes = new List <string> (); List <string> numTypes = new List <string> (); numLikes.Add("10"); numLikes.Add("10"); numLikes.Add("10"); numLikes.Add("10"); numTypes.Add("3"); numTypes.Add("7"); numTypes.Add("4"); numTypes.Add("9"); title.Add(Resources.GetText(Resource.String.THE_ROUTES)); title.Add(Resources.GetText(Resource.String.TOURIST_SERVICE_GUIDE)); title.Add(Resources.GetText(Resource.String.WILDLIFE_IDENTIFICATION_GUIDE)); title.Add(Resources.GetText(Resource.String.INCA_TRIAL_IN_NUMBERS)); type.Add("rutas"); type.Add("guias"); type.Add("guias"); type.Add("cifras"); coverImagePath.Add("images/fondorutas.png"); coverImagePath.Add("images/fondoguias.png"); coverImagePath.Add("images/fondovidasilvestre.png"); coverImagePath.Add("images/fondocaminoinca.png"); int heightItem = Configuration.getHeight(310); //Bitmap likeBitmap = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/like.png"), Configuration.getWidth (30), Configuration.getWidth (30), true); for (int i = 0; i < title.Count; i++) { LinearLayout item = new LinearLayout(context); item.LayoutParameters = new LinearLayout.LayoutParams(-1, heightItem); item.Orientation = Orientation.Horizontal; item.SetGravity(GravityFlags.Center); Drawable cover = new BitmapDrawable(getBitmapFromAsset(coverImagePath[i])); item.SetBackgroundDrawable(cover); _coverImages.Add(cover); TextView itemTitle = new TextView(context); itemTitle.Text = title [i]; itemTitle.SetTextColor(Color.ParseColor("#ffffff")); itemTitle.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); itemTitle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(45)); LinearLayout linearTitle = new LinearLayout(context); linearTitle.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(465), Configuration.getHeight(180)); linearTitle.Orientation = Orientation.Vertical; linearTitle.SetGravity(GravityFlags.Center); linearTitle.AddView(itemTitle); ImageView iconlike = new ImageView(context); //iconlike.SetImageBitmap(likeBitmap); LinearLayout linearLike = new LinearLayout(context); linearLike.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearLike.Orientation = Orientation.Vertical; linearLike.SetGravity(GravityFlags.CenterHorizontal); TextView txtnumLike = new TextView(context); txtnumLike.Text = numLikes[i]; txtnumLike.Gravity = GravityFlags.CenterHorizontal; txtnumLike.SetTextColor(Color.ParseColor("#ffffff")); //linearLike.AddView (iconlike); //linearLike.AddView (txtnumLike); LinearLayout linearType = new LinearLayout(context); linearType.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearType.Orientation = Orientation.Vertical; linearType.SetGravity(GravityFlags.CenterHorizontal); TextView txtnumType = new TextView(context); txtnumType.Text = numTypes[i]; txtnumType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtnumType.TextSize = Configuration.getHeight(15); txtnumType.Gravity = GravityFlags.CenterHorizontal; txtnumType.SetTextColor(Color.ParseColor("#ffffff")); TextView txtType = new TextView(context); txtType.Text = type[i]; txtType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtType.TextSize = Configuration.getHeight(15); txtType.Gravity = GravityFlags.CenterHorizontal; txtType.SetTextColor(Color.ParseColor("#ffffff")); int space = Configuration.getHeight(20); linearLike.SetPadding(0, 0, 0, space); linearType.SetPadding(space, 0, 0, 0); linearType.AddView(txtnumType); linearType.AddView(txtType); LinearLayout linearExtraInfo = new LinearLayout(context); linearExtraInfo.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(100), -2); linearExtraInfo.Orientation = Orientation.Vertical; linearExtraInfo.SetGravity(GravityFlags.CenterHorizontal); linearExtraInfo.AddView(linearLike); linearExtraInfo.AddView(linearType); item.AddView(linearTitle); //item.AddView (linearExtraInfo); _listLinearItem.Add(item); _linearContentLayout.AddView(_listLinearItem [i]); } }
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); }
public override View GetView(int position, View convertView, ViewGroup parent) { if (convertView == null) { if (_parent != null) { convertView = ((Activity)_parent.GetContext()).LayoutInflater.Inflate(Resource.Layout.MedicationTimeListItem, parent, false); } else if (parent != null) { LayoutInflater inflater = (LayoutInflater)parent.Context.GetSystemService(Context.LayoutInflaterService); convertView = inflater.Inflate(Resource.Layout.MedicationTimeListItem, parent, false); } else { return(convertView); } } if (convertView != null) { try { GetFieldComponents(convertView); if (_medicationTimeItems[position].MedicationTakeTime != null) { if (_timeDose != null) { _timeDose.Text = _medicationTimeItems[position].Dosage.ToString() + "mg"; Log.Info(TAG, "GetView: Time dose - " + _timeDose.Text); } else { Log.Error(TAG, "GetView: _timeDose is NULL!"); } if (_timeOfDay != null) { _timeOfDay.Text = StringHelper.MedicationTimeForConstant(_medicationTimeItems[position].MedicationTakeTime.MedicationTime); Log.Info(TAG, "GetView: Time of day - " + _timeOfDay.Text); } else { Log.Error(TAG, "GetView: _timeOfDay is NULL!"); } if (_timeTakenText != null) { _timeTakenText.Text = _medicationTimeItems[position].MedicationTakeTime.TakenTime.ToShortTimeString(); Log.Info(TAG, "GetView: Time Taken - " + _timeTakenText.Text); } else { Log.Error(TAG, "GetView: _timeTakenText is NULL!"); } if (_alarmNotify != null) { if (_medicationTimeItems[position].MedicationTakeReminder != null) { _alarmNotify.Visibility = ViewStates.Visible; } else { _alarmNotify.Visibility = ViewStates.Invisible; } } if (position == _parent.GetSelectedTimeItemIndex()) { convertView.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _timeDose.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _timeOfDay.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _timeTakenText.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _itemAt1.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _itemAt2.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _medicationSpread.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _doseAndFood.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); _alarmNotify.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); } else { convertView.SetBackgroundDrawable(null); _timeDose.SetBackgroundDrawable(null); _timeOfDay.SetBackgroundDrawable(null); _timeTakenText.SetBackgroundDrawable(null); _itemAt1.SetBackgroundDrawable(null); _itemAt2.SetBackgroundDrawable(null); _medicationSpread.SetBackgroundDrawable(null); _doseAndFood.SetBackgroundDrawable(null); _alarmNotify.SetBackgroundDrawable(null); } } } catch (Exception e) { Log.Error(TAG, "GetView: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert((Activity)_parent.GetContext(), e, ((Activity)_parent.GetContext()).GetString(Resource.String.ErrorMedListAdapterGetView), "MedicationTimeListAdapter.GetView"); } } } else { Log.Error(TAG, "GetView: View is NULL!"); } return(convertView); }
public void ini(){ //creating comment List commentLayout = new LinearLayout(context); commentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (934)); commentList = new ListView (context); //commentList.AddView (commentList); //end comment List _mainLayout = new RelativeLayout (context); linearGradiente = new LinearLayout (context); linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (541)); linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente); var textFormat = Android.Util.ComplexUnitType.Px; _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1); _fondo2 = new LinearLayout (context); _fondo2.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getWidth (640)); _fondo2.SetY (Configuration.getHeight (109)); Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png")); _fondo2.SetBackgroundDrawable (dr1); dr1 = null; _mainLayout.AddView (_fondo2); //section1----------------------------------------------- _contentRLayout_S1 = new RelativeLayout(context); _txtTitle_S1 = new TextView (context); _txtAuthor_S1 = new TextView (context); _imAuthor_S1 = new ImageView (context); _txtChapter_S1 = new TextView (context); _itemsLayout_S1 = new LinearLayout (context);//not used _imItem_S1 = new List<ImageView> (); _txtItem_S1 = new List<TextView>(); //_mainLayout.AddView (_txtTitle_S1); //_mainLayout.AddView (_txtAuthor_S1); _mainLayout.AddView (_imAuthor_S1); //_mainLayout.AddView (_txtChapter_S1); _contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480)); LinearLayout _linearTitle = new LinearLayout (context); _linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearTitle.SetGravity (Android.Views.GravityFlags.Center); _linearTitle.AddView (_txtTitle_S1); _linearTitle.SetY (Configuration.getHeight (60)); linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(502)); _mainLayout.AddView (linearGradiente); _mainLayout.AddView (_linearTitle); //_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60)); Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170)); _imAuthor_S1.SetImageBitmap (newbm); // newbm.Recycle (); newbm = null; _imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189)); LinearLayout _linearAuthor = new LinearLayout (context); _linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearAuthor.SetGravity (Android.Views.GravityFlags.Center); _linearAuthor.AddView (_txtAuthor_S1); _linearAuthor.SetY (Configuration.getHeight (378)); _mainLayout.AddView (_linearAuthor); //_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378)); LinearLayout _linearChapter = new LinearLayout (context); _linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearChapter.SetGravity (Android.Views.GravityFlags.Center); _linearChapter.AddView (_txtChapter_S1); _linearChapter.SetY (Configuration.getHeight (502)); _mainLayout.AddView (_linearChapter); //_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502)); _txtTitle_S1.Text = "Camino Inca"; _txtTitle_S1.SetTextColor (Color.White); _txtTitle_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtTitle_S1.SetTextSize (textFormat,Configuration.getHeight(30)); _txtAuthor_S1.Text = "David Spencer"; _txtAuthor_S1.SetTextColor (Color.White); _txtAuthor_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtAuthor_S1.SetTextSize (textFormat,Configuration.getHeight(30)); //_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000")); _txtAuthor_S1.SetShadowLayer (50.8f, 0.0f, 0.0f, Color.ParseColor ("#000000")); _txtChapter_S1.Text = "FLORA Y FAUNA"; _txtChapter_S1.SetTextColor (Color.White); _txtChapter_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtChapter_S1.SetTextSize (textFormat,Configuration.getHeight(35)); List<string> item_path = new List<string> (); item_path.Add ("icons/icona.png"); item_path.Add ("icons/iconb.png"); item_path.Add ("icons/iconc.png"); item_path.Add ("icons/icond.png"); item_path.Add ("icons/icone.png"); item_path.Add ("icons/iconf.png"); item_path.Add ("icons/icong.png"); int inixItemIM = Configuration.getWidth (33); int crecIM = Configuration.getWidth (90); int inixItemTXT = Configuration.getWidth (42); int crecTXT = Configuration.getWidth (90); int inixLinea = Configuration.getWidth (93); for (int i = 0; i < item_path.Count; i++) { _imItem_S1.Add(new ImageView(context)); _imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true)); _mainLayout.AddView (_imItem_S1 [i]); _imItem_S1 [i].SetX (inixItemIM+(i*crecIM));_imItem_S1 [i].SetY (Configuration.getHeight(602)); if (i != item_path.Count - 1) { ImageView linea = new ImageView (context); linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true)); _mainLayout.AddView (linea); linea.SetX (inixLinea + (i * crecIM)); linea.SetY (Configuration.getHeight (605)); linea = null; } _txtItem_S1.Add (new TextView (context)); _txtItem_S1 [i].Text = "0"; _txtItem_S1 [i].SetTextColor (Color.ParseColor ("#2E9AFE")); _txtItem_S1[i].Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtItem_S1[i].SetTextSize (textFormat,Configuration.getHeight(30)); _mainLayout.AddView (_txtItem_S1 [i]); _txtItem_S1 [i].SetX (inixItemTXT+(i*crecTXT));_txtItem_S1 [i].SetY (Configuration.getHeight(640)); _imItem_S1 [i] = null; } _imItem_S1 = null; //------------------------------------------------------- //section2------------------------------------------------ _contentScrollView_S2 = new HorizontalScrollView (context); _contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams (-1, Configuration.getWidth(160)); _contentScrollView_S2.HorizontalScrollBarEnabled = false; _images_S2 = new LinearLayout (context); _images_S2.Orientation = Orientation.Horizontal; _images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2,-1); _contentScrollView_S2.SetX (0); _contentScrollView_S2.SetY (Configuration.getHeight (700)); _contentScrollView_S2.AddView (_images_S2); //---------------------------------------------------------- //section3------------------------------------------------ _contentLLayout_S3 = new LinearLayout (context); _contentLLayout_S3.Orientation = Orientation.Vertical; _contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (160)); _contentLLayout_S3.SetX (0);_contentLLayout_S3.SetY (Configuration.getHeight(875)); _contentLLayout_S3.SetGravity (Android.Views.GravityFlags.Center); _txtInfo1_S3 = new TextView (context); _txtInfo2_S3 = new TextView (context); _txtInfo3_S3 = new TextView (context); _txtInfo1_S3.Text = "Duración: 05 dias / 04 noches "; _txtInfo2_S3.Text = "Distancia: 65km"; _txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)"; _txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo1_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo2_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo3_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo1_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo2_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo3_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo1_S3.SetTextColor (Color.White); _txtInfo2_S3.SetTextColor (Color.White); _txtInfo3_S3.SetTextColor (Color.White); _contentLLayout_S3.AddView (_txtInfo1_S3); _contentLLayout_S3.AddView (_txtInfo2_S3); _contentLLayout_S3.AddView (_txtInfo3_S3); //Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png")); //_contentLLayout_S3.SetBackgroundDrawable(dr3); //_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000")); _mainLayout.AddView (_contentLLayout_S3); _mainLayout.AddView (_contentScrollView_S2); //---------------------------------------------------------- //section4------------------------------------------------ _imItems_S4 = new List<ImageView>(); List<string> botton_icon_path = new List<string> (); botton_icon_path.Add ("icons/btnunidadesazul.png"); botton_icon_path.Add ("icons/btncomentariosazul.png"); botton_icon_path.Add ("icons/btncontenidoazul.png"); botton_icon_path.Add ("icons/btnchatazul.png"); botton_icon_path.Add ("icons/btntareasazul.png"); _imItems_S4.Add (new ImageView (context)); _imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (60), Configuration.getWidth (54), true)); _mainLayout.AddView (_imItems_S4[0]); _imItems_S4[0].SetX (Configuration.getWidth(58));_imItems_S4[0].SetY (Configuration.getHeight(1069)); _imItems_S4.Add (new ImageView (context)); _imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true)); _mainLayout.AddView (_imItems_S4[1]); _imItems_S4[1].SetX (Configuration.getWidth(169));_imItems_S4[1].SetY (Configuration.getHeight(1069)); _imItems_S4.Add (new ImageView (context)); _imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (60), Configuration.getWidth (60), true)); _mainLayout.AddView (_imItems_S4 [2]); _imItems_S4[2].SetX (Configuration.getWidth(297));_imItems_S4[2].SetY (Configuration.getHeight(1069)); _imItems_S4.Add (new ImageView (context)); _imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true)); _mainLayout.AddView (_imItems_S4[3]); _imItems_S4[3].SetX (Configuration.getWidth(421));_imItems_S4[3].SetY (Configuration.getHeight(1069)); _imItems_S4.Add (new ImageView (context)); _imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (41), Configuration.getWidth (50), true)); _mainLayout.AddView (_imItems_S4 [4]); _imItems_S4[4].SetX (Configuration.getWidth(540));_imItems_S4[4].SetY (Configuration.getHeight(1069)); //---------------------------------------------------------- Drawable dr = new BitmapDrawable (getBitmapFromAsset("icons/fondo.png")); _mainLayout.SetBackgroundDrawable (dr); dr = null; _workspace = new LinearLayout (context); _workspace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1045)); //_workspace.SetY (Configuration.getHeight (110)); _mainLayout.AddView (_workspace); //_workspace.AddView (_foro); //_workspace.Visibility = Android.Views.ViewStates.Invisible; }
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); }
private void iniMenu(){ mainLayout = new RelativeLayout (this); _foro = new LOContainerView (this); _dialogDownload = new ProgressDialog (this); _dialogDownload.SetCancelable (false); _dialogDownload.SetMessage ("Downloading..."); txtUserName = new TextView (this); txtCurse = new TextView (this); txtSchoolName = new TextView (this); txtUserRol = new TextView (this); txtPorcentaje = new TextView (this); txtCurseTitle = new TextView (this); txtTaskTitle = new TextView (this); txtPendiente = new TextView (this); txtValorBarra = new TextView (this); imgChat = new ImageView (this); imgUser = new ImageView (this); imgSchool = new ImageView (this); imgNotificacion = new ImageView (this); imgCurse = new ImageView (this); imgTask = new ImageView (this); linearBarraCurso = new LinearLayout (this); linearCurse= new LinearLayout (this); linearSchool= new LinearLayout (this); linearTask= new LinearLayout (this); linearUserData= new LinearLayout (this); linearUser = new LinearLayout (this); linearListCurso = new LinearLayout (this); linearListTask = new LinearLayout (this); linearList = new LinearLayout (this); linearPendiente = new LinearLayout (this); linearTxtValorBarra = new LinearLayout (this); listCursos = new ListView (this); listTasks = new ListView (this); mItemsChat = new List<ChatDataRow> (); mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1); Drawable d = new BitmapDrawable (getBitmapFromAsset ("icons/fondo.png")); mainLayout.SetBackgroundDrawable (d); d = null; linearBarraCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearCurse.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50)); linearTask.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50)); linearSchool.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearUserData.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearUser.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearListCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(250)); linearListTask.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearList.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearPendiente.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (30), Configuration.getWidth (30)); linearTxtValorBarra.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearBarraCurso.Orientation = Orientation.Vertical; linearBarraCurso.SetGravity (GravityFlags.Center); linearTxtValorBarra.Orientation = Orientation.Vertical; linearTxtValorBarra.SetGravity (GravityFlags.Center); txtValorBarra.Gravity = GravityFlags.Center; linearCurse.Orientation = Orientation.Horizontal; linearCurse.SetGravity (GravityFlags.CenterVertical); linearTask.Orientation = Orientation.Horizontal; linearTask.SetGravity (GravityFlags.CenterVertical); linearSchool.Orientation = Orientation.Horizontal; //linearSchool.SetGravity (GravityFlags.CenterVer); linearUserData.Orientation = Orientation.Vertical; linearUserData.SetGravity (GravityFlags.Center); linearUser.Orientation = Orientation.Vertical; linearUser.SetGravity (GravityFlags.CenterHorizontal); linearListCurso.Orientation = Orientation.Vertical; linearListTask.Orientation = Orientation.Vertical; linearList.Orientation = Orientation.Vertical; linearPendiente.Orientation = Orientation.Horizontal; linearPendiente.SetGravity (GravityFlags.Center); //linearList.SetGravity (GravityFlags.CenterVertical); progressBar = new ProgressBar (this,null,Android.Resource.Attribute.ProgressBarStyleHorizontal); progressBar.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (274), Configuration.getHeight (32)); progressBar.ProgressDrawable = Resources.GetDrawable (Resource.Drawable.progressBackground); progressBar.Progress = 60; txtValorBarra.Text = "60%"; //progressBar.text txtValorBarra.SetY(13); txtCurse.Text = "Cursos del 2015"; txtCurse.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); // txtUserName.Text ="David Spencer"; txtUserName.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtUserRol.Text ="Alumno"; txtUserRol.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtSchoolName.Text ="Colegio Sagrados Corazones"; txtSchoolName.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtPorcentaje.Text = "60%"; txtPorcentaje.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtCurseTitle.Text = "CURSOS"; txtCurseTitle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtTaskTitle.Text = "TAREAS"; txtTaskTitle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtPendiente.Text = "1"; txtPendiente.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtPendiente.SetY (-10); txtPendiente.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30)); txtUserName.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (35)); txtUserRol.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30)); txtCurseTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0); txtTaskTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0); txtCurse.SetTextColor (Color.ParseColor ("#ffffff")); txtUserName.SetTextColor (Color.ParseColor ("#ffffff")); txtUserRol.SetTextColor (Color.ParseColor ("#999999")); txtSchoolName.SetTextColor (Color.ParseColor ("#ffffff")); txtPorcentaje.SetTextColor (Color.ParseColor ("#ffffff")); txtPendiente.SetTextColor (Color.ParseColor ("#ffffff")); txtTaskTitle.SetTextColor (Color.ParseColor ("#ffffff")); txtCurseTitle.SetTextColor (Color.ParseColor ("#ffffff")); txtValorBarra.SetTextColor (Color.ParseColor ("#ffffff")); txtUserName.Gravity = GravityFlags.CenterHorizontal; txtUserRol.Gravity = GravityFlags.CenterHorizontal; txtCurse.Gravity = GravityFlags.CenterHorizontal; imgChat.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/chat.png"),Configuration.getWidth (45), Configuration.getWidth (40),true)); imgUser.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/user.png"),Configuration.getWidth (154), Configuration.getHeight (154),true)); imgSchool.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/colegio.png"),Configuration.getWidth (29), Configuration.getHeight (29),true)); imgNotificacion.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/notif.png"),Configuration.getWidth (35), Configuration.getWidth (40),true)); imgCurse.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/curso.png"),Configuration.getWidth (23), Configuration.getHeight (28),true)); imgTask.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/vertareas.png"),Configuration.getWidth (23), Configuration.getHeight (28),true)); Drawable drPendiente = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/pendiente.png"), Configuration.getWidth(30), Configuration.getWidth(30), true)); linearPendiente.SetBackgroundDrawable (drPendiente); drPendiente = null; imgCurse.SetPadding (Configuration.getWidth (68), 0, 0, 0); imgTask.SetPadding(Configuration.getWidth(68),0,0,0); linearCurse.SetBackgroundColor(Color.ParseColor("#0d1216")); linearTask.SetBackgroundColor (Color.ParseColor ("#0d1216")); linearBarraCurso.AddView (txtCurse); linearBarraCurso.AddView (progressBar); linearTxtValorBarra.AddView (txtValorBarra); linearCurse.AddView (imgCurse); linearCurse.AddView (txtCurseTitle); linearTask.AddView (imgTask); linearTask.AddView (txtTaskTitle); linearPendiente.AddView (txtPendiente); imgSchool.SetPadding (Configuration.getWidth(68),0,0,0); txtSchoolName.SetPadding (Configuration.getWidth(40),0,0,0); linearSchool.AddView (imgSchool); linearSchool.AddView (txtSchoolName); linearUser.AddView (txtUserName); linearUser.AddView (txtUserRol); linearUserData.AddView (imgUser); linearUserData.AddView (linearUser); linearListCurso.AddView (listCursos); linearListTask.AddView (listTasks); linearList.AddView (linearCurse); linearList.AddView (linearListCurso); linearList.AddView (linearTask); linearList.AddView (linearListTask); imgChat.SetX (Configuration.getWidth(59)); imgChat.SetY (Configuration.getHeight(145)); imgChat.Click += delegate { mDrawerLayout.CloseDrawer (mLeftDrawer); mDrawerLayout.OpenDrawer (mRightDrawer); }; imgNotificacion.SetX (Configuration.getWidth(59)); imgNotificacion.SetY (Configuration.getHeight(233)); imgNotificacion.Click += delegate { mDrawerLayout.CloseDrawer (mLeftDrawer); main_ContentView.RemoveAllViews (); main_ContentView.AddView(new NotificationView(this)); }; linearPendiente.SetX (Configuration.getWidth(94)); linearPendiente.SetY (Configuration.getHeight(217)); linearUserData.SetX (0); linearUserData.SetY (Configuration.getHeight(130)); linearBarraCurso.SetX (0); linearBarraCurso.SetY (Configuration.getHeight(412)); linearTxtValorBarra.SetX (0); linearTxtValorBarra.SetY (Configuration.getHeight(443)); linearSchool.SetX (0); linearSchool.SetY (Configuration.getHeight(532)); linearList.SetX (0); linearList.SetY (Configuration.getHeight(583)); Bitmap bm; txtUserName.Text = vm.UserFirstName + " "+ vm.UserLastName; if (vm.UserImage != null) { bm = BitmapFactory.DecodeByteArray (vm.UserImage, 0, vm.UserImage.Length); Bitmap newbm = Configuration.GetRoundedCornerBitmap (Bitmap.CreateScaledBitmap (bm,Configuration.getWidth (154), Configuration.getHeight (154),true)); imgUser.SetImageBitmap (newbm); newbm = null; } bm = null; mainLayout.AddView (imgChat); mainLayout.AddView (imgNotificacion); mainLayout.AddView (linearPendiente); mainLayout.AddView (linearUserData); mainLayout.AddView (linearBarraCurso); mainLayout.AddView (linearTxtValorBarra); mainLayout.AddView (linearSchool); mainLayout.AddView (linearList); imgChat = null; imgNotificacion = null; imgCurse = null; imgTask = null; imgSchool = null; imgUser = null; }
public void ini() { _txtCursoN = new TextView(context); _txtCursoN.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _txtUnidadN = new TextView(context); _mainLayout = new RelativeLayout(context); linearGradiente = new LinearLayout(context); linearGradiente.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(310)); linearGradiente.SetBackgroundResource(Resource.Drawable.gradiente); var textFormat = Android.Util.ComplexUnitType.Px; _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); _scrollSpace = new VerticalScrollView(context); _scrollSpace.LayoutParameters = new VerticalScrollView.LayoutParams(-1, Configuration.getHeight(1015 - 85)); _scrollSpace.SetY(Configuration.getHeight(125)); //_scrollSpace.SetBackgroundColor (Color.ParseColor ("#FF0000")); _mainLayout.AddView(_scrollSpace); _publicidadLayout = new LinearLayout(context); _publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(85)); Drawable dr = new BitmapDrawable(getBitmapFromAsset("images/footerad.jpg")); _publicidadLayout.SetBackgroundDrawable(dr); _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)); } }; _mapSpace = new LinearLayout(context); _mapSpace.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(1015)); _mapSpace.SetY(Configuration.getHeight(125)); _mainLayout.AddView(_mapSpace); _mainSpace = new LinearLayout(context); _mainSpace.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _mainSpace.Orientation = Orientation.Vertical; _scrollSpace.AddView(_mainSpace); _fondo2 = new RelativeLayout(context); _fondo2.LayoutParameters = new RelativeLayout.LayoutParams(-1, Configuration.getWidth(640)); _fondo2.SetY(Configuration.getHeight(0)); Drawable dr1 = new BitmapDrawable(getBitmapFromAsset("icons/fondoselec.png")); _fondo2.SetBackgroundDrawable(dr1); dr1 = null; _mainSpace.AddView(_fondo2); infoCursoUnidad = new LinearLayout(context); infoCursoUnidad.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(250)); infoCursoUnidad.Orientation = Orientation.Vertical; infoCursoUnidad.SetGravity(Android.Views.GravityFlags.Right); infoCursoUnidad.SetPadding(Configuration.getWidth(30), Configuration.getWidth(25), Configuration.getWidth(30), Configuration.getWidth(25)); infoCursoUnidad.SetBackgroundColor(Color.ParseColor("#40000000")); TextView _txtCurso = new TextView(context); _txtCurso.Text = Resource.String.THE_ROUTES.ToString();; _txtCurso.SetY(-100); //section1----------------------------------------------- _contentRLayout_S1 = new RelativeLayout(context); _txtTitle_S1 = new TextView(context); _txtAuthor_S1 = new TextView(context); _imAuthor_S1 = new ImageView(context); _txtChapter_S1 = new TextView(context); _itemsLayout_S1 = new LinearLayout(context); //not used _imItem_S1 = new List <ImageView> (); _txtItem_S1 = new List <TextView>(); _contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams(-1, Configuration.getHeight(480)); LinearLayout _linearTitle = new LinearLayout(context); _linearTitle.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _linearTitle.SetGravity(Android.Views.GravityFlags.Center); _linearTitle.AddView(_txtTitle_S1); _linearTitle.SetY(Configuration.getHeight(60)); linearGradiente.SetX(0); linearGradiente.SetY(Configuration.getHeight(860)); //_mainLayout.AddView (linearGradiente); //_mainLayout.AddView (_linearTitle); //_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60)); //Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170)); //_imAuthor_S1.SetImageBitmap (newbm); // newbm.Recycle (); //newbm = null; //_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189)); LinearLayout _linearAuthor = new LinearLayout(context); _linearAuthor.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _linearAuthor.SetGravity(Android.Views.GravityFlags.Center); _linearAuthor.AddView(_txtAuthor_S1); _linearAuthor.SetY(Configuration.getHeight(378)); //_mainLayout.AddView (_linearAuthor); //_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378)); LinearLayout _linearChapter = new LinearLayout(context); _linearChapter.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _linearChapter.SetGravity(Android.Views.GravityFlags.Center); //_linearChapter.AddView (_txtChapter_S1); _linearChapter.SetY(Configuration.getHeight(502)); //_mainLayout.AddView (_linearChapter); //_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502)); _txtTitle_S1.Text = "Camino Inca"; _txtTitle_S1.SetTextColor(Color.White); _txtTitle_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtTitle_S1.SetTextSize(textFormat, Configuration.getHeight(30)); _txtAuthor_S1.Text = "David Spencer"; _txtAuthor_S1.SetTextColor(Color.White); _txtAuthor_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtAuthor_S1.SetTextSize(textFormat, Configuration.getHeight(30)); //_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000")); _txtAuthor_S1.SetShadowLayer(50.8f, 0.0f, 0.0f, Color.ParseColor("#000000")); _txtChapter_S1.Text = "FLORA Y FAUNA"; _txtChapter_S1.SetTextColor(Color.White); _txtChapter_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtChapter_S1.SetTextSize(textFormat, Configuration.getHeight(35)); List <string> item_path = new List <string> (); item_path.Add("icons/icona.png"); item_path.Add("icons/iconb.png"); item_path.Add("icons/iconc.png"); item_path.Add("icons/icond.png"); item_path.Add("icons/icone.png"); item_path.Add("icons/iconf.png"); item_path.Add("icons/icong.png"); int inixItemIM = Configuration.getWidth(33); int crecIM = Configuration.getWidth(90); int inixItemTXT = Configuration.getWidth(42); int crecTXT = Configuration.getWidth(90); int inixLinea = Configuration.getWidth(93); for (int i = 0; i < item_path.Count; i++) { _imItem_S1.Add(new ImageView(context)); //_imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true)); //_mainLayout.AddView (_imItem_S1 [i]); _imItem_S1 [i].SetX(inixItemIM + (i * crecIM)); _imItem_S1 [i].SetY(Configuration.getHeight(602)); if (i != item_path.Count - 1) { ImageView linea = new ImageView(context); //linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true)); //_mainLayout.AddView (linea); linea.SetX(inixLinea + (i * crecIM)); linea.SetY(Configuration.getHeight(605)); linea = null; } _txtItem_S1.Add(new TextView(context)); _txtItem_S1 [i].Text = "0"; _txtItem_S1 [i].SetTextColor(Color.ParseColor("#2E9AFE")); _txtItem_S1[i].Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtItem_S1[i].SetTextSize(textFormat, Configuration.getHeight(30)); //_mainLayout.AddView (_txtItem_S1 [i]); _txtItem_S1 [i].SetX(inixItemTXT + (i * crecTXT)); _txtItem_S1 [i].SetY(Configuration.getHeight(640)); _imItem_S1 [i] = null; } _imItem_S1 = null; //------------------------------------------------------- //section2------------------------------------------------ _contentScrollView_S2 = new HorizontalScrollView(context); _contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams(-1, Configuration.getWidth(160)); _contentScrollView_S2.HorizontalScrollBarEnabled = false; _images_S2 = new LinearLayout(context); _images_S2.Orientation = Orientation.Horizontal; _images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2, -1); _contentScrollView_S2.SetX(0); _contentScrollView_S2.AddView(_images_S2); //---------------------------------------------------------- //section3------------------------------------------------ _contentLLayout_S3 = new LinearLayout(context); _contentLLayout_S3.Orientation = Orientation.Vertical; _contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(160)); _contentLLayout_S3.SetX(0); _contentLLayout_S3.SetY(Configuration.getHeight(875)); _contentLLayout_S3.SetGravity(Android.Views.GravityFlags.Center); _txtInfo1_S3 = new TextView(context); _txtInfo2_S3 = new TextView(context); _txtInfo3_S3 = new TextView(context); _txtInfo1_S3.Text = "Duración: 05 dias / 04 noches "; _txtInfo2_S3.Text = "Distancia: 65km"; _txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)"; _txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo1_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo2_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo3_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo1_S3.SetTextSize(textFormat, Configuration.getHeight(30)); _txtInfo2_S3.SetTextSize(textFormat, Configuration.getHeight(30)); _txtInfo3_S3.SetTextSize(textFormat, Configuration.getHeight(30)); _txtInfo1_S3.SetTextColor(Color.White); _txtInfo2_S3.SetTextColor(Color.White); _txtInfo3_S3.SetTextColor(Color.White); _contentLLayout_S3.AddView(_txtInfo1_S3); _contentLLayout_S3.AddView(_txtInfo2_S3); _contentLLayout_S3.AddView(_txtInfo3_S3); //Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png")); //_contentLLayout_S3.SetBackgroundDrawable(dr3); //_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000")); //_mainLayout.AddView (_contentLLayout_S3); //_mainLayout.AddView (_contentScrollView_S2); _mainSpace.AddView(_contentScrollView_S2); //---------------------------------------------------------- /* * _listUnidades.Add(new UnidadItem{ Title = "Dia 1", Description = "Piscacucho-Wayllabamba" }); * _listUnidades.Add(new UnidadItem{ Title = "Dia 2", Description = "Wayllabamba-Pacaymayo" }); * _listUnidades.Add(new UnidadItem{ Title = "Dia 3", Description = "Pacaymayo-Wiñay Wayna" }); * _listUnidades.Add(new UnidadItem{ Title = "Dia 4", Description = "WIñay Wayna-Machu PIcchu"}); */ /* * _listViewUnidades = new ListView(context); * _listViewUnidades.Adapter = new UnidadAdapter (context, _listUnidades); * * _mainSpace.AddView (_listViewUnidades); */ _spaceUnidades = new LinearLayout(context); _spaceUnidades.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _spaceUnidades.Orientation = Orientation.Vertical; _spaceUnidades.SetBackgroundColor(Color.White); _mainSpace.AddView(_spaceUnidades); //section4------------------------------------------------ _imItems_S4 = new List <ImageView>(); List <string> botton_icon_path = new List <string> (); botton_icon_path.Add("icons/btnhome.png"); botton_icon_path.Add("icons/btncomentariosazul.png"); botton_icon_path.Add("icons/btncontenido.png"); botton_icon_path.Add("icons/btnchatazul.png"); botton_icon_path.Add("icons/btnmap.png"); _imItems_S4.Add(new ImageView(context)); //_imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (40), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4[0]); _imItems_S4[0].SetX(Configuration.getWidth(58)); _imItems_S4[0].SetY(Configuration.getHeight(1069)); _imItems_S4 [0].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add(new ImageView(context)); //_imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true)); //_mainLayout.AddView (_imItems_S4[1]); _imItems_S4[1].SetX(Configuration.getWidth(169)); _imItems_S4[1].SetY(Configuration.getHeight(1069)); _imItems_S4 [1].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add(new ImageView(context)); //_imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (80), Configuration.getWidth (80), true)); //_mainLayout.AddView (_imItems_S4 [2]); _imItems_S4[2].SetX(Configuration.getWidth(297)); _imItems_S4[2].SetY(Configuration.getHeight(1050)); _imItems_S4 [2].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add(new ImageView(context)); //_imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true)); //_mainLayout.AddView (_imItems_S4[3]); _imItems_S4[3].SetX(Configuration.getWidth(421)); _imItems_S4[3].SetY(Configuration.getHeight(1069)); _imItems_S4 [3].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add(new ImageView(context)); //_imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (30), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4 [4]); _imItems_S4[4].SetX(Configuration.getWidth(540)); _imItems_S4[4].SetY(Configuration.getHeight(1069)); _imItems_S4 [4].Visibility = Android.Views.ViewStates.Invisible; //---------------------------------------------------------- //Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header1.png")); header = new LinearLayout(context); header.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(125)); header.Orientation = Orientation.Vertical; //header.SetBackgroundDrawable (dr); //_mainLayout.SetBackgroundDrawable (dr); _mainLayout.AddView(header); //dr = null; _workspace = new LinearLayout(context); _workspace.LayoutParameters = new LinearLayout.LayoutParams(-1, -1); //_workspace.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.SetY (Configuration.getHeight (110)); _mainLayout.AddView(_workspace); //_mainLayout.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.AddView (_foro); //_workspace.Visibility = Android.Views.ViewStates.Invisible; }
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); }
private void initItems() { var textFormat = Android.Util.ComplexUnitType.Px; _linearContentLayout = new LinearLayout (context); _linearContentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearContentLayout.Orientation = Orientation.Vertical; List<string> title = new List<string> (); List<string> type = new List<string> (); List<string> coverImagePath = new List<string> (); List<string> numLikes = new List<string> (); List<string> numTypes = new List<string> (); numLikes.Add ("10"); numLikes.Add ("10"); numLikes.Add ("10"); numLikes.Add ("10"); numTypes.Add ("3"); numTypes.Add ("7"); numTypes.Add ("4"); numTypes.Add ("9"); title.Add (Resources.GetText(Resource.String.THE_ROUTES)); title.Add (Resources.GetText(Resource.String.TOURIST_SERVICE_GUIDE)); title.Add (Resources.GetText(Resource.String.WILDLIFE_IDENTIFICATION_GUIDE)); title.Add (Resources.GetText(Resource.String.INCA_TRIAL_IN_NUMBERS)); type.Add ("rutas"); type.Add ("guias"); type.Add ("guias"); type.Add ("cifras"); coverImagePath.Add ("images/fondorutas.png"); coverImagePath.Add ("images/fondoguias.png"); coverImagePath.Add ("images/fondovidasilvestre.png"); coverImagePath.Add ("images/fondocaminoinca.png"); int heightItem = Configuration.getHeight (310); //Bitmap likeBitmap = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/like.png"), Configuration.getWidth (30), Configuration.getWidth (30), true); for (int i = 0; i < title.Count; i++) { LinearLayout item = new LinearLayout (context); item.LayoutParameters = new LinearLayout.LayoutParams (-1, heightItem); item.Orientation = Orientation.Horizontal; item.SetGravity (GravityFlags.Center); Drawable cover = new BitmapDrawable (getBitmapFromAsset(coverImagePath[i])); item.SetBackgroundDrawable (cover); _coverImages.Add (cover); TextView itemTitle = new TextView (context); itemTitle.Text = title [i]; itemTitle.SetTextColor (Color.ParseColor("#ffffff")); itemTitle.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); itemTitle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(45)); LinearLayout linearTitle = new LinearLayout (context); linearTitle.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(465),Configuration.getHeight(180)); linearTitle.Orientation = Orientation.Vertical; linearTitle.SetGravity (GravityFlags.Center); linearTitle.AddView (itemTitle); ImageView iconlike = new ImageView (context); //iconlike.SetImageBitmap(likeBitmap); LinearLayout linearLike = new LinearLayout (context); linearLike.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearLike.Orientation = Orientation.Vertical; linearLike.SetGravity (GravityFlags.CenterHorizontal); TextView txtnumLike = new TextView (context); txtnumLike.Text = numLikes[i]; txtnumLike.Gravity = GravityFlags.CenterHorizontal; txtnumLike.SetTextColor (Color.ParseColor ("#ffffff")); //linearLike.AddView (iconlike); //linearLike.AddView (txtnumLike); LinearLayout linearType = new LinearLayout (context); linearType.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearType.Orientation = Orientation.Vertical; linearType.SetGravity (GravityFlags.CenterHorizontal); TextView txtnumType = new TextView (context); txtnumType.Text = numTypes[i]; txtnumType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtnumType.TextSize = Configuration.getHeight (15); txtnumType.Gravity = GravityFlags.CenterHorizontal; txtnumType.SetTextColor (Color.ParseColor ("#ffffff")); TextView txtType = new TextView (context); txtType.Text = type[i]; txtType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtType.TextSize = Configuration.getHeight (15); txtType.Gravity = GravityFlags.CenterHorizontal; txtType.SetTextColor (Color.ParseColor ("#ffffff")); int space = Configuration.getHeight (20); linearLike.SetPadding (0, 0, 0, space); linearType.SetPadding (space, 0, 0, 0); linearType.AddView (txtnumType); linearType.AddView (txtType); LinearLayout linearExtraInfo = new LinearLayout (context); linearExtraInfo.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(100), -2); linearExtraInfo.Orientation = Orientation.Vertical; linearExtraInfo.SetGravity (GravityFlags.CenterHorizontal); linearExtraInfo.AddView (linearLike); linearExtraInfo.AddView (linearType); item.AddView (linearTitle); //item.AddView (linearExtraInfo); _listLinearItem.Add (item); _linearContentLayout.AddView (_listLinearItem [i]); } }
public void ini(){ _txtCursoN = new TextView (context); _txtCursoN.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _txtUnidadN = new TextView (context); _mainLayout = new RelativeLayout (context); linearGradiente = new LinearLayout (context); linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (310)); linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente); var textFormat = Android.Util.ComplexUnitType.Px; _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1); _scrollSpace = new VerticalScrollView (context); _scrollSpace.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(1015-85)); _scrollSpace.SetY (Configuration.getHeight (125)); //_scrollSpace.SetBackgroundColor (Color.ParseColor ("#FF0000")); _mainLayout.AddView (_scrollSpace); _publicidadLayout = new LinearLayout (context); _publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85)); Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg")); _publicidadLayout.SetBackgroundDrawable (dr); _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)); } }; _mapSpace = new LinearLayout (context); _mapSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1015)); _mapSpace.SetY(Configuration.getHeight (125)); _mainLayout.AddView (_mapSpace); _mainSpace = new LinearLayout (context); _mainSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _mainSpace.Orientation = Orientation.Vertical; _scrollSpace.AddView (_mainSpace); _fondo2 = new RelativeLayout (context); _fondo2.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getWidth (640)); _fondo2.SetY (Configuration.getHeight (0)); Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png")); _fondo2.SetBackgroundDrawable (dr1); dr1 = null; _mainSpace.AddView (_fondo2); infoCursoUnidad = new LinearLayout (context); infoCursoUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250)); infoCursoUnidad.Orientation = Orientation.Vertical; infoCursoUnidad.SetGravity(Android.Views.GravityFlags.Right); infoCursoUnidad.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25)); infoCursoUnidad.SetBackgroundColor (Color.ParseColor ("#40000000")); TextView _txtCurso = new TextView (context); _txtCurso.Text = Resource.String.THE_ROUTES.ToString ();; _txtCurso.SetY (-100); //section1----------------------------------------------- _contentRLayout_S1 = new RelativeLayout(context); _txtTitle_S1 = new TextView (context); _txtAuthor_S1 = new TextView (context); _imAuthor_S1 = new ImageView (context); _txtChapter_S1 = new TextView (context); _itemsLayout_S1 = new LinearLayout (context);//not used _imItem_S1 = new List<ImageView> (); _txtItem_S1 = new List<TextView>(); _contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480)); LinearLayout _linearTitle = new LinearLayout (context); _linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearTitle.SetGravity (Android.Views.GravityFlags.Center); _linearTitle.AddView (_txtTitle_S1); _linearTitle.SetY (Configuration.getHeight (60)); linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(860)); //_mainLayout.AddView (linearGradiente); //_mainLayout.AddView (_linearTitle); //_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60)); //Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170)); //_imAuthor_S1.SetImageBitmap (newbm); // newbm.Recycle (); //newbm = null; //_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189)); LinearLayout _linearAuthor = new LinearLayout (context); _linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearAuthor.SetGravity (Android.Views.GravityFlags.Center); _linearAuthor.AddView (_txtAuthor_S1); _linearAuthor.SetY (Configuration.getHeight (378)); //_mainLayout.AddView (_linearAuthor); //_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378)); LinearLayout _linearChapter = new LinearLayout (context); _linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _linearChapter.SetGravity (Android.Views.GravityFlags.Center); //_linearChapter.AddView (_txtChapter_S1); _linearChapter.SetY (Configuration.getHeight (502)); //_mainLayout.AddView (_linearChapter); //_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502)); _txtTitle_S1.Text = "Camino Inca"; _txtTitle_S1.SetTextColor (Color.White); _txtTitle_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtTitle_S1.SetTextSize (textFormat,Configuration.getHeight(30)); _txtAuthor_S1.Text = "David Spencer"; _txtAuthor_S1.SetTextColor (Color.White); _txtAuthor_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtAuthor_S1.SetTextSize (textFormat,Configuration.getHeight(30)); //_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000")); _txtAuthor_S1.SetShadowLayer (50.8f, 0.0f, 0.0f, Color.ParseColor ("#000000")); _txtChapter_S1.Text = "FLORA Y FAUNA"; _txtChapter_S1.SetTextColor (Color.White); _txtChapter_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtChapter_S1.SetTextSize (textFormat,Configuration.getHeight(35)); List<string> item_path = new List<string> (); item_path.Add ("icons/icona.png"); item_path.Add ("icons/iconb.png"); item_path.Add ("icons/iconc.png"); item_path.Add ("icons/icond.png"); item_path.Add ("icons/icone.png"); item_path.Add ("icons/iconf.png"); item_path.Add ("icons/icong.png"); int inixItemIM = Configuration.getWidth (33); int crecIM = Configuration.getWidth (90); int inixItemTXT = Configuration.getWidth (42); int crecTXT = Configuration.getWidth (90); int inixLinea = Configuration.getWidth (93); for (int i = 0; i < item_path.Count; i++) { _imItem_S1.Add(new ImageView(context)); //_imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true)); //_mainLayout.AddView (_imItem_S1 [i]); _imItem_S1 [i].SetX (inixItemIM+(i*crecIM));_imItem_S1 [i].SetY (Configuration.getHeight(602)); if (i != item_path.Count - 1) { ImageView linea = new ImageView (context); //linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true)); //_mainLayout.AddView (linea); linea.SetX (inixLinea + (i * crecIM)); linea.SetY (Configuration.getHeight (605)); linea = null; } _txtItem_S1.Add (new TextView (context)); _txtItem_S1 [i].Text = "0"; _txtItem_S1 [i].SetTextColor (Color.ParseColor ("#2E9AFE")); _txtItem_S1[i].Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtItem_S1[i].SetTextSize (textFormat,Configuration.getHeight(30)); //_mainLayout.AddView (_txtItem_S1 [i]); _txtItem_S1 [i].SetX (inixItemTXT+(i*crecTXT));_txtItem_S1 [i].SetY (Configuration.getHeight(640)); _imItem_S1 [i] = null; } _imItem_S1 = null; //------------------------------------------------------- //section2------------------------------------------------ _contentScrollView_S2 = new HorizontalScrollView (context); _contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams (-1, Configuration.getWidth(160)); _contentScrollView_S2.HorizontalScrollBarEnabled = false; _images_S2 = new LinearLayout (context); _images_S2.Orientation = Orientation.Horizontal; _images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2,-1); _contentScrollView_S2.SetX (0); _contentScrollView_S2.AddView (_images_S2); //---------------------------------------------------------- //section3------------------------------------------------ _contentLLayout_S3 = new LinearLayout (context); _contentLLayout_S3.Orientation = Orientation.Vertical; _contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (160)); _contentLLayout_S3.SetX (0);_contentLLayout_S3.SetY (Configuration.getHeight(875)); _contentLLayout_S3.SetGravity (Android.Views.GravityFlags.Center); _txtInfo1_S3 = new TextView (context); _txtInfo2_S3 = new TextView (context); _txtInfo3_S3 = new TextView (context); _txtInfo1_S3.Text = "Duración: 05 dias / 04 noches "; _txtInfo2_S3.Text = "Distancia: 65km"; _txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)"; _txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo1_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo2_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo3_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo1_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo2_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo3_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo1_S3.SetTextColor (Color.White); _txtInfo2_S3.SetTextColor (Color.White); _txtInfo3_S3.SetTextColor (Color.White); _contentLLayout_S3.AddView (_txtInfo1_S3); _contentLLayout_S3.AddView (_txtInfo2_S3); _contentLLayout_S3.AddView (_txtInfo3_S3); //Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png")); //_contentLLayout_S3.SetBackgroundDrawable(dr3); //_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000")); //_mainLayout.AddView (_contentLLayout_S3); //_mainLayout.AddView (_contentScrollView_S2); _mainSpace.AddView (_contentScrollView_S2); //---------------------------------------------------------- /* _listUnidades.Add(new UnidadItem{ Title = "Dia 1", Description = "Piscacucho-Wayllabamba" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 2", Description = "Wayllabamba-Pacaymayo" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 3", Description = "Pacaymayo-Wiñay Wayna" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 4", Description = "WIñay Wayna-Machu PIcchu"}); */ /* _listViewUnidades = new ListView(context); _listViewUnidades.Adapter = new UnidadAdapter (context, _listUnidades); _mainSpace.AddView (_listViewUnidades); */ _spaceUnidades = new LinearLayout (context); _spaceUnidades.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _spaceUnidades.Orientation = Orientation.Vertical; _spaceUnidades.SetBackgroundColor (Color.White); _mainSpace.AddView (_spaceUnidades); //section4------------------------------------------------ _imItems_S4 = new List<ImageView>(); List<string> botton_icon_path = new List<string> (); botton_icon_path.Add ("icons/btnhome.png"); botton_icon_path.Add ("icons/btncomentariosazul.png"); botton_icon_path.Add ("icons/btncontenido.png"); botton_icon_path.Add ("icons/btnchatazul.png"); botton_icon_path.Add ("icons/btnmap.png"); _imItems_S4.Add (new ImageView (context)); //_imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (40), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4[0]); _imItems_S4[0].SetX (Configuration.getWidth(58));_imItems_S4[0].SetY (Configuration.getHeight(1069)); _imItems_S4 [0].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true)); //_mainLayout.AddView (_imItems_S4[1]); _imItems_S4[1].SetX (Configuration.getWidth(169));_imItems_S4[1].SetY (Configuration.getHeight(1069)); _imItems_S4 [1].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (80), Configuration.getWidth (80), true)); //_mainLayout.AddView (_imItems_S4 [2]); _imItems_S4[2].SetX (Configuration.getWidth(297));_imItems_S4[2].SetY (Configuration.getHeight(1050)); _imItems_S4 [2].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true)); //_mainLayout.AddView (_imItems_S4[3]); _imItems_S4[3].SetX (Configuration.getWidth(421));_imItems_S4[3].SetY (Configuration.getHeight(1069)); _imItems_S4 [3].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (30), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4 [4]); _imItems_S4[4].SetX (Configuration.getWidth(540));_imItems_S4[4].SetY (Configuration.getHeight(1069)); _imItems_S4 [4].Visibility = Android.Views.ViewStates.Invisible; //---------------------------------------------------------- //Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header1.png")); header = new LinearLayout(context); header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125)); header.Orientation = Orientation.Vertical; //header.SetBackgroundDrawable (dr); //_mainLayout.SetBackgroundDrawable (dr); _mainLayout.AddView(header); //dr = null; _workspace = new LinearLayout (context); _workspace.LayoutParameters = new LinearLayout.LayoutParams (-1, -1); //_workspace.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.SetY (Configuration.getHeight (110)); _mainLayout.AddView (_workspace); //_mainLayout.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.AddView (_foro); //_workspace.Visibility = Android.Views.ViewStates.Invisible; }
private void initUi() { _mainLayout = new RelativeLayout (context); _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1); _scrollItems = new VerticalScrollView (context); _scrollItems.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(965)); _scrollItems.SetY (Configuration.getHeight (125)); initItems (); _scrollItems.AddView (_linearContentLayout); _mainLayout.AddView (_scrollItems); _publicidadLayout = new LinearLayout (context); _publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85)); Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg")); _publicidadLayout.SetBackgroundDrawable (dr); _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)); } }; }
void showAd(int idAd) { adOpen = true; _adLayout = new LinearLayout (context); _adLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (255)); Drawable dr = new BitmapDrawable (getBitmapFromAsset (adsImagesPath[idAd])); _adLayout.SetBackgroundDrawable (dr); _adLayout.SetY (Configuration.getHeight(1136-85-255)); _mainLayout.AddView (_adLayout); _adLayout.Click += delegate { String url = "https://www.facebook.com/HiTecPe/"; Intent i = new Intent (Intent.ActionView); i.SetData (Android.Net.Uri.Parse (url)); context.StartActivity(i); }; }
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")); mapSpace.AddView (mapImage); /* mapImage.PivotX = mapImage.Width/2; mapImage.PivotY = mapImage.Height/2; mapImage.ScaleX = (float)1.5; mapImage.ScaleY = (float)1.5; */ 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 (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 (); }
public void setBack(Drawable dr) { drBack = dr; linearContainerFisrst.SetBackgroundDrawable(drBack); drBack = null; }
public void setFooterBackground(Drawable background) { linearGradiente.SetBackgroundDrawable(background); }
private void initItems() { var textFormat = Android.Util.ComplexUnitType.Px; _linearContentLayout = new LinearLayout(context); _linearContentLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _linearContentLayout.Orientation = Orientation.Vertical; List <string> title = new List <string> (); List <string> type = new List <string> (); List <string> coverImagePath = new List <string> (); List <string> numLikes = new List <string> (); List <string> numTypes = new List <string> (); numLikes.Add("10"); numLikes.Add("10"); numLikes.Add("10"); numLikes.Add("10"); numTypes.Add("3"); //3 numTypes.Add("7"); //7 numTypes.Add("4"); //4 numTypes.Add("9"); //9 title.Add(""); // ("¿Cómo usar la guía?"); title.Add(""); // ("Preparando la partida"); title.Add(""); //("La palabra del experto"); title.Add(""); type.Add("cifras"); type.Add("guias"); type.Add("guias"); type.Add("rutas"); coverImagePath.Add("images/fondoBlanco.png"); //("images/fondocaminoinca.png"); coverImagePath.Add("images/fondoBlanco.png"); //("images/fondovidasilvestre.png"); coverImagePath.Add("images/fondoBlanco.png"); //("images/fondoguias.png"); coverImagePath.Add("images/fondoBlanco.png"); int heightItem = Configuration.getHeight(310); for (int i = 0; i < title.Count; i++) { LinearLayout item = new LinearLayout(context); item.LayoutParameters = new LinearLayout.LayoutParams(-1, heightItem); item.Orientation = Orientation.Horizontal; item.SetGravity(GravityFlags.Center); Drawable cover = new BitmapDrawable(getBitmapFromAsset(coverImagePath[i])); item.SetBackgroundDrawable(cover); _coverImages.Add(cover); TextView itemTitle = new TextView(context); itemTitle.Text = title [i]; itemTitle.SetTextColor(Color.ParseColor("#ffffff")); itemTitle.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); itemTitle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(45)); LinearLayout linearTitle = new LinearLayout(context); linearTitle.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(465), Configuration.getHeight(180)); linearTitle.Orientation = Orientation.Vertical; linearTitle.SetGravity(GravityFlags.Center); linearTitle.AddView(itemTitle); ImageView iconlike = new ImageView(context); //iconlike.SetImageBitmap(likeBitmap); LinearLayout linearLike = new LinearLayout(context); linearLike.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearLike.Orientation = Orientation.Vertical; linearLike.SetGravity(GravityFlags.CenterHorizontal); TextView txtnumLike = new TextView(context); txtnumLike.Text = numLikes[i]; txtnumLike.Gravity = GravityFlags.CenterHorizontal; txtnumLike.SetTextColor(Color.ParseColor("#ffffff")); LinearLayout linearType = new LinearLayout(context); linearType.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearType.Orientation = Orientation.Vertical; linearType.SetGravity(GravityFlags.CenterHorizontal); TextView txtnumType = new TextView(context); txtnumType.Text = numTypes[i]; txtnumType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtnumType.TextSize = Configuration.getHeight(15); txtnumType.Gravity = GravityFlags.CenterHorizontal; txtnumType.SetTextColor(Color.ParseColor("#ffffff")); TextView txtType = new TextView(context); txtType.Text = type[i]; txtType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); txtType.TextSize = Configuration.getHeight(15); txtType.Gravity = GravityFlags.CenterHorizontal; txtType.SetTextColor(Color.ParseColor("#ffffff")); int space = Configuration.getHeight(20); linearLike.SetPadding(0, 0, 0, space); linearType.SetPadding(space, 0, 0, 0); linearType.AddView(txtnumType); linearType.AddView(txtType); LinearLayout linearExtraInfo = new LinearLayout(context); linearExtraInfo.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(100), -2); linearExtraInfo.Orientation = Orientation.Vertical; linearExtraInfo.SetGravity(GravityFlags.CenterHorizontal); linearExtraInfo.AddView(linearLike); linearExtraInfo.AddView(linearType); item.AddView(linearTitle); //item.AddView (linearExtraInfo); _listLinearItem.Add(item); _linearContentLayout.AddView(_listLinearItem [i]); } }
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 (); }
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 (); }
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")); mapSpace.AddView(mapImage); /* * mapImage.PivotX = mapImage.Width/2; * mapImage.PivotY = mapImage.Height/2; * mapImage.ScaleX = (float)1.5; * mapImage.ScaleY = (float)1.5; */ 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(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 (); }