예제 #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 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);
		}
예제 #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);
		}