示例#1
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			logoImage = new UIImageView (this);
			logoImage.ImageResource = Resource.Drawable.esilehe_logo;
			logoImage.SetScaleType (ImageView.ScaleType.CenterInside);
			logoImage.LayoutParameters = LayoutUtils.GetRelativeMatchParent ();

			menuImageContainer = new UIView (this);
			menuImageContainer.Frame = new Frame (
				0,
				0,
				DeviceInfo.NavigationBarHeight + Sizes.ActionBarButtonSize,
				DeviceInfo.NavigationBarHeight
			);

			menuImage = new UIImageView (this);
			menuImage.ImageResource = Resource.Drawable.burger;
			menuImage.SetScaleType (ImageView.ScaleType.CenterInside);
			menuImage.Frame = new Frame (
				0,
				(menuImageContainer.Frame.H - Sizes.ActionBarButtonSize) / 2,
				Sizes.ActionBarButtonSize,
				Sizes.ActionBarButtonSize
			);

			menuImageContainer.AddView (menuImage);

			actionBarContainer = new UIView (this);
			actionBarContainer.Frame = new Frame (DeviceInfo.ScreenWidth, DeviceInfo.NavigationBarHeight);
			actionBarContainer.AddViews (
				logoImage,
				menuImageContainer
			);

			ActionBar.SetDisplayShowCustomEnabled (true);

			this.ActionBar.SetCustomView (
				actionBarContainer, 
				new ActionBar.LayoutParams (DeviceInfo.ScreenWidth, DeviceInfo.NavigationBarHeight)
			);




			locMgr = GetSystemService (Context.LocationService) as LocationManager;




			contentView = new MainView (this);
			SetContentView (contentView);

			menuPopup = new MenuPopupView (this, WindowManager);
			menuPopup.UpdateView ();

			menuImageContainer.Click += (object sender, System.EventArgs e) => ShowMenu ();
		}
示例#2
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);
		}
示例#3
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);
		}
示例#4
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;
		}