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 ); }
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 ); }
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 (); }