Exemple #1
0
		public MainView (MainActivity activity) : base (activity)
		{
			BackgroundColor = CustomColors.LightColor;
			horizontalMenu = new HorizontalMenu (activity);

			contentContainer = new UIView (activity);

			mapView = new LocationView (activity);
			mapView.LayoutParameters = LayoutUtils.GetRelativeMatchParent ();

			myPlacesView = new MyPlacesView (activity);

			myPlacesView.TranslationX = DeviceInfo.ScreenWidth;

			contentContainer.AddViews (
				mapView,
				myPlacesView
			);

			AddViews (
				horizontalMenu,
				contentContainer
			);

			Frame = new Frame (DeviceInfo.ScreenWidth, DeviceInfo.TrueScreenHeight);

			horizontalMenu.OnLabelClick += SwitchContent;
		}
Exemple #2
0
		public TermsView (InfoActivity termsActivity) : base (termsActivity)
		{
			BackgroundColor = CustomColors.LightBackground;

			infoLabel = new UILabel (termsActivity);
			infoLabel.Text = Strings.AboutUsText;
			infoLabel.TextColor = CustomColors.DarkColor;
			infoLabel.TextSize = Sizes.GetRealSize (8);

			aboutUsLabel = new UILabel (termsActivity);
			aboutUsLabel.Text = "About Us";
			aboutUsLabel.TextColor = CustomColors.DarkColor;
			aboutUsLabel.TextSize = Sizes.GetRealSize (12);
			aboutUsLabel.Measure (0, 0);
			aboutUsLabel.Gravity = GravityFlags.CenterVertical;
			AddViews (
				infoLabel,
				aboutUsLabel
			);

			Frame = new Frame (
				DeviceInfo.ScreenWidth,
				DeviceInfo.ScreenHeight - DeviceInfo.StatusBarHeight
			);
		}
Exemple #3
0
		public ParkingLotCell (Activity activity) : base (activity)
		{
			nameLabel = new ParkingLotCellLabel (activity);
			nameLabel.TextSize = Sizes.GetRealSize (9);
			nameLabel.Gravity = GravityFlags.Bottom;

			freeSlotsLabel = new ParkingLotCellLabel (activity);
			freeSlotsLabel.TextSize = Sizes.GetRealSize (7);

			arrowImage = new UIImageView (activity);
			arrowImage.SetScaleType (ImageView.ScaleType.CenterInside);
			arrowImage.ImageResource = Resource.Drawable.nool;

			AddViews (
				nameLabel, 
				freeSlotsLabel,
				arrowImage
			);

			Frame = new Frame (DeviceInfo.ScreenWidth - 2 * Sizes.ListViewPadding, Sizes.ParkingLotCellHeight);
		}
Exemple #4
0
		public int SizeHeightToFitWithMin (int min)
		{
			Measure (0, 0);

			int height = MeasuredHeight;

			if (MeasuredHeight < min) {
				height = min;
			}

			Frame = new Frame (Frame.X, Frame.Y, Frame.W, height);
			return height;
		}
Exemple #5
0
		public void UpdateFrameBy (int x, int y, int w, int h)
		{
			Frame = new Frame (Frame.X + x, Frame.Y + y, Frame.W + w, Frame.H + h);
		}
Exemple #6
0
		public void UpdateHeight (int height)
		{
			Frame = new Frame (Frame.X, Frame.Y, Frame.W, height);
		}
Exemple #7
0
		public void UpdateX (int x)
		{
			Frame = new Frame (x, Frame.Y, Frame.W, Frame.H);
		}
Exemple #8
0
		public void UpdateY (int y)
		{
			Frame = new Frame (Frame.X, y, Frame.W, Frame.H);
		}
Exemple #9
0
		public void AnimateXAndWidth (Frame newFrame, Action completed)
		{
			ObjectAnimator xAnim = ObjectAnimator.OfFloat (this, LEFT_MARGIN, (float)Frame.X, (float)newFrame.X);
			ObjectAnimator wAnim = ObjectAnimator.OfInt (this, NEW_WIDTH, Frame.W, newFrame.W);

			AnimatorSet set = new AnimatorSet ();
			set.SetDuration (FRAMEANIMATIONTIME);
			set.PlayTogether (new ObjectAnimator[] { xAnim, wAnim });

			set.Start ();

			set.AnimationEnd += delegate {
				completed ();
			};
		}
Exemple #10
0
		public void AnimateWidth (Frame newFrame, Action completed)
		{
			ObjectAnimator wAnim = ObjectAnimator.OfInt (this, NEW_WIDTH, Frame.W, newFrame.W);

			wAnim.SetDuration (FRAMEANIMATIONTIME);

			wAnim.Start ();

			wAnim.AnimationEnd += delegate {
				completed ();
			};
		}
Exemple #11
0
		public void AnimateX (Frame newFrame)
		{
			ObjectAnimator xAnim = ObjectAnimator.OfInt (this, LEFT_MARGIN, Frame.X, newFrame.X);

			xAnim.SetDuration (FRAMEANIMATIONTIME);

			xAnim.Start ();
		}
Exemple #12
0
		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);
		}
Exemple #13
0
		public void AnimateX (Frame newFrame, Action completed)
		{
			ObjectAnimator xAnim = ObjectAnimator.OfInt (this, LEFT_MARGIN, Frame.X, newFrame.X);

			xAnim.SetDuration (200);

			xAnim.Start ();

			xAnim.AnimationEnd += delegate {
				completed ();
			};
		}
Exemple #14
0
		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;
		}