// таймер слежени¤ за состо¤нием соединени¤ с брокером private void timethread_function() { while (true) { if (m_watch.ElapsedMilliseconds - m_timer_count1000 > 1000 && m_timer_enable == true) { if (mqttClient == null || !mqttClient.IsConnected) { if (!m_has_fail_connect) { // Time tick 1ms RunOnUiThread(() => { m_frame_bottom.SetBackgroundColor(Color.Gray); m_has_fail_connect = true; }); } } if (m_has_fail_connect && !m_broker_last_fail && ((ConnectivityManager)GetSystemService(ConnectivityService)).ActiveNetworkInfo != null && ((ConnectivityManager)GetSystemService(ConnectivityService)).ActiveNetworkInfo.IsConnected && (mqttClient == null || !mqttClient.IsConnected)) { RunOnUiThread(() => { if (MqttConnect()) { SubscrieAllDev(); AskAllDev(); } else { m_broker_last_fail = true; } }); } m_timer_count1000 = m_watch.ElapsedMilliseconds; } if (m_watch.ElapsedMilliseconds - m_timer_count10000 > 10000 && m_timer_enable == true) { if (m_broker_last_fail) { RunOnUiThread(() => { if (MqttConnect()) { SubscrieAllDev(); AskAllDev(); m_broker_last_fail = false; } }); } m_timer_count10000 = m_watch.ElapsedMilliseconds; } } }
private void ColorSpinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { AccentColor selectedColor = AccentColors.GetAccentColors()[e.Position]; if (selectedColor != currentAccentColor && !ignoreSelection) { currentAccentColor = selectedColor; colorLayout.SetBackgroundColor(GetColor(currentAccentColor)); editor.PutString(ACCENT_COLOR_KEY, AccentColors.GetResource(currentAccentColor)).Commit(); } ignoreSelection = false; }
private void SetContentView() { var matchParent = ViewGroup.LayoutParams.MatchParent; var rootLinearLayout = new LinearLayout(this) { LayoutParameters = new ViewGroup.LayoutParams(matchParent, matchParent), Orientation = Orientation.Horizontal }; // add menu fragment var menuFrameLayout = new FrameLayout(this) { Id = AndroidApp.CurrentApp.GenerateViewId(), LayoutParameters = new LinearLayout.LayoutParams(0, matchParent, 1f) }; rootLinearLayout.AddView(menuFrameLayout); this._menuFrameLayoutId = menuFrameLayout.Id; // if is large screen, add content frame layout if (AndroidApp.CurrentApp.IsLargeScreen()) { var contentFrameLayout = new FrameLayout(this) { Id = AndroidApp.CurrentApp.GenerateViewId(), LayoutParameters = new LinearLayout.LayoutParams(0, matchParent, 3f) }; contentFrameLayout.SetBackgroundColor(new Android.Graphics.Color(0x33, 0x33, 0x33, 0xff)); rootLinearLayout.AddView(contentFrameLayout); this._contentFrameLayoutId = contentFrameLayout.Id; } this.SetContentView(rootLinearLayout); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { layout = new FrameLayout(Activity); layout.SetBackgroundColor(Color.White); // // Build the UI // webView = new WebView(Activity) { Id = 42 }; webView.Settings.JavaScriptEnabled = true; webView.SetWebViewClient(new Client(this)); layout.AddView(webView); // // Restore the UI state or start over // if (savedInstanceState != null) { webView.RestoreState(savedInstanceState); } else { if (Activity.Intent.GetBooleanExtra("ClearCookies", false)) { WebAuthenticator.ClearCookies(); } } return(layout); }
private void UpdateEffectColor() { _view.Touch -= OnTouch; _layer?.Dispose(); _layer = null; var color = TouchEffect.GetColor(Element); if (color == Color.Default) { return; } _color = color.ToAndroid(); if (EnableRipple) { _ripple.SetColor(GetPressedColorSelector(_color)); } else { _layer = new FrameLayout(Container.Context) { LayoutParameters = new ViewGroup.LayoutParams(-1, -1) }; _layer.SetBackgroundColor(_color); _view.Touch += OnTouch; } }
public View GetItemView(SfCarousel carousel, int index) { double density1; int width1, height1; List <int> imageID = new List <int>(); width1 = myComtext.Resources.DisplayMetrics.WidthPixels; height1 = myComtext.Resources.DisplayMetrics.HeightPixels; density1 = myComtext.Resources.DisplayMetrics.Density; FrameLayout linear = new FrameLayout(myComtext); linear.SetBackgroundColor(Color.White); linear.LayoutParameters = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, (int)(110 * density1)); var item = myList[index]; TextView Srcimage = new TextView(myComtext); Srcimage.Text = (myList[index] as CarouselPropertyClass).Unicode; Srcimage.Typeface = Typeface.CreateFromAsset(myComtext.Assets, "CarouselIcon.ttf"); Srcimage.SetTextColor((myList[index] as CarouselPropertyClass).ItemColor); Srcimage.TextSize = 40; Srcimage.SetWidth((int)(110 * density1)); Srcimage.SetHeight((int)(110 * density1)); Srcimage.TextAlignment = TextAlignment.Center; Srcimage.Gravity = GravityFlags.Center; linear.AddView(Srcimage); return(linear); }
public override View GetSampleContent(Context con) { SamplePageContent(con); /*************** **RangeSlider** ***************/ range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, GettingStarted_Mobile.getDimensionPixelSize(con, Resource.Dimension.range_ht))); range.ValueChanged += ValueChanged; range.SetY(-30); //Frame Layout FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor(Color.White); frame.LayoutParameters = (new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); frame.AddView(GetView(con)); return(frame); }
public override View GetView(View view, int position) { var itemData = menuItems[position]; View root = layoutInflater.Inflate(Resource.Layout.WheelTextLayout, null, false); TextView textView = root.FindViewById <TextView>(Resource.Id.wheel_menu_item_tv); textView.Visibility = ViewStates.Visible; textView.SetTextSize(Android.Util.ComplexUnitType.Sp, 14); textView.Text = itemData.mTitle; if (textView.LayoutParameters is FrameLayout.LayoutParams) { ((FrameLayout.LayoutParams)textView.LayoutParameters).Gravity = mGravity; } if (position == 4) { textView.SetTextColor(Android.Graphics.Color.Red); } if (position == 0) { FrameLayout container = root.FindViewById <FrameLayout>(Resource.Id.TextContainer); container.SetBackgroundColor(Android.Graphics.Color.Transparent); container.SetBackgroundResource(Resource.Drawable.slice_happy); container.SetMinimumHeight(340); container.SetPadding(0, 0, 0, 0); //container.s } return(root); }
void UpdateEffectColor() { _view.Touch -= View_Touch; if (_layer != null) { _layer.Dispose(); _layer = null; } var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { return; } if (_useRipple) { _ripple.SetColor(getPressedColorSelector(color.ToAndroid())); } else { _layer = new FrameLayout(Container.Context); _layer.LayoutParameters = new ViewGroup.LayoutParams(-1, -1); _layer.SetBackgroundColor(color.ToAndroid()); _view.Touch += View_Touch; } }
public LiveOrdersLayout(Context context) : base(context) { this.Orientation = Orientation.Horizontal; this.SetBackgroundColor(Color.White); FrameLayout leftFrame = new FrameLayout(context); leftFrame.Id = 1; leftFrame.SetMinimumHeight(500); leftFrame.SetMinimumWidth(700); leftFrame.SetBackgroundColor(Color.White); this.AddView(leftFrame); FrameLayout rightFrame = new FrameLayout(context); rightFrame.Id = 2; rightFrame.SetMinimumHeight(700); rightFrame.SetMinimumWidth(1190); rightFrame.SetBackgroundColor(Color.White); this.AddView(rightFrame); ordersFragment = new LiveOrdersFragment(); orderFragment = new OrderFragment(); Activity activity = (Activity)context; FragmentTransaction ft = activity.FragmentManager.BeginTransaction(); ft.Add(leftFrame.Id, ordersFragment); ft.Add(rightFrame.Id, orderFragment); ft.Commit(); }
public FrameLayout Get_game_Button() //egy gomb legenerálása { FrameLayout gamebuttonBorder; using (var gameButtonButton = new FrameLayout(_parentContext)) { gamebuttonBorder = new FrameLayout(_parentContext); var itsValue = new TextView(_parentContext) { LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; itsValue.SetTextColor(Color.Black); itsValue.TextSize = get_text_Size(); itsValue.Gravity = GravityFlags.Center; if (_number != 0) { itsValue.Text = _number.ToString(); } var metrics = _parentContext.Resources.DisplayMetrics; var widthInDp = metrics.WidthPixels - _aSide * 10; gameButtonButton.LayoutParameters = new TableRow.LayoutParams(widthInDp / _aSide - 10, widthInDp / _aSide - 10); gamebuttonBorder.LayoutParameters = new TableRow.LayoutParams(widthInDp / _aSide + 10, widthInDp / _aSide + 10); gamebuttonBorder.SetBackgroundColor(Color.Black); gameButtonButton.AddView(itsValue); gamebuttonBorder.AddView(gameButtonButton); } return(gamebuttonBorder); }
public HSVColorPickerDialog(Context context, Color initialColor, Action <Color> listener) : base(context) { this.selectedColor = initialColor; this.listener = listener; colorWheel = new HSVColorWheel(context); valueSlider = new HSVValueSlider(context); var padding = (int)(context.Resources.DisplayMetrics.Density * PADDING_DP); var borderSize = (int)(context.Resources.DisplayMetrics.Density * BORDER_DP); var layout = new RelativeLayout(context); var lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP); colorWheel.setListener((color) => valueSlider.SetColor(color, true)); colorWheel.setColor(initialColor); colorWheel.Id = (1); layout.AddView(colorWheel, lp); int selectedColorHeight = (int)(context.Resources.DisplayMetrics.Density * SELECTED_COLOR_HEIGHT_DP); var valueSliderBorder = new FrameLayout(context); valueSliderBorder.SetBackgroundColor(BORDER_COLOR); valueSliderBorder.SetPadding(borderSize, borderSize, borderSize, borderSize); valueSliderBorder.Id = (2); lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize); lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP); lp.AddRule(LayoutRules.Below, 1); layout.AddView(valueSliderBorder, lp); valueSlider.SetColor(initialColor, false); valueSlider.SetListener((color) => { selectedColor = color; selectedColorView.SetBackgroundColor(color); }); valueSliderBorder.AddView(valueSlider); var selectedColorborder = new FrameLayout(context); selectedColorborder.SetBackgroundColor(BORDER_COLOR); lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize); selectedColorborder.SetPadding(borderSize, borderSize, borderSize, borderSize); lp.AddRule(LayoutRules.Below, 2); layout.AddView(selectedColorborder, lp); selectedColorView = new View(context); selectedColorView.SetBackgroundColor(selectedColor); selectedColorborder.AddView(selectedColorView); SetButton((int)DialogButtonType.Negative, context.GetString(Android.Resource.String.Cancel), ClickListener); SetButton((int)DialogButtonType.Positive, context.GetString(Android.Resource.String.Ok), ClickListener); SetView(layout, padding, padding, padding, padding); }
private void ShowLabelLayout() { //Show Label showLable = new TextView(con); showLable.TextSize = 10; showLable.SetTextColor(Color.ParseColor("#282828")); UpdateText(sfRating.Value); valueLayout.AddView(showLable); pageLayout.AddView(valueLayout); //frame frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor(Color.White); frame.SetPadding(10, 10, 10, 10); //scrollView1 ScrollView scrollView1 = new ScrollView(con); scrollView1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.7), GravityFlags.Top | GravityFlags.CenterHorizontal); scrollView1.AddView(pageLayout); frame.AddView(scrollView1); //buttomButtonLayout buttomButtonLayout = new FrameLayout(con); buttomButtonLayout.SetBackgroundColor(Color.Transparent); buttomButtonLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.1), GravityFlags.Bottom | GravityFlags.CenterHorizontal); //propertyButton propertyButton = new Button(con); propertyButton.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Bottom | GravityFlags.CenterHorizontal); propertyButton.Text = "OPTIONS"; propertyButton.Gravity = GravityFlags.Start; //propertyFrameLayout propertyFrameLayout = new FrameLayout(con); propertyFrameLayout.SetBackgroundColor(Color.Rgb(240, 240, 240)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); propertyButton.Click += (object sender, EventArgs e) => { buttomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); propertyFrameLayout.AddView(GetPropertyLayout(con)); }; //scrollView ScrollView scrollView = new ScrollView(con); scrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.Bottom | GravityFlags.CenterHorizontal); scrollView.AddView(propertyFrameLayout); //frame frame.AddView(scrollView); frame.AddView(buttomButtonLayout); frame.FocusableInTouchMode = true; }
public void Update(RecentHistoryItem recentHistory, int position) { RecentHistory = recentHistory; flDivider.Visibility = position == 0 ? ViewStates.Gone : ViewStates.Visible; flPublicationBar.SetBackgroundColor(Color.ParseColor(RecentHistory.ColorPrimary)); tvPublicationTitle.Text = RecentHistory.PublicationTitle; tvTOCTitle.Text = RecentHistory.TOCTitle; tvLastReadDate.Text = FormateLastReadDate(); }
private async void makeActvTurnGreenWhenAddressesAreValid(AutoCompleteTextView actv, FrameLayout frame) { //Prevents the function from running if the map is not initialized if (map == null) { return; } //Checks if the address in the actv is valid, changes the background color if so, sets it to gray if not if (await mbi.AddressIsValid(actv.Text)) { actv.Alpha = .75F; frame.SetBackgroundColor(Android.Graphics.Color.DarkGreen); } else { actv.Alpha = .75F; frame.SetBackgroundColor(Android.Graphics.Color.Gray); } }
private void OptionLayout() { //propertylayout propertylayout = new LinearLayout(context); propertylayout.Orientation = Android.Widget.Orientation.Vertical; showlabel = showLabelPosition; snapsto = SnapsTo.None; //propertyLabel TextView propertyLabel = new TextView(context); propertyLabel.SetTextColor(Color.ParseColor("#282828")); propertyLabel.Gravity = GravityFlags.CenterVertical; propertyLabel.TextSize = 18; propertyLabel.SetPadding(0, 10, 0, 10); propertyLabel.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Left | GravityFlags.CenterHorizontal); propertyLabel.Text = " " + "OPTIONS"; //closeLabel TextView closeLabel = new TextView(context); closeLabel.SetBackgroundColor(Color.Transparent); closeLabel.Gravity = GravityFlags.CenterVertical; closeLabel.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Right | GravityFlags.CenterHorizontal); closeLabel.SetBackgroundResource(Resource.Drawable.sfclosebutton); //closeLayout FrameLayout closeLayout = new FrameLayout(context); closeLayout.SetBackgroundColor(Color.Transparent); closeLayout.SetPadding(0, 10, 0, 10); closeLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Right | GravityFlags.CenterHorizontal); closeLayout.AddView(closeLabel); //topProperty topProperty = new FrameLayout(context); topProperty.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); topProperty.SetBackgroundColor(Color.Rgb(230, 230, 230)); topProperty.AddView(propertyLabel); topProperty.AddView(closeLayout); topProperty.Touch += (object sendar, View.TouchEventArgs e) => { propertyFrameLayout.RemoveAllViews(); buttomButtonLayout.RemoveAllViews(); buttomButtonLayout.AddView(propertyButton); }; proprtyOptionsLayout = new LinearLayout(context); proprtyOptionsLayout.Orientation = Android.Widget.Orientation.Vertical; //spaceText TextView spaceText1 = new TextView(context); spaceText1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 40, GravityFlags.Center); proprtyOptionsLayout.AddView(spaceText1); }
private void FinalLayout() { //completeLayout LinearLayout completeLayout = new LinearLayout(con); completeLayout.Orientation = Orientation.Vertical; completeLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.65), GravityFlags.Top | GravityFlags.CenterHorizontal); completeLayout.AddView(rotator); //frame frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor(Color.Rgb(236, 236, 236)); frame.SetPadding(10, 10, 10, 10); //scrollView1 ScrollView scrollView1 = new ScrollView(context); scrollView1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.65), GravityFlags.Top | GravityFlags.CenterHorizontal); scrollView1.AddView(completeLayout); frame.AddView(scrollView1); //bottomButtonLayout bottomButtonLayout = new FrameLayout(context); bottomButtonLayout.SetBackgroundColor(Color.Transparent); bottomButtonLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.1), GravityFlags.Bottom | GravityFlags.CenterHorizontal); //propertyButton propertyButton = new Button(context); propertyButton.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Bottom | GravityFlags.CenterHorizontal); propertyButton.Text = "OPTIONS"; propertyButton.Gravity = GravityFlags.Start; //propertyFrameLayout propertyFrameLayout = new FrameLayout(context); propertyFrameLayout.SetBackgroundColor(Color.Rgb(236, 236, 236)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.35), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(context)); propertyButton.Click += (object sender, EventArgs e) => { bottomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); propertyFrameLayout.AddView(GetPropertyLayout(context)); }; //scrollView ScrollView scrollView = new ScrollView(context); scrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.35), GravityFlags.Bottom | GravityFlags.CenterHorizontal); scrollView.AddView(propertyFrameLayout); //frame frame.AddView(scrollView); frame.AddView(bottomButtonLayout); frame.FocusableInTouchMode = true; }
public HSVColorPickerDialog(Context context, Color initialColor, Action<Color> listener) : base(context) { this.selectedColor = initialColor; this.listener = listener; colorWheel = new HSVColorWheel(context); valueSlider = new HSVValueSlider(context); var padding = (int)(context.Resources.DisplayMetrics.Density * PADDING_DP); var borderSize = (int)(context.Resources.DisplayMetrics.Density * BORDER_DP); var layout = new RelativeLayout(context); var lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP); colorWheel.setListener((color) => valueSlider.SetColor(color, true)); colorWheel.setColor(initialColor); colorWheel.Id = (1); layout.AddView(colorWheel, lp); int selectedColorHeight = (int)(context.Resources.DisplayMetrics.Density * SELECTED_COLOR_HEIGHT_DP); var valueSliderBorder = new FrameLayout(context); valueSliderBorder.SetBackgroundColor(BORDER_COLOR); valueSliderBorder.SetPadding(borderSize, borderSize, borderSize, borderSize); valueSliderBorder.Id = (2); lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize); lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP); lp.AddRule(LayoutRules.Below, 1); layout.AddView(valueSliderBorder, lp); valueSlider.SetColor(initialColor, false); valueSlider.SetListener((color) => { selectedColor = color; selectedColorView.SetBackgroundColor(color); }); valueSliderBorder.AddView(valueSlider); var selectedColorborder = new FrameLayout(context); selectedColorborder.SetBackgroundColor(BORDER_COLOR); lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize); selectedColorborder.SetPadding(borderSize, borderSize, borderSize, borderSize); lp.AddRule(LayoutRules.Below, 2); layout.AddView(selectedColorborder, lp); selectedColorView = new View(context); selectedColorView.SetBackgroundColor(selectedColor); selectedColorborder.AddView(selectedColorView); SetButton((int)DialogButtonType.Negative, context.GetString(Android.Resource.String.Cancel), ClickListener); SetButton((int)DialogButtonType.Positive, context.GetString(Android.Resource.String.Ok), ClickListener); SetView(layout, padding, padding, padding, padding); }
private void OptionViewLayout() { /**************** **Options View** ****************/ TextView propertyLabel = new TextView(context); propertyLabel.SetTextColor(Color.ParseColor("#282828")); propertyLabel.Gravity = GravityFlags.CenterVertical; propertyLabel.TextSize = 18; propertyLabel.SetPadding(0, 10, 0, 10); propertyLabel.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Left | GravityFlags.CenterHorizontal); propertyLabel.Text = " " + "OPTIONS"; //CloseLabel closeLabel = new TextView(context); closeLabel.SetBackgroundColor(Color.Transparent); closeLabel.Gravity = GravityFlags.CenterVertical; closeLabel.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Right | GravityFlags.CenterHorizontal); closeLabel.SetBackgroundResource(Resource.Drawable.sfclosebutton); //CloseLayout FrameLayout closeLayout = new FrameLayout(context); closeLayout.SetBackgroundColor(Color.Transparent); closeLayout.SetPadding(0, 10, 0, 10); closeLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Right | GravityFlags.CenterHorizontal); closeLayout.AddView(closeLabel); //TopProperty topProperty = new FrameLayout(context); topProperty.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); topProperty.SetBackgroundColor(Color.Rgb(230, 230, 230)); topProperty.AddView(propertyLabel); topProperty.AddView(closeLayout); //topProperty Touch Event topProperty.Touch += (object sendar, View.TouchEventArgs e) => { propertyFrameLayout.RemoveAllViews(); buttomButtonLayout.RemoveAllViews(); buttomButtonLayout.AddView(propertyButton); mainPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); propPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.0003)); }; proprtyOptionsLayout = new LinearLayout(context); proprtyOptionsLayout.Orientation = Android.Widget.Orientation.Vertical; //SpaceText TextView spaceText1 = new TextView(context); spaceText1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 38, GravityFlags.Center); proprtyOptionsLayout.AddView(spaceText1); }
public static View BuildBaseItem(Context context, string text, int?background = null, int?foreground = null, bool clickable = true, GravityFlags?gravity = null, bool wrapContentHeight = false) { background = background ?? ResourceExtension.BrushFlyoutBackground; foreground = foreground ?? ResourceExtension.BrushText; if (ParamRelativeLayout == null) { ParamRelativeLayout = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(150), -2); } else { ParamRelativeLayout.Height = -2; } var top = new FrameLayout(context); top.SetBackgroundColor(new Color(background.Value)); var holder = new RelativeLayout(context) { LayoutParameters = wrapContentHeight ? new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(150), -2) : ParamRelativeLayout }; var margin = DimensionsHelper.DpToPx(8); holder.SetPadding(margin, margin, margin, margin); holder.SetBackgroundResource(ResourceExtension.SelectableItemBackground); if (clickable) { top.Clickable = true; top.Focusable = true; } var txt = new TextView(context) { LayoutParameters = ParamTextView }; txt.SetMaxLines(3); if (gravity != null) { txt.Gravity = gravity.Value; } txt.SetTextColor(new Color(foreground.Value)); txt.Text = text; txt.Id = TextViewTag; holder.AddView(txt); top.AddView(holder); return(top); }
/// <summary> /// Called to have the fragment instantiate its user interface view. Initializes a /// FrameLayout with a dark background color. /// </summary> public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { return(null); } var layout = new FrameLayout(Activity); layout.SetBackgroundColor(new global::Android.Graphics.Color(50, 50, 50)); return(layout); }
/* * * Initilization method for android activity. * */ protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.main); #region getting View ids _rootLayout = FindViewById <FrameLayout>(Resource.Id.root_layout); _title = FindViewById <TextView>(Resource.Id.title); _title.SetTextColor(GlobalMethods.GetRandomColor()); _title.SetBackgroundColor(Color.Transparent); _rootLayout.SetBackgroundColor(Color.White); _rootLayout.SetOnTouchListener(this); #endregion #region Creating animation for actionbar title var animation = AnimationUtils.LoadAnimation(this, Resource.Animation.slide_in_left ); animation.Duration = 5000; animation.SetAnimationListener(this); _title.Text = Title; _title.StartAnimation(animation); #endregion #region Register this as a listener with the underlying service for detecting Shaking of device. var sensorManager = GetSystemService(SensorService) as SensorManager; if (sensorManager != null) { var sensor = sensorManager.GetDefaultSensor(SensorType.Accelerometer); sensorManager.RegisterListener(this, sensor, SensorDelay.Game); } #endregion #region Get max available VM memory, exceeding this amount will throw an OutOfMemory exception. Stored in kilobytes as LruCache takes an int in its constructor. var maxMemory = (int)(Java.Lang.Runtime.GetRuntime().MaxMemory() / 1024); // Use 1/8th of the available memory for this memory cache. int cacheSize = maxMemory / 8; _memoryCache = new MemoryLimitedLruCache(cacheSize); #endregion }
private void CreateDialog() { if (_TextPickerCell.Items == null || _TextPickerCell.Items.Count == 0) { return; } _Picker?.Dispose(); _Picker = new ANumberPicker(AndroidContext) { DescendantFocusability = DescendantFocusability.BlockDescendants, MinValue = 0, MaxValue = _TextPickerCell.Items.Count - 1, WrapSelectorWheel = _TextPickerCell.IsCircularPicker, Value = Math.Max(_TextPickerCell.Items.IndexOf(_TextPickerCell.SelectedItem), 0), }; _Picker.SetBackgroundColor(_TextPickerCell.Prompt.BackgroundColor.ToAndroid()); _Picker.SetTextColor(_TextPickerCell.Prompt.ItemColor.ToAndroid()); _Picker.SetDisplayedValues(_TextPickerCell.Items.ToArray()); if (_Dialog != null) { return; } using (var builder = new AlertDialog.Builder(AndroidContext)) { builder.SetTitle(_PopupTitle); var parent = new FrameLayout(AndroidContext); parent.SetBackgroundColor(_TextPickerCell.Prompt.BackgroundColor.ToAndroid()); parent.AddView(_Picker, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Center)); builder.SetView(parent); builder.SetNegativeButton(_TextPickerCell.Prompt.Cancel, CancelAndClosePopup); builder.SetPositiveButton(_TextPickerCell.Prompt.Accept, AcceptAndClosePopup); _Dialog = builder.Create(); } if (_Dialog is null) { return; } _Dialog.SetCanceledOnTouchOutside(true); _Dialog.DismissEvent += OnDialogOnDismissEvent; _Dialog.Show(); }
private void UpdateTaleAndroidGUI() { mediaPlayerTale.Stop(); frmLytFrontPage.SetBackgroundColor(Color.WhiteSmoke); frmLytFrontPage.SetBackgroundResource(0); imgBackgroundPage.SetImageBitmap(null); if (taleManager != null) { lblFrontPage.Text = taleManager.Title; //-- Background String background = taleManager.Background; int tamBackground = background.Length; if (tamBackground > 0) { if (UtilsAndroid.isArchive(background)) { UtilsImageAndroid.SetImage(background, imgBackgroundFrontPage); } if (background.Contains("#")) { frmLytFrontPage.SetBackgroundColor(Color.ParseColor(background)); } } if (taleManager.Music != "") { mediaPlayerTale = MediaPlayer.Create(this, Android.Net.Uri.Parse(taleManager.Music)); mediaPlayerTale.Start(); } } Application.Dispose(); Application.OnTrimMemory(TrimMemory.RunningCritical); }
private FrameLayout InitializeCroutonViewGroup(Resources resources) { var croutonView = new FrameLayout(Activity); if (null != OnClickListener) { croutonView.SetOnClickListener(OnClickListener); } int height; if (Style.HeightDimensionResId > 0) { height = resources.GetDimensionPixelSize(Style.HeightDimensionResId); } else { height = Style.HeightInPixels; } int width; if (Style.WidthDimensionResId > 0) { width = resources.GetDimensionPixelSize(Style.WidthDimensionResId); } else { width = Style.WidthInPixels; } croutonView.LayoutParameters = new FrameLayout.LayoutParams(width != 0 ? width : ViewGroup.LayoutParams.MatchParent, height); //TODO: THIS WAS THE FIX croutonView.SetBackgroundColor(this.Style.BackgroundColor); // set the background drawable if set. This will override the background // color. if (Style.BackgroundDrawableResourceId != 0) { Bitmap background = BitmapFactory.DecodeResource(resources, Style.BackgroundDrawableResourceId); var drawable = new BitmapDrawable(resources, background); if (Style.IsTileEnabled) { drawable.SetTileModeXY(Shader.TileMode.Repeat, Shader.TileMode.Repeat); } croutonView.SetBackgroundDrawable(drawable); } return(croutonView); }
public ScheduleViewOptionLayout(Context context, SfSchedule schedule) { con = context; sfSchedule = schedule; Density = con.Resources.DisplayMetrics; OptionLayout = new FrameLayout(context); OptionLayout.SetBackgroundColor(Color.White); OptionLayout.LayoutParameters = new ViewGroup.LayoutParams(Density.WidthPixels / 3, Density.HeightPixels / 3); borderLayout = new LinearLayout(context); borderLayout.SetBackgroundColor(Color.LightGray); borderLayout.SetPadding(1, 1, 1, 1); borderLayout.LayoutParameters = new ViewGroup.LayoutParams(Density.WidthPixels / 3, Density.HeightPixels / 3); AddHeaderViews(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { FrameLayout fl = new FrameLayout(_context); fl.LayoutParameters = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); fl.SetBackgroundColor(Color.White); TextView tv = new TextView(_context); tv.Text = $"Fragment #{_num}"; tv.SetTextColor(Color.Black); fl.AddView(tv); return(fl); }
private void StartAnimation() { if (IsDisposed) { return; } ClearAnimation(); viewOverlay.BringToFront(); var color = this.color; color.A = alpha; viewOverlay.SetBackgroundColor(color); }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e) { base.OnElementChanged(e); if (Control == null) { var layout = new FrameLayout(this.Context); layout.SetMinimumHeight(100); layout.SetBackgroundColor(Android.Graphics.Color.Red); var textview = new TextView(Forms.Context); textview.Text = "Custom Ad Display " + new Random().Next(100, 999); layout.AddView(textview); SetNativeControl(layout); } }
void BringLayer() { if (IsDisposed) { return; } ClearAnimation(); _viewOverlay.BringToFront(); var color = _color; color.A = _alpha; _viewOverlay.SetBackgroundColor(color); }
private View CreateImageView(ViewGroup parent, object imageObj) { View answer; if (imageObj is string strConst && strConst == AddImageConstant) { answer = new FrameLayout(parent.Context); answer.SetBackgroundColor(Color.Black); var plusView = new ImageView(parent.Context); plusView.SetImageResource(Android.Resource.Drawable.IcInputAdd); plusView.SetColorFilter(Color.White); plusView.LayoutParameters = new FrameLayout.LayoutParams(ThemeHelper.AsPx(parent.Context, 30), ThemeHelper.AsPx(parent.Context, 30), GravityFlags.Center); (answer as FrameLayout).AddView(plusView); answer.Click += new WeakEventHandler(AddImage_Click).Handler; }
public override View GetSampleContent (Context con) { int height = con.Resources.DisplayMetrics.HeightPixels/2; LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetGravity (Android.Views.GravityFlags.CenterHorizontal); linearLayout.Orientation = Android.Widget.Orientation.Vertical; linearLayout.SetBackgroundColor(Color.White); img = new ImageView(con); img.SetImageResource (Resource.Drawable.mount); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.SetPadding(20, 20, 20, 20); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height+(height/3.5)),GravityFlags.Center); img.SetPadding(12, 0, 10, 0); img.LayoutParameters = (layoutParams); range=new SfRangeSlider(con); range.Minimum = 0;range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150)); range.ValueChanged += ValueChanged ; linearLayout.AddView(img); TextView text1 = new TextView(con); text1.Text = " Opacity"; text1.TextSize=20; text1.Gravity = GravityFlags.Left; range.SetY(-30); linearLayout.AddView(text1); linearLayout.AddView(range); FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor (Color.White); frame.LayoutParameters = ( new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent,GravityFlags.Center)); frame.AddView(linearLayout); return frame; }
public override View GetSampleContent (Context context) { btn = new Button(context); btn.SetBackgroundResource(Resource.Drawable.burgericon); FrameLayout.LayoutParams btlayoutParams = new FrameLayout.LayoutParams(42,32, GravityFlags.Center); btn.LayoutParameters = btlayoutParams; btn.SetPadding (10,0,0,0); btn.Gravity=GravityFlags.CenterVertical; TextView textView = new TextView(context); textView.TextSize=20; textView.Text="Home"; textView.SetTextColor (Color.White); textView.Gravity=GravityFlags.Center; LinearLayout linearLayout = new LinearLayout(context); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 70, GravityFlags.Center); layoutParams.SetMargins (10,0,0,0); linearLayout.SetPadding (10,0,0,0); linearLayout.AddView(btn);linearLayout.AddView(textView,layoutParams); linearLayout.SetBackgroundColor(Color.Rgb(47,173,227)); height = context.Resources.DisplayMetrics.HeightPixels-75; width =context.Resources.DisplayMetrics.WidthPixels; LinearLayout linear2 = new LinearLayout(context); linear2.Orientation=Orientation.Vertical; linear2.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); FrameLayout.LayoutParams layout2= new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Center); linear2.AddView(linearLayout,layout2); /** * Main Content * */ FrameLayout gridLayout = new FrameLayout(context); gridLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); /** * item1 */ FrameLayout grid1 = new FrameLayout(context); ImageView img1 = new ImageView(context); img1.SetScaleType (ImageView.ScaleType.FitXy); img1.SetImageResource(Resource.Drawable.profile); FrameLayout.LayoutParams layoutParams1 = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center); grid1.AddView(img1, layoutParams1); grid1.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3); /** * item2 */ FrameLayout grid2 = new FrameLayout(context); ImageView img2 = new ImageView(context); img2.SetImageResource(Resource.Drawable.inbox); img2.SetScaleType (ImageView.ScaleType.FitXy); grid2.AddView(img2, layoutParams1); grid2.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3); /** * item3 */ FrameLayout grid3 = new FrameLayout(context); ImageView img3 = new ImageView(context); img3.SetImageResource(Resource.Drawable.outbox); img3.SetScaleType (ImageView.ScaleType.FitXy); grid3.AddView(img3, layoutParams1); grid3.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3); /** * item4 */ FrameLayout grid4 = new FrameLayout(context); ImageView img4 = new ImageView(context); img4.SetImageResource(Resource.Drawable.flag); img4.SetScaleType (ImageView.ScaleType.FitXy); grid4.AddView(img4, layoutParams1); grid4.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3); /** * item5 */ FrameLayout grid5 = new FrameLayout(context); ImageView img5 = new ImageView(context); img5.SetImageResource(Resource.Drawable.trash); img5.SetScaleType (ImageView.ScaleType.FitXy); grid5.AddView(img5, layoutParams1); grid5.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 155)/3); /** * item6 */ FrameLayout grid6 = new FrameLayout(context); ImageView img6 = new ImageView(context); img6.SetImageResource(Resource.Drawable.power); grid6.AddView(img6, layoutParams1); img6.SetScaleType (ImageView.ScaleType.FitXy); grid6.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 155)/3); img1.SetPadding (0,0,0,3); img2.SetPadding (-1,0,0,3); img3.SetPadding (0,0,0,0); img4.SetPadding (-1,0,0,0); img5.SetPadding (0,0,0,15); img6.SetPadding (-1,0,0,15); int x=0; int y=5; int x1,y1; x1= (x)+(width/2); y1 = (2*y)+((height-100)/3); grid1.SetX(x); grid1.SetY(y); grid2.SetX(x1); grid2.SetY(y); grid3.SetX(x); grid3.SetY(y1); grid4.SetX(x1); grid4.SetY(y1); grid5.SetX(x); grid5.SetY((2*y1)); grid6.SetX(x1); grid6.SetY((2*y1)); gridLayout.AddView(grid1); gridLayout.AddView(grid2); gridLayout.AddView(grid3); gridLayout.AddView(grid4); gridLayout.AddView(grid5); gridLayout.AddView(grid6); FrameLayout ContentFrame = new FrameLayout (context); ContentFrame.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, height-75); ContentFrame.SetBackgroundColor (Color.White); ContentFrame.AddView (gridLayout); gridLayout.SetBackgroundColor (Color.White); linear2.AddView (ContentFrame); LinearLayout contentLayout= new LinearLayout(context); RoundedImageView imgvw=new RoundedImageView(context,120,120); imgvw.SetPadding(0,10,0,10); imgvw.SetImageResource(Resource.Drawable.user); LinearLayout.LayoutParams layparams8 = new LinearLayout.LayoutParams(120, 120); layparams8.Gravity = GravityFlags.Center; imgvw.LayoutParameters=new ViewGroup.LayoutParams(120, 120); TextView text = new TextView(context); text.Text="James Pollock"; text.Gravity=GravityFlags.Center; text.TextSize=17; text.SetTextColor(Color.White); text.SetPadding (0,20,0,0); text.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); LinearLayout headerLayout=new LinearLayout(context); headerLayout.Orientation=Orientation.Vertical; headerLayout.SetBackgroundColor(Color.Rgb(47,173,227)); headerLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200); headerLayout.SetGravity (GravityFlags.Center); headerLayout.AddView(imgvw,layparams8); headerLayout.AddView(text); LinearLayout.LayoutParams layparams2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int) (height * 0.15)); layparams2.Gravity = GravityFlags.Center; contentLayout.AddView(headerLayout); LinearLayout.LayoutParams layparams5 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (2)); contentLayout.AddView(new SeparatorView(context,width){separatorColor=Color.LightGray},layparams5); contentLayout.SetBackgroundColor (Color.White); linear2.SetBackgroundColor(Color.White); slideDrawer = new Com.Syncfusion.Navigationdrawer.SfNavigationDrawer(context); slideDrawer.ContentView=linear2; slideDrawer.DrawerWidth = (float)(width * 0.60); slideDrawer.DrawerHeight = (float)(height * 0.60); slideDrawer.Transition=Transition.SlideOnTop; slideDrawer.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); listView = new ListView(context); listView.VerticalScrollBarEnabled = true; btn.Click+= (object sender, EventArgs e) => { slideDrawer.ToggleDrawer(); }; List<String> list = new List<String>(); list.Add("Home"); list.Add("Profile"); list.Add("Inbox"); list.Add("Outbox"); list.Add("Sent Items"); list.Add("Trash"); ArrayAdapter<String> arrayAdapter =new ArrayAdapter<String>(context, Android.Resource.Layout.SimpleListItem1,list); listView.SetAdapter(arrayAdapter); listView.SetBackgroundColor(Color.White); listView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,ViewGroup.LayoutParams.MatchParent); contentLayout.AddView(listView); contentLayout.Orientation=Orientation.Vertical; FrameLayout frame = new FrameLayout (context); frame.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor (Color.White); frame.AddView (contentLayout); slideDrawer.DrawerContentView=frame; /** * profile content * */ LinearLayout profilelayout = new LinearLayout(context); profilelayout.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); profilelayout.Orientation = Orientation.Vertical; LinearLayout linearLayout2 = new LinearLayout(context); linearLayout2.SetGravity(GravityFlags.Center); linearLayout2.SetPadding(0,30,0,30); linearLayout2.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); RoundedImageView rddimgvw=new RoundedImageView(context, 150, 150); rddimgvw.LayoutParameters=new ViewGroup.LayoutParams( 150, 150); rddimgvw.SetImageResource(Resource.Drawable.user); LinearLayout txtlayout=new LinearLayout(context); txtlayout.SetPadding(40,0,0,0); txtlayout.Orientation=Orientation.Vertical; TextView txtvw=new TextView(context); txtvw.TextSize=20; txtvw.Text="JamesPollock"; txtvw.SetTextColor (Color.Black); TextView txtvw1=new TextView(context); txtvw1.Text="Age 30"; txtvw1.TextSize=13; txtvw1.SetTextColor (Color.Black); txtlayout.AddView(txtvw); txtlayout.AddView(txtvw1); linearLayout2.AddView(rddimgvw); linearLayout2.AddView(txtlayout); linearLayout2.SetBackgroundColor(Color.White); profilelayout.AddView(linearLayout2); //int Width=context.getResources().getDisplayMetrics().widthPixels; profilelayout.Orientation=Orientation.Vertical; FrameLayout.LayoutParams separatorparams=new FrameLayout.LayoutParams(width,2,GravityFlags.Center); SeparatorView separatorView = new SeparatorView(context,width); separatorView.separatorColor = Color.LightGray; //separatorView.Invalidate (); separatorView.SetPadding(20,0,20,20); profilelayout.AddView(separatorView, separatorparams); TextView textView60 = new TextView(context); textView60.TextSize=16; textView60.SetPadding(20,0,20,0); textView60.SetBackgroundColor(Color.White); textView60.Text="\n" + "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters.\n" + "\n" + "\n" + "when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters.\n" + "\n" + "\n" + "James Pollock"; //textView.setHorizontallyScrolling(false); profilelayout.AddView(textView60); profilelayout.SetBackgroundColor (Color.White); /** * InBox Layout */ LinearLayout inboxLayout=new LinearLayout(context); inboxLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); inboxLayout.SetBackgroundColor (Color.White); inboxLayout.Orientation=Orientation.Vertical; LinearLayout mail1=new LinearLayout(context); TextView textView8 = new TextView(context); textView8.Text="John"; textView8.TextSize=18; TextView textView9 = new TextView(context); textView9.Text="Update on Timeline"; textView9.SetTextColor(Color.ParseColor("#1CAEE4")); textView9.TextSize=16; TextView textView10 = new TextView(context); textView10.Text="Hi John, See you at 10AM"; SeparatorView separate4 = new SeparatorView(context, width * 2); separate4.separatorColor = Color.LightGray; separate4.LayoutParameters=new ViewGroup.LayoutParams(width * 2, 3); LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(width * 2, 3); layoutParams5.SetMargins(0, 10, 15, 0); textView10.TextSize=13; mail1.AddView(textView8); mail1.AddView(textView10); LinearLayout mail2=new LinearLayout(context); TextView textView11 = new TextView(context); textView11.Text="Caster"; textView11.TextSize=18; TextView textView12 = new TextView(context); textView12.Text="Update on Timeline"; textView12.SetTextColor(Color.ParseColor("#1CAEE4")); textView12.TextSize=16; TextView textView13 = new TextView(context); textView13.Text="Hi Caster, See you at 11AM"; //textView13.setTextColor(Color.parseColor("#1CAEE4")); textView13.TextSize=13; mail2.AddView(textView11); //mail2.addView(textView12); mail2.AddView(textView13); SeparatorView separate1 = new SeparatorView(context, width * 2); separate1.separatorColor = Color.LightGray; separate1.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); LinearLayout mail3=new LinearLayout(context); TextView textView14 = new TextView(context); textView14.Text="Joey"; textView14.TextSize=18; TextView textView15 = new TextView(context); textView15.Text="Update on Timeline"; textView15.SetTextColor(Color.ParseColor("#1CAEE4")); textView15.TextSize=16; TextView textView16 = new TextView(context); textView16.Text="Hi Joey, See you at 1PM"; textView16.TextSize=13; mail3.AddView(textView14); mail3.AddView(textView16); SeparatorView separate5 = new SeparatorView(context, width * 2); separate5.separatorColor = Color.LightGray; separate5.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); LinearLayout mail4=new LinearLayout(context); TextView textView17 = new TextView(context); textView17.Text="Xavier"; textView17.TextSize=18; TextView textView18 = new TextView(context); textView18.Text="Update on Timeline"; textView18.SetTextColor(Color.ParseColor("#1CAEE4")); textView18.TextSize=16; TextView textView19 = new TextView(context); textView19.Text="Hi Xavier, See you at 2PM"; textView19.TextSize=13; mail4.AddView(textView17); mail4.AddView(textView19); SeparatorView separate3 = new SeparatorView(context, width * 2); separate3.separatorColor = Color.LightGray; separate3.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); LinearLayout mail9=new LinearLayout(context); TextView textView33 = new TextView(context); textView33.Text="Gonzalez"; textView33.TextSize=18; TextView textView34 = new TextView(context); textView34.Text="Update on Timeline"; textView34.SetTextColor(Color.ParseColor("#1CAEE4")); textView34.TextSize=16; TextView textView35 = new TextView(context); textView35.Text="Hi Gonzalez, See you at 3PM"; textView35.TextSize=13; mail9.AddView(textView33); //mail4.addView(textView18); mail9.AddView(textView35); SeparatorView separate7 = new SeparatorView(context, width * 2); separate7.separatorColor = Color.LightGray; separate7.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); LinearLayout mail10=new LinearLayout(context); TextView textView36 = new TextView(context); textView36.Text="Rodriguez"; textView36.TextSize=18; TextView textView37 = new TextView(context); textView37.Text="Update on Timeline"; textView37.SetTextColor(Color.ParseColor("#1CAEE4")); textView37.TextSize=16; TextView textView38 = new TextView(context); textView38.Text="Hi Rodriguez, See you at 4PM"; textView38.TextSize=13; mail10.AddView(textView36); mail10.AddView(textView38); SeparatorView separate10 = new SeparatorView(context, width * 2); separate10.separatorColor = Color.LightGray; separate10.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); LinearLayout mail11=new LinearLayout(context); TextView textView39 = new TextView(context); textView39.Text="Ruben"; textView39.TextSize=18; TextView textView40 = new TextView(context); textView40.Text="Update on Timeline"; textView40.SetTextColor(Color.ParseColor("#1CAEE4")); textView40.TextSize=16; TextView textView41 = new TextView(context); textView41.Text="Hi Ruben, See you at 6PM"; textView41.TextSize=13; mail11.AddView(textView39); mail11.AddView(textView41); SeparatorView separate11 = new SeparatorView(context, width * 2); separate11.separatorColor = Color.LightGray; separate11.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail1.Orientation=Orientation.Vertical; mail2.Orientation=Orientation.Vertical; mail3.Orientation=Orientation.Vertical; mail4.Orientation=Orientation.Vertical; mail9.Orientation=Orientation.Vertical; mail10.Orientation=Orientation.Vertical; mail11.Orientation=Orientation.Vertical; mail1.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail1.SetPadding(20,10,10,5); mail2.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail2.SetPadding(20,10,10,5); mail3.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail3.SetPadding(20,10,10,5); mail4.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail4.SetPadding(20,10,10,5); mail9.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail9.SetPadding(20,10,10,5); mail10.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail10.SetPadding(20,10,10,5); mail11.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail11.SetPadding(20,10,10,5); inboxLayout.SetPadding(20,0,20,20); inboxLayout.AddView(mail1); inboxLayout.AddView(separate4,layoutParams5); inboxLayout.AddView(mail2); inboxLayout.AddView(separate1,layoutParams5); inboxLayout.AddView(mail3); inboxLayout.AddView(separate5,layoutParams5); inboxLayout.AddView(mail4); inboxLayout.AddView(separate3,layoutParams5); inboxLayout.AddView(mail9); inboxLayout.AddView(separate7,layoutParams5); inboxLayout.AddView(mail10); inboxLayout.AddView(separate11,layoutParams5); inboxLayout.AddView(mail11); inboxLayout.AddView(separate10,layoutParams5); img2.Click+= (object sender, EventArgs e) => { ContentFrame.RemoveAllViews(); inboxLayout.RemoveAllViews(); inboxLayout.SetPadding(20,0,20,20); inboxLayout.AddView(mail1); inboxLayout.AddView(separate4,layoutParams5); inboxLayout.AddView(mail2); inboxLayout.AddView(separate1,layoutParams5); inboxLayout.AddView(mail3); inboxLayout.AddView(separate5,layoutParams5); inboxLayout.AddView(mail4); inboxLayout.AddView(separate3,layoutParams5); inboxLayout.AddView(mail9); inboxLayout.AddView(separate7,layoutParams5); inboxLayout.AddView(mail10); inboxLayout.AddView(separate11,layoutParams5); inboxLayout.AddView(mail11); inboxLayout.AddView(separate10,layoutParams5); ContentFrame.AddView(inboxLayout); textView.Text="Inbox"; }; /** * Outbox content */ LinearLayout outboxlayout=new LinearLayout(context); outboxlayout.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)); outboxlayout.SetBackgroundColor(Color.White); outboxlayout.Orientation=(Orientation.Vertical); LinearLayout mail5=new LinearLayout(context); TextView textView20 = new TextView(context); textView20.Text="Ruben"; textView20.TextSize=20; TextView textView21 = new TextView(context); textView21.Text="Update on Timeline"; textView21.SetTextColor(Color.ParseColor("#1CAEE4")); textView21.TextSize=16; TextView textView22 = new TextView(context); textView22.Text="Hi Ruben, see you at 6PM"; SeparatorView separate6 = new SeparatorView(context, width * 2); separate6.separatorColor = Color.LightGray; separate6.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); textView22.TextSize=13; mail5.AddView(textView20); mail5.AddView(textView22); LinearLayout mail6=new LinearLayout(context); TextView textView23 = new TextView(context); textView23.Text="Rodriguez"; textView23.TextSize=20; TextView textView24 = new TextView(context); textView24.Text="Update on Timeline"; textView24.SetTextColor(Color.ParseColor("#1CAEE4")); textView24.TextSize=16; TextView textView25 = new TextView(context); textView25.Text="Hi Rodriguez, see you at 4PM"; textView25.TextSize=13; mail6.AddView(textView23); mail6.AddView(textView25); LinearLayout mail12=new LinearLayout(context); TextView textView42 = new TextView(context); textView42.Text="Gonzalez"; textView42.TextSize=20; TextView textView43 = new TextView(context); textView43.Text="Update on Timeline"; textView43.SetTextColor(Color.ParseColor("#1CAEE4")); textView43.TextSize=16; TextView textView44 = new TextView(context); textView44.Text="Hi Gonzalez, see you at 3PM"; mail12.AddView(textView42); //mail12.addView(textView43); mail12.AddView(textView44); SeparatorView separate14 = new SeparatorView(context, width * 2); separate14.separatorColor = Color.LightGray; separate14.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail12.Orientation=Orientation.Vertical; mail12.Orientation=(Orientation.Vertical); mail5.Orientation=Orientation.Vertical; mail6.Orientation=Orientation.Vertical; LinearLayout mail13=new LinearLayout(context); TextView textView45 = new TextView(context); textView45.Text="Xavier"; textView45.TextSize=20; TextView textView46 = new TextView(context); textView46.Text="Update on Timeline"; textView46.SetTextColor(Color.ParseColor("#1CAEE4")); textView46.TextSize=16; TextView textView47 = new TextView(context); textView47.Text="Hi Xavier, see you at 2PM"; SeparatorView separate15 = new SeparatorView(context, width * 2); separate15.separatorColor = Color.LightGray; separate15.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail13.AddView(textView45); mail13.AddView(textView47); mail13.Orientation=(Orientation.Vertical); mail13.Orientation=(Orientation.Vertical); LinearLayout mail14=new LinearLayout(context); TextView textView48 = new TextView(context); textView48.Text="Joey"; textView48.TextSize=20; TextView textView49 = new TextView(context); textView49.Text="Update on Timeline"; textView49.SetTextColor(Color.ParseColor("#1CAEE4")); textView49.TextSize=16; TextView textView50 = new TextView(context); textView50.Text="Hi Joey, see you at 1PM"; SeparatorView separate16 = new SeparatorView(context, width * 2); separate16.separatorColor = Color.LightGray; separate16.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail14.AddView(textView48); //mail12.addView(textView43); mail14.AddView(textView50); mail14.Orientation=(Orientation.Vertical); mail14.Orientation=(Orientation.Vertical); LinearLayout mail15=new LinearLayout(context); TextView textView51 = new TextView(context); textView51.Text="Joey"; textView51.TextSize=20; TextView textView52 = new TextView(context); textView52.Text="Update on Timeline"; textView52.SetTextColor(Color.ParseColor("#1CAEE4")); textView52.TextSize=16; TextView textView53 = new TextView(context); textView53.Text="Hi Joey, see you at 1PM"; SeparatorView separate17 = new SeparatorView(context, width * 2); separate17.separatorColor = Color.LightGray; separate17.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail15.AddView(textView51); mail15.AddView(textView53); mail15.Orientation=(Orientation.Vertical); mail15.Orientation=(Orientation.Vertical); LinearLayout mail16=new LinearLayout(context); TextView textView54 = new TextView(context); textView54.Text=("Caster"); textView54.TextSize=(20); TextView textView55 = new TextView(context); textView55.Text=("Update on Timeline"); textView55.SetTextColor(Color.ParseColor("#1CAEE4")); textView55.TextSize=(16); TextView textView56 = new TextView(context); textView56.Text=("Hi Caster, see you at 11PM"); SeparatorView separate18 = new SeparatorView(context, width * 2); separate18.separatorColor = Color.LightGray; separate18.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail16.AddView(textView54); mail16.AddView(textView56); mail16.Orientation=(Orientation.Vertical); mail16.Orientation=(Orientation.Vertical); LinearLayout mail17=new LinearLayout(context); TextView textView57 = new TextView(context); textView57.Text="john"; textView57.TextSize=20; TextView textView58 = new TextView(context); textView58.Text=("Update on Timeline"); textView58.SetTextColor(Color.ParseColor("#1CAEE4")); textView58.TextSize=(16); TextView textView59 = new TextView(context); textView59.Text=("Hi John, see you at 10AM"); SeparatorView separate19 = new SeparatorView(context, width * 2); separate19.separatorColor = Color.LightGray; separate19.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); mail17.AddView(textView57); mail17.AddView(textView59); mail17.Orientation=(Orientation.Vertical); mail17.Orientation=(Orientation.Vertical); mail6.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail6.SetPadding(20, 10, 10, 10); mail5.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail5.SetPadding(20,10,10,5); mail12.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail12.SetPadding(20,10,10,5); mail13.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail13.SetPadding(20,10,10,5); mail14.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail14.SetPadding(20,10,10,5); mail15.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail15.SetPadding(20,10,10,5); mail16.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail16.SetPadding(20,10,10,5); mail17.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); mail17.SetPadding(20,10,10,5); SeparatorView separate13 = new SeparatorView(context, width * 2); separate13.separatorColor = Color.LightGray; separate13.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3)); outboxlayout.SetPadding(20, 0, 20, 20); outboxlayout.AddView(mail5); outboxlayout.AddView(separate13, layoutParams5); outboxlayout.AddView(mail6); outboxlayout.AddView(separate6, layoutParams5); outboxlayout.AddView(mail12); outboxlayout.AddView(separate14, layoutParams5); outboxlayout.AddView(mail13); outboxlayout.AddView(separate15, layoutParams5); outboxlayout.AddView(mail15); outboxlayout.AddView(separate17, layoutParams5); outboxlayout.AddView(mail16); outboxlayout.AddView(separate18, layoutParams5); outboxlayout.AddView(mail17); outboxlayout.AddView(separate19, layoutParams5); img3.Click+= (object sender, EventArgs e) => { ContentFrame.RemoveAllViews(); outboxlayout.RemoveAllViews(); outboxlayout.SetPadding(20, 0, 20, 20); outboxlayout.AddView(mail5); outboxlayout.AddView(separate13, layoutParams5); outboxlayout.AddView(mail6); outboxlayout.AddView(separate6, layoutParams5); outboxlayout.AddView(mail12); outboxlayout.AddView(separate14, layoutParams5); outboxlayout.AddView(mail13); outboxlayout.AddView(separate15, layoutParams5); outboxlayout.AddView(mail15); outboxlayout.AddView(separate17, layoutParams5); outboxlayout.AddView(mail16); outboxlayout.AddView(separate18, layoutParams5); outboxlayout.AddView(mail17); outboxlayout.AddView(separate19, layoutParams5); ContentFrame.AddView(outboxlayout); textView.Text="OutBox"; }; listView.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => { String selitem= arrayAdapter.GetItem(e.Position); if(selitem.Equals("Home")){ ContentFrame.RemoveAllViews(); ContentFrame.AddView(gridLayout); textView.Text="Home"; } if(selitem.Equals("Profile")){ ContentFrame.RemoveAllViews(); ContentFrame.AddView(profilelayout); textView.Text="Profile"; } if(selitem.Equals("Inbox")){ ContentFrame.RemoveAllViews(); inboxLayout.RemoveAllViews(); inboxLayout.SetPadding(20,0,20,20); inboxLayout.AddView(mail1); inboxLayout.AddView(separate4,layoutParams5); inboxLayout.AddView(mail2); inboxLayout.AddView(separate1,layoutParams5); inboxLayout.AddView(mail3); inboxLayout.AddView(separate5,layoutParams5); inboxLayout.AddView(mail4); inboxLayout.AddView(separate3,layoutParams5); inboxLayout.AddView(mail9); inboxLayout.AddView(separate7,layoutParams5); inboxLayout.AddView(mail10); inboxLayout.AddView(separate11,layoutParams5); inboxLayout.AddView(mail11); inboxLayout.AddView(separate10,layoutParams5); ContentFrame.AddView(inboxLayout); textView.Text="Inbox"; } if(selitem.Equals("Outbox")){ ContentFrame.RemoveAllViews(); outboxlayout.RemoveAllViews(); outboxlayout.SetPadding(20, 0, 20, 20); outboxlayout.AddView(mail5); outboxlayout.AddView(separate13, layoutParams5); outboxlayout.AddView(mail6); outboxlayout.AddView(separate6, layoutParams5); outboxlayout.AddView(mail12); outboxlayout.AddView(separate14, layoutParams5); outboxlayout.AddView(mail13); outboxlayout.AddView(separate15, layoutParams5); outboxlayout.AddView(mail15); outboxlayout.AddView(separate17, layoutParams5); outboxlayout.AddView(mail16); outboxlayout.AddView(separate18, layoutParams5); outboxlayout.AddView(mail17); outboxlayout.AddView(separate19, layoutParams5); ContentFrame.AddView(outboxlayout); textView.Text="OutBox"; } if(selitem.Equals("Sent Items")){ ContentFrame.RemoveAllViews(); inboxLayout.RemoveAllViews(); inboxLayout.SetPadding(20,0,20,20); inboxLayout.AddView(mail10); inboxLayout.AddView(separate1,layoutParams5); inboxLayout.AddView(mail9); inboxLayout.AddView(separate5,layoutParams5); inboxLayout.AddView(mail4); inboxLayout.AddView(separate3,layoutParams5); inboxLayout.AddView(mail3); inboxLayout.AddView(separate10,layoutParams5); inboxLayout.AddView(mail11); inboxLayout.AddView(separate4,layoutParams5); inboxLayout.AddView(mail1); inboxLayout.AddView(separate7,layoutParams5); inboxLayout.AddView(mail2); inboxLayout.AddView(separate11,layoutParams5); ContentFrame.AddView(inboxLayout); textView.Text="Sent Items"; } if(selitem.Equals("Trash")){ ContentFrame.RemoveAllViews(); outboxlayout.RemoveAllViews(); outboxlayout.SetPadding(20, 0, 20, 20); outboxlayout.AddView(mail13); outboxlayout.AddView(separate15, layoutParams5); outboxlayout.AddView(mail5); outboxlayout.AddView(separate13, layoutParams5); outboxlayout.AddView(mail12); outboxlayout.AddView(separate14, layoutParams5); outboxlayout.AddView(mail15); outboxlayout.AddView(separate17, layoutParams5); outboxlayout.AddView(mail17); outboxlayout.AddView(separate19, layoutParams5); outboxlayout.AddView(mail16); outboxlayout.AddView(separate18, layoutParams5); outboxlayout.AddView(mail6); outboxlayout.AddView(separate6, layoutParams5); ContentFrame.AddView(outboxlayout); textView.Text="Trash"; } slideDrawer.ToggleDrawer(); }; img1.Click+= (object sender, EventArgs e) => { ContentFrame.RemoveAllViews(); ContentFrame.AddView(profilelayout); textView.Text="Profile"; }; img4.Click+= (object sender, EventArgs e) => { ContentFrame.RemoveAllViews(); inboxLayout.RemoveAllViews(); inboxLayout.SetPadding(20,0,20,20); inboxLayout.AddView(mail10); inboxLayout.AddView(separate1,layoutParams5); inboxLayout.AddView(mail9); inboxLayout.AddView(separate5,layoutParams5); inboxLayout.AddView(mail4); inboxLayout.AddView(separate3,layoutParams5); inboxLayout.AddView(mail3); inboxLayout.AddView(separate10,layoutParams5); inboxLayout.AddView(mail11); inboxLayout.AddView(separate4,layoutParams5); inboxLayout.AddView(mail1); inboxLayout.AddView(separate7,layoutParams5); inboxLayout.AddView(mail2); inboxLayout.AddView(separate11,layoutParams5); ContentFrame.AddView(inboxLayout); textView.Text="Sent Items"; }; img5.Click+= (object sender, EventArgs e) => { ContentFrame.RemoveAllViews(); outboxlayout.RemoveAllViews(); outboxlayout.SetPadding(20, 0, 20, 20); outboxlayout.AddView(mail13); outboxlayout.AddView(separate15, layoutParams5); outboxlayout.AddView(mail5); outboxlayout.AddView(separate13, layoutParams5); outboxlayout.AddView(mail12); outboxlayout.AddView(separate14, layoutParams5); outboxlayout.AddView(mail15); outboxlayout.AddView(separate17, layoutParams5); outboxlayout.AddView(mail17); outboxlayout.AddView(separate19, layoutParams5); outboxlayout.AddView(mail16); outboxlayout.AddView(separate18, layoutParams5); outboxlayout.AddView(mail6); outboxlayout.AddView(separate6, layoutParams5); ContentFrame.AddView(outboxlayout); textView.Text="Trash"; }; return slideDrawer; }