Example #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;
		}
Example #2
0
		public LocationView (MainActivity activity) : base (activity)
		{
			this.activity = activity;
			MapsInitializer.Initialize (activity);

			GoogleMapOptions mapOptions = new GoogleMapOptions()
				.InvokeMapType(GoogleMap.MapTypeNormal)
				.InvokeZoomControlsEnabled(false)
				.InvokeCompassEnabled(true);
			


			mapFragment = MapFragment.NewInstance ();

			mapFragment = MapFragment.NewInstance(mapOptions);

			var ft = activity.FragmentManager.BeginTransaction ();
			Id = View.GenerateViewId();
			ft.Add (Id, mapFragment);
			ft.Commit ();

			DoMapStuff ();
		}
Example #3
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 ();
		}