void LayoutChanged( ) { float prayerRegionHeight = GetPrayerRegionHeight( ); float cardWidth = GetCardWidth( ); float cardHeight = GetCardHeight( ); // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right float cardYOffset = (prayerRegionHeight - cardHeight) / 2; PrayerCardSize = new RectangleF(0, 0, cardWidth, cardHeight); Carousel.LayoutChanged(cardWidth, cardHeight, new RectangleF(0, cardYOffset, NavbarFragment.GetCurrentContainerDisplayWidth( ), prayerRegionHeight)); // now update the layout for each prayer card foreach (PrayerCard prayerCard in PrayerRequestCards) { prayerCard.LayoutChanged(PrayerCardSize); } }
public override void LayoutChanged() { base.LayoutChanged(); float viewRealHeight = (float)(View.Bounds.Height - Task.NavToolbar.Frame.Height); float cardSizePerc = .83f; float cardWidth = (float)(View.Bounds.Width * cardSizePerc); float cardHeight = (float)(viewRealHeight * cardSizePerc); float cardYOffset = (viewRealHeight * .03f); // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right Carousel.LayoutChanged(cardWidth, cardHeight, new System.Drawing.RectangleF(0, cardYOffset, (float)View.Bounds.Width, viewRealHeight)); CardSize = new CGRect(0, 0, cardWidth, cardHeight); for (int i = 0; i < PrayerRequests.Count; i++) { PrayerRequests[i].LayoutChanged(CardSize.ToRectF( )); } BlockerView.SetBounds(View.Bounds.ToRectF( )); ResultView.SetBounds(View.Bounds.ToRectF( )); }