private void CreateMediaView(int pos, string title, HorizontalScrollView hsv) { float width = UIScreen.MainScreen.Bounds.Width; float topY = 42; SizeF size = new SizeF(width, 480 - topY); var rootElement = new RootElement (title) { UnevenRows = true }; var section = new Section(GetSubTitle(LocType, pos)); rootElement.Add(section); FilterType filter = GetFilter(pos); var mediaView = new TimelineViewController(filter, true, _MSP, this) { Root = rootElement, }; mediaView.View.Frame = new System.Drawing.RectangleF(new PointF((pos - 1)* width, 0), size); hsv.Add(mediaView.View); mediaViews.Add(mediaView); }
private void Initialize() { locationManager = new CLLocationManager(); locationManager.DesiredAccuracy = -1; locationManager.DistanceFilter = 50; locationManager.HeadingFilter = 1; locationManager.UpdatedLocation += UpdatedLocation; globalBtn.SetImage(Graphics.GetImgResource("global"), UIControlState.Normal); localBtn.SetImage(Graphics.GetImgResource("local"), UIControlState.Normal); mapBtn.SetImage(Graphics.GetImgResource("map"), UIControlState.Normal); globalBtn.TouchUpInside += HandleGlobalBtnTouchUpInside; localBtn.TouchUpInside += HandleLocalBtnTouchUpInside; float width = UIScreen.MainScreen.Bounds.Width; float topY = 42; SizeF size = new SizeF(width, 480 - topY); var hsv = new HorizontalScrollView() { Frame = new RectangleF(new PointF(0, topY), size), ContentSize = new SizeF(width * 4, size.Height - 20 - topY), }; hsv.Scrolled += HandleHsvScrolled; CreateMediaView(1, "liked", hsv); CreateMediaView(2, "recent", hsv); CreateMediaView(3, "friends", hsv); CreateMediaView(4, "events", hsv); this.View.AddSubview(hsv); UpdateLabels(LocalisationType.Global); }