public ParkingLotView (Activity activity, ParkingLotInfo info) : base (activity) { this.activity = activity; parkingLotInfo = info; backgroundImage = new UIImageView (activity); backgroundImage.ImageResource = Resource.Drawable.app_parking_background; backgroundImage.SetScaleType (Android.Widget.ImageView.ScaleType.CenterCrop); backgroundImage.LayoutParameters = LayoutUtils.GetRelativeMatchParent (); infoContainer = new UIView (activity); infoContainer.SetRoundBordersWithColor ( CustomColors.LightColor, Sizes.LoginInputHeight / 3, Sizes.LoginSeparatorSize ); nameLabel = new ParkingLotLabel (activity); nameLabel.Text = parkingLotInfo.Name; nameLabel.TextSize = Sizes.GetRealSize (10); // locationLabel = new ParkingLotLabel (activity); // locationLabel.Text = parkingLotInfo.Location; // locationLabel.TextSize = Sizes.GetRealSize (8); freeSpotsLabel = new ParkingLotLabel (activity); freeSpotsLabel.TextSize = Sizes.GetRealSize (8); UpdateFreeSpots (); startParkingButton = new ParkingLotLabel (activity); startParkingButton.TextSize = Sizes.GetRealSize (9); startParkingButton.TextColor = CustomColors.DarkColor; if (LoginState.ActiveUser != null && LoginState.ActiveUser.ParkingLotInUse == info) { startParkingButton.Text = Strings.EndParking; } else { if (LoginState.ActiveUser.ParkingLotInUse == null) { startParkingButton.Text = Strings.StartParking; } else { startParkingButton.Text = "Parking at: " + LoginState.ActiveUser.ParkingLotInUse.Name; } } int radius = (int)(Sizes.ParkingViewLabelHeight * 0.6f); startParkingButton.SetCornerRadiusWithColor (CustomColors.LightColor, new float[] { 0, 0, 0, 0, radius, radius, radius, radius } ); startParkingButton.Click += HandleStartParkingClick; separator = new UIView (activity); separator.BackgroundColor = CustomColors.LightColor; infoContainer.AddViews ( nameLabel, separator, // locationLabel, freeSpotsLabel ); navigateButton = new ParkingLotLabel (activity); navigateButton.Text = Strings.Navigate; navigateButton.TextSize = Sizes.GetRealSize (10); navigateButton.Click += HandleNavigateClick; navigateButtonContainer = new UIView (activity); navigateButtonContainer.SetRoundBordersWithColor ( CustomColors.LightColor, Sizes.LoginInputHeight / 3, Sizes.LoginSeparatorSize ); navigateButtonContainer.AddView (navigateButton); AddViews ( backgroundImage, infoContainer, startParkingButton, navigateButtonContainer ); Frame = new Frame (DeviceInfo.ScreenWidth, DeviceInfo.TrueScreenHeight); }
public LoginView (LoginActivity activity) : base (activity) { this.activity = activity; backgroundImage = new UIImageView (activity); backgroundImage.ImageResource = Resource.Drawable.landing_backg; backgroundImage.SetScaleType (Android.Widget.ImageView.ScaleType.CenterCrop); backgroundImage.LayoutParameters = LayoutUtils.GetRelativeMatchParent (); inputContainer = new UIView (activity); inputContainer.SetRoundBordersWithColor (CustomColors.LightColor, Sizes.LoginInputHeight / 3, Sizes.LoginSeparatorSize); FocusableInTouchMode = true; emailInput = new UITextField (activity); emailInput.Hint = "E - M A I L"; emailInput.Gravity = GravityFlags.Center; emailInput.SetSingleLine (); emailInput.InputType = Android.Text.InputTypes.TextVariationEmailAddress; emailInput.TextSize = Sizes.GetRealSize (9); emailInput.TextColor = CustomColors.LightColor; emailInput.SetHintTextColor (CustomColors.LightColorDim); emailInput.SetPadding (1, 1, 1, 1); emailInput.ClearFocus (); passwordInput = new UITextField (activity); passwordInput.Hint = "P A S S W O R D"; passwordInput.Gravity = GravityFlags.Center; passwordInput.SetSingleLine (); passwordInput.InputType = Android.Text.InputTypes.TextVariationPassword; passwordInput.TextSize = Sizes.GetRealSize (9); passwordInput.TextColor = CustomColors.LightColor; passwordInput.SetPadding (1, 1, 1, 1); passwordInput.SetHintTextColor (CustomColors.LightColorDim); separator = new UIView (activity); separator.BackgroundColor = CustomColors.LightColor; inputContainer.AddViews ( emailInput, separator, passwordInput ); loginButton = new UILabelButton (activity); loginButton.Text = "L O G I N"; loginButton.Gravity = GravityFlags.Center; loginButton.BackgroundColor = CustomColors.DarkColor; loginButton.TextSize = Sizes.GetRealSize (9); loginButton.SetPadding (1, 1, 1, 1); // loginButton.Font = Font.Get (FontStyle.Serif, 11); loginButton.Measure (0, 0); loginButton.TextColor = CustomColors.LightColor; int radius = (int)(loginButton.MeasuredHeight * 0.7f); loginButton.SetCornerRadiusWithColor (CustomColors.DarkColor, new float[] { 0, 0, 0, 0, radius, radius, radius, radius } ); loaderView = new LoaderView (activity); AddViews ( backgroundImage, inputContainer, loginButton, loaderView ); Frame = new Frame (DeviceInfo.ScreenWidth, DeviceInfo.ScreenHeight - DeviceInfo.StatusBarHeight); loginButton.Click += HandleLoginClicked; }