Пример #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;
		}
Пример #2
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 ();
		}
Пример #3
0
		public LoaderView (Activity activity) : base (activity)
		{
			staticBall = new UIView (activity);
			expandingBall = new UIView (activity);

			AddViews (
				staticBall,
				expandingBall
			);
			Visibility = ViewStates.Gone;
		}
Пример #4
0
		public MenuButton (Activity activity) : base (activity)
		{
			label = new UILabel (activity);
			label.TextColor = CustomColors.LightColor;
			label.TextSize = Sizes.GetRealSize (10);
			label.Gravity = GravityFlags.CenterVertical;

			underLine = new UIView (activity);
			underLine.BackgroundColor = CustomColors.LightColor;

			AddViews (
				label,
				underLine
			);
		}
Пример #5
0
		public MyPlacesView (Activity activity) : base (activity)
		{
			listView = new UIListView (activity);
			listView.LayoutParameters = new ViewGroup.LayoutParams (
				ViewGroup.LayoutParams.MatchParent,
				ViewGroup.LayoutParams.MatchParent
			);

			listView.Divider = new ColorDrawable (CustomColors.DarkColor);
			listView.DividerHeight = Sizes.LoginSeparatorSize;

			adapter = new MyPlacesListAdapter (activity);
			listView.Adapter = adapter;

			container = new UIView (activity);
			container.AddView (listView);
			AddView (container);
		}
Пример #6
0
		public void AddBorders (Activity context, bool left, bool right, bool top, bool bottom)
		{
			if (left) {
				leftBorder = new UIView (context) { BackgroundColor = borderColor };
				AddView (leftBorder);
			}

			if (right) {
				rightBorder = new UIView (context) { BackgroundColor = borderColor };
				AddView (rightBorder);
			}

			if (top) {
				topBorder = new UIView (context) { BackgroundColor = borderColor };
				AddView (topBorder);
			}

			if (bottom) {
				bottomBorder = new UIView (context) { BackgroundColor = borderColor };
				AddView (bottomBorder);
			}
		}
Пример #7
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);
		}
Пример #8
0
		public MenuPopupView (MainActivity activity, IWindowManager WindowManager) : base (activity, WindowManager)
		{
			backgroundView = new UIView (activity);
			backgroundView.BackgroundColor = Color.Black;
			backgroundView.Alpha = 0;
			backgroundView.Frame = new Frame (DeviceInfo.ScreenWidth, DeviceInfo.ScreenHeight);

			this.activity = activity;
			popupWidth = DeviceInfo.ScreenWidth;

			closeTouchableArea = new UIView (activity);
			closeTouchableArea.Frame = new Frame (
				(int)(popupWidth * 0.8), 
				0, 
				(int)(popupWidth * 0.2), 
				ViewGroup.LayoutParams.MatchParent
			);

			container = new UIView (activity);
			container.BackgroundColor = CustomColors.DarkColor;
			container.Frame = new Frame (
				(int)(popupWidth * 0.8), 
				DeviceInfo.ScreenHeight
			);
			container.TranslationX = -1 * popupWidth;

			loginButton = new MenuButton (activity);
			loginButton.Click += OnLoginClick;

			infoButton = new MenuButton (activity);
			infoButton.Text = Strings.AboutUs;
			infoButton.Click += HandleInfoClick;

			historyButton = new MenuButton (activity);
			historyButton.Text = Strings.History;

			profileButton = new MenuButton (activity);
			profileButton.Text = Strings.Profile;

			buttonsContainer = new UIView (activity);
			buttonsContainer.AddViews (
				loginButton,
				infoButton,
				profileButton,
				historyButton
			);

			userNameLabel = new UILabel (activity);
			userNameLabel.Gravity = GravityFlags.Center;
			userNameLabel.Typeface = Typeface.CreateFromAsset(activity.Assets, "fonts/Lato-Bold.ttf");
			userNameLabel.TextSize = Sizes.GetRealSize (9);

			userNameLabel.TextColor = CustomColors.LightColor;
			userNameLabel.SetSingleLine ();
			userNameLabel.Ellipsize = Android.Text.TextUtils.TruncateAt.End;


			container.AddViews (
				buttonsContainer,
				userNameLabel
			);

			AddViews (
				backgroundView,
				closeTouchableArea, 
				container
			);

			UpdateView ();
		}
Пример #9
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;
		}