private void OptionLayout() { mainLayout.AddView(infantsNumericUpDown); //Touch Event mainLayout.Touch += (object sender, View.TouchEventArgs e) => { if (adultNumericUpDown.IsFocused || infantsNumericUpDown.IsFocused) { Rect outRect = new Rect(); adultNumericUpDown.GetGlobalVisibleRect(outRect); infantsNumericUpDown.GetGlobalVisibleRect(outRect); if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) { adultNumericUpDown.ClearFocus(); infantsNumericUpDown.ClearFocus(); } hideSoftKeyboard((Activity)con); } }; frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor(Color.White); //numericCenterLayout LinearLayout numericCenterLayout = new LinearLayout(con); numericCenterLayout.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.7), ViewGroup.LayoutParams.MatchParent, GravityFlags.Top); numericCenterLayout.SetX((int)(totalWidth * 0.15)); numericCenterLayout.SetY((int)(totalHeight * 0.1)); numericCenterLayout.AddView(mainLayout); //scrollView1 ScrollView scrollView1 = new ScrollView(con); scrollView1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.5), GravityFlags.Top | GravityFlags.CenterHorizontal); scrollView1.AddView(numericCenterLayout); 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(236, 236, 236)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.35), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); propertyButton.Click += (object sender, EventArgs e) => { buttomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); adultNumericUpDown.ClearFocus(); infantsNumericUpDown.ClearFocus(); propertyFrameLayout.AddView(GetPropertyLayout(con)); }; //scrollView ScrollView scrollView = new ScrollView(con); 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(buttomButtonLayout); frame.FocusableInTouchMode = true; }
public View GetSampleContent(Context con) { context = con; InitialMethod(); ScrollView scroll = new ScrollView(con); bool isTablet = SfMaskedEditText.IsTabletDevice(con); linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(12, 12, 12, 12); TextView headLabel = new TextView(con); headLabel.TextSize = 30; headLabel.SetTextColor(Color.ParseColor("#262626")); headLabel.Typeface = Typeface.DefaultBold; headLabel.Text = "Funds Transfer"; linear.AddView(headLabel); TextView fundTransferLabelSpacing = new TextView(con); fundTransferLabelSpacing.SetHeight(40); linear.AddView(fundTransferLabelSpacing); TextView textToAccount = new TextView(con); textToAccount.SetTextColor(Color.ParseColor("#6d6d72")); textToAccount.TextSize = 18; textToAccount.Typeface = Typeface.Default; textToAccount.Text = "To Account"; textToAccount.SetPadding(0, 0, 0, 10); linear.AddView(textToAccount); sfToAccount = new SfMaskedEdit(con); sfToAccount.Mask = "0000 0000 0000 0000"; sfToAccount.Gravity = GravityFlags.Start; sfToAccount.ValidationMode = InputValidationMode.KeyPress; sfToAccount.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfToAccount.Hint = "1234 1234 1234 1234"; sfToAccount.FocusChange += SfToAccount_FocusChange; sfToAccount.SetHintTextColor(Color.LightGray); linear.AddView(sfToAccount); erroToAccount = new TextView(con); erroToAccount.SetTextColor(Color.Red); erroToAccount.TextSize = 14; erroToAccount.Typeface = Typeface.Default; linear.AddView(erroToAccount); TextView textDesc = new TextView(con); textDesc.Text = "Description"; textDesc.Typeface = Typeface.Default; textDesc.SetPadding(0, 30, 0, 10); textDesc.TextSize = 18; linear.AddView(textDesc); sfDesc = new SfMaskedEdit(con); sfDesc.Mask = ""; sfDesc.Gravity = GravityFlags.Start; sfDesc.ValidationMode = InputValidationMode.KeyPress; sfDesc.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; sfDesc.Hint = "Enter description"; sfDesc.FocusChange += SfToAccount_FocusChange; sfDesc.SetHintTextColor(Color.LightGray); linear.AddView(sfDesc); TextView textAmount = new TextView(con); textAmount.Text = "Amount"; textAmount.Typeface = Typeface.Default; textAmount.SetPadding(0, 30, 0, 10); textAmount.TextSize = 18; linear.AddView(textAmount); amountMask = new SfMaskedEdit(con); amountMask.Mask = "$ 0,000.00"; amountMask.Gravity = GravityFlags.Start; amountMask.ValidationMode = InputValidationMode.KeyPress; amountMask.ValueMaskFormat = MaskFormat.IncludePromptAndLiterals; amountMask.Hint = "$ 3,874.00"; amountMask.FocusChange += SfToAccount_FocusChange; amountMask.SetHintTextColor(Color.LightGray); linear.AddView(amountMask); errotextAmount = new TextView(con); errotextAmount.SetTextColor(Color.Red); errotextAmount.TextSize = 12; errotextAmount.Typeface = Typeface.Default; linear.AddView(errotextAmount); TextView textEmail = new TextView(con); textEmail.Text = "Email ID"; textEmail.Typeface = Typeface.Default; textEmail.SetPadding(0, 30, 0, 10); textEmail.TextSize = 18; linear.AddView(textEmail); emailMask = new SfMaskedEdit(con); emailMask.Mask = @"\w+@\w+\.\w+"; emailMask.MaskType = MaskType.RegEx; emailMask.Gravity = GravityFlags.Start; emailMask.ValidationMode = InputValidationMode.KeyPress; emailMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; emailMask.Hint = "*****@*****.**"; emailMask.FocusChange += SfToAccount_FocusChange; emailMask.SetHintTextColor(Color.LightGray); linear.AddView(emailMask); errotextEmail = new TextView(con); errotextEmail.SetTextColor(Color.Red); errotextEmail.TextSize = 12; errotextEmail.Typeface = Typeface.Default; linear.AddView(errotextEmail); TextView textPhone = new TextView(con); textPhone.Text = "Mobile Number "; textPhone.Typeface = Typeface.Default; textPhone.SetPadding(0, 30, 0, 10); textPhone.TextSize = 18; linear.AddView(textPhone); phoneMask = new SfMaskedEdit(con); phoneMask.Mask = "+1 000 000 0000"; phoneMask.Gravity = GravityFlags.Start; phoneMask.ValueMaskFormat = MaskFormat.ExcludePromptAndLiterals; phoneMask.ValidationMode = InputValidationMode.KeyPress; phoneMask.Hint = "+1 323 339 3392"; phoneMask.FocusChange += SfToAccount_FocusChange; phoneMask.SetHintTextColor(Color.LightGray); linear.AddView(phoneMask); errotextPhone = new TextView(con); errotextPhone.SetTextColor(Color.Red); errotextPhone.TextSize = 12; errotextPhone.Typeface = Typeface.Default; linear.AddView(errotextPhone); TextView transferButtonSpacing = new TextView(con); transferButtonSpacing.SetHeight(30); Button transferButton = new Button(con); transferButton.SetWidth(ActionBar.LayoutParams.MatchParent); transferButton.SetHeight(40); transferButton.Text = "TRANSFER MONEY"; transferButton.SetTextColor(Color.White); transferButton.SetBackgroundColor(Color.Rgb(72, 178, 224)); transferButton.Click += (object sender, EventArgs e) => { if (string.IsNullOrEmpty(sfToAccount.Text) || string.IsNullOrEmpty(sfDesc.Text) || string.IsNullOrEmpty(amountMask.Text) || string.IsNullOrEmpty(emailMask.Text) || string.IsNullOrEmpty(phoneMask.Text)) { resultsDialog.SetMessage("Please fill all the required data!"); } else if ((sfToAccount.HasError || sfDesc.HasError || amountMask.HasError || emailMask.HasError || phoneMask.HasError)) { resultsDialog.SetMessage("Please enter valid details"); } else { resultsDialog.SetMessage(string.Format("Amount of {0} has been transferred successfully!", amountMask.Value)); string mask1 = sfToAccount.Mask; sfToAccount.Mask = string.Empty; sfToAccount.Mask = mask1; mask1 = sfDesc.Mask; sfDesc.Mask = "0"; sfDesc.Mask = mask1; mask1 = amountMask.Mask; amountMask.Mask = string.Empty; amountMask.Mask = mask1; mask1 = emailMask.Mask; emailMask.Mask = string.Empty; emailMask.Mask = mask1; mask1 = phoneMask.Mask; phoneMask.Mask = string.Empty; phoneMask.Mask = mask1; } resultsDialog.Create().Show(); }; linear.AddView(transferButtonSpacing); linear.AddView(transferButton); TextView transferAfterButtonSpacing = new TextView(con); transferAfterButtonSpacing.SetHeight(60); linear.AddView(transferAfterButtonSpacing); sfToAccount.ValueChanged += SfToAccount_ValueChanged; sfToAccount.MaskInputRejected += SfToAccount_MaskInputRejected; amountMask.ValueChanged += AmountMask_ValueChanged; amountMask.MaskInputRejected += AmountMask_MaskInputRejected; emailMask.ValueChanged += EmailMask_ValueChanged; emailMask.MaskInputRejected += EmailMask_MaskInputRejected; phoneMask.ValueChanged += PhoneMask_ValueChanged; phoneMask.MaskInputRejected += PhoneMask_MaskInputRejected; linear.Touch += (object sender, View.TouchEventArgs e) => { if (sfToAccount.IsFocused || sfDesc.IsFocused || amountMask.IsFocused || emailMask.IsFocused || phoneMask.IsFocused) { Rect outRect = new Rect(); sfToAccount.GetGlobalVisibleRect(outRect); sfDesc.GetGlobalVisibleRect(outRect); amountMask.GetGlobalVisibleRect(outRect); emailMask.GetGlobalVisibleRect(outRect); phoneMask.GetGlobalVisibleRect(outRect); if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) { sfToAccount.ClearFocus(); sfDesc.ClearFocus(); amountMask.ClearFocus(); emailMask.ClearFocus(); phoneMask.ClearFocus(); } } hideSoftKeyboard((Activity)con); }; //results dialog resultsDialog = new AlertDialog.Builder(con); resultsDialog.SetTitle("Status"); resultsDialog.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) => { }); resultsDialog.SetCancelable(true); frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); frame.SetBackgroundColor(Color.White); frame.SetPadding(10, 10, 10, 10); //scrollView1 mainPageScrollView = new ScrollView(con); mainPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.7), GravityFlags.Top | GravityFlags.CenterHorizontal); mainPageScrollView.AddView(linear); frame.AddView(mainPageScrollView); //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 = new FrameLayout(con); propertyFrameLayout.SetBackgroundColor(Color.Rgb(236, 236, 236)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); //propertyButton Click Listener propertyButton.Click += (object sender, EventArgs e) => { buttomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); propPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.Bottom | GravityFlags.CenterHorizontal); mainPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.7), GravityFlags.Top | GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); }; //scrollView propPageScrollView = new ScrollView(con); propPageScrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.3), GravityFlags.Bottom | GravityFlags.CenterHorizontal); propPageScrollView.AddView(propertyFrameLayout); frame.AddView(propPageScrollView); frame.AddView(buttomButtonLayout); frame.FocusableInTouchMode = true; return(frame); }
void RefreshSample(SampleBase selectedSample) { SamplePage sample; if (BaseTextView != null) { BaseTextView.Text = selectedSample.Title; } bool isClassExists = Type.GetType("SampleBrowser." + selectedSample.Name) != null; if (isClassExists) { var handle = Activator.CreateInstance(null, "SampleBrowser." + selectedSample.Name); sample = (SamplePage)handle.Unwrap(); currentSamplePage = sample; sampleView.RemoveAllViews(); sampleView.AddView(sample.GetSampleContent(activity)); if (activity is AllControlsSamplePage) { if ((activity as AllControlsSamplePage).currentSamplePage != null) { (activity as AllControlsSamplePage).currentSamplePage.Destroy(); } (activity as AllControlsSamplePage).currentSamplePage = sample; if (currentSamplePage.GetPropertyWindowLayout(activity) != null) { (activity as AllControlsSamplePage).SettingsButton.Visibility = ViewStates.Visible; } else { (activity as AllControlsSamplePage).SettingsButton.Visibility = ViewStates.Invisible; } } else if (activity is NewSampleActivityPage) { if ((activity as NewSampleActivityPage).currentSamplePage != null) { (activity as NewSampleActivityPage).currentSamplePage.Destroy(); } (activity as NewSampleActivityPage).currentSamplePage = sample; if (currentSamplePage.GetPropertyWindowLayout(activity) != null) { (activity as NewSampleActivityPage).SettingsButton.Visibility = ViewStates.Visible; } else { (activity as NewSampleActivityPage).SettingsButton.Visibility = ViewStates.Invisible; } } if (!selectedSample.Type.Equals("")) { string toatText = ""; if (selectedSample.Type.ToLower().Equals("new")) { toatText = "New"; } else if (selectedSample.Type.ToLower().Equals("updated")) { toatText = "Updated"; } else if (selectedSample.Type.ToLower().Equals("preview")) { toatText = "Preview"; } if (toastNotification != null && toastNotification.Handle != IntPtr.Zero) { toastNotification.Cancel(); } toastNotification = Toast.MakeText(activity, toatText, ToastLength.Short); toastNotification.Show(); } } else { toastNotification = Toast.MakeText(activity, "No such class exists", ToastLength.Short); toastNotification.Show(); } }
private void OnRemoteUserLeft() { FrameLayout container = (FrameLayout)FindViewById(Resource.Id.remote_video_view_container); container.RemoveAllViews(); }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { var deviceDensity = (int)context.Resources.DisplayMetrics.Density; // Set our view from the "main" layout resource var layoutInflater = LayoutInflater.From(context); view = layoutInflater.Inflate(Resource.Layout.EditorCustomization, null); FrameLayout mainLayout = view.FindViewById <FrameLayout> (Resource.Id.CustomizationMain); editor = new SfImageEditor(context); editor.Bitmap = BitmapFactory.DecodeResource(context.Resources, Resource.Drawable.Customize); editor.ItemSelected += Editor_ItemSelected; editor.ToolbarSettings.IsVisible = false; editor.SetBackgroundColor(Color.Black); editor.ToolbarSettings.SubItemToolbarHeight = 0; var bottomview = layoutInflater.Inflate(Resource.Layout.BottomView, mainLayout, true); var topview = layoutInflater.Inflate(Resource.Layout.TopView, mainLayout, true); var rightview = layoutInflater.Inflate(Resource.Layout.RightView, mainLayout, true); //Bottom View------------------------------------ var bottomView = bottomview.FindViewById <LinearLayout>(Resource.Id.bottomView); bottomView.SetGravity(GravityFlags.Bottom); var bParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, 50 * deviceDensity, GravityFlags.Bottom); bottomView.SetBackgroundColor(Color.Transparent); bParams.SetMargins(0, 0, 0, 10 * deviceDensity); bottomView.LayoutParameters = bParams; //Top View------------------------------------ var topView = topview.FindViewById <LinearLayout>(Resource.Id.topView); var tParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, 50 * deviceDensity, GravityFlags.Top); tParams.SetMargins(0, 10 * deviceDensity, 0, 0); topView.LayoutParameters = tParams; //Right View------------------------------------ var rightView = rightview.FindViewById <LinearLayout>(Resource.Id.rightView); var rParams = new FrameLayout.LayoutParams(65 * deviceDensity, FrameLayout.LayoutParams.MatchParent, GravityFlags.Right); rParams.SetMargins(0, 250, 0, 250); rightView.SetBackgroundColor(Color.Transparent); rightView.SetPadding(0, 0, 15 * deviceDensity, 15 * deviceDensity); rightView.LayoutParameters = rParams; rightView.Visibility = ViewStates.Invisible; topView.Visibility = ViewStates.Invisible; mainLayout.RemoveAllViews(); (mainLayout.Parent as ViewGroup)?.RemoveAllViews(); mainLayout.AddView(editor); mainLayout.AddView(topView); mainLayout.AddView(bottomView); mainLayout.AddView(rightView); Button dummyLayout = new Button(context); dummyLayout.SetBackgroundColor(Color.Transparent); dummyLayout.Alpha = 0.5F; mainLayout.AddView(dummyLayout); dummyLayout.Click += (sender, e) => { topView.Visibility = ViewStates.Visible; dummyLayout.Visibility = ViewStates.Invisible; }; //Top view var reset = topView.FindViewById <ImageButton>(Resource.Id.resetButton); var undo = topView.FindViewById <ImageButton>(Resource.Id.undoButton); var rect = topView.FindViewById <ImageButton>(Resource.Id.rectButton); var text = topView.FindViewById <ImageButton>(Resource.Id.textButton); var path = topView.FindViewById <ImageButton>(Resource.Id.pathButton); reset.Click += (sender, e) => { if (editor.IsImageEdited) { editor.Reset(); } rightView.Visibility = ViewStates.Invisible; topView.Visibility = ViewStates.Invisible; dummyLayout.Visibility = ViewStates.Visible; isPath = false; isText = false; isRect = false; }; undo.Click += (sender, e) => { if (editor.IsImageEdited) { editor.Undo(); } }; rect.Click += (sender, e) => { isPath = false; isText = false; isRect = true; AddShapes(); rightView.Visibility = ViewStates.Visible; }; text.Click += (sender, e) => { isPath = false; isRect = false; isText = true; AddShapes(); rightView.Visibility = ViewStates.Visible; }; path.Click += (sender, e) => { isPath = true; isRect = false; isText = false; rightView.Visibility = ViewStates.Visible; editor.AddShape(); }; // colorLayout var firstBut = rightview.FindViewById <Button>(Resource.Id.firstButton); var secondBut = rightview.FindViewById <Button>(Resource.Id.secondButton); var thirdBut = rightview.FindViewById <Button>(Resource.Id.thirdButton); var fourthBut = rightview.FindViewById <Button>(Resource.Id.fourthButton); var fifthBut = rightview.FindViewById <Button>(Resource.Id.fifthButton); var sixthBut = rightview.FindViewById <Button>(Resource.Id.sixthButton); var seventhBut = rightview.FindViewById <Button>(Resource.Id.seventhButton); var eightBut = rightview.FindViewById <Button>(Resource.Id.eightButton); var ninthBut = rightview.FindViewById <Button>(Resource.Id.ninthButton); var tenthBut = rightview.FindViewById <Button>(Resource.Id.tenthButton); firstBut.Click += (sender, e) => { var color = Color.ParseColor("#4472c4"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; secondBut.Click += (sender, e) => { var color = Color.ParseColor("#ed7d31"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; thirdBut.Click += (sender, e) => { var color = Color.ParseColor("#ffc000"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; fourthBut.Click += (sender, e) => { var color = Color.ParseColor("#70ad47"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; fifthBut.Click += (sender, e) => { var color = Color.ParseColor("#5b9bd5"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; sixthBut.Click += (sender, e) => { var color = Color.ParseColor("#c1c1c1"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; seventhBut.Click += (sender, e) => { var color = Color.ParseColor("#6f6fe2"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; eightBut.Click += (sender, e) => { var color = Color.ParseColor("#e269ae"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; ninthBut.Click += (sender, e) => { var color = Color.ParseColor("#9e480e"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; tenthBut.Click += (sender, e) => { var color = Color.ParseColor("#997300"); setting(Settings, color); if (isPath) { editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings() { Color = color }); } }; //Share var share = bottomView.FindViewById <ImageButton>(Resource.Id.sharecustomization); editText = bottomView.FindViewById <EditText>(Resource.Id.captionText); share.Click += async(sender, e) => { await ShareImageAsync(); }; return(mainLayout); }
public override void SetContentView(View view, ViewGroup.LayoutParams @params) { base.SetContentView(mSlidingPaneLayout, @params); mContainerFl.RemoveAllViews(); mContainerFl.AddView(view, @params); }
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; }
private void MainLayout() { ArrayAdapter <String> experienceAdapter = new ArrayAdapter <String>(con, Android.Resource.Layout.SimpleListItem1, Experience); experienceSpinner.Adapter = experienceAdapter; experienceSpinner.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, con.Resources.GetDimensionPixelSize(Resource.Dimension.auto_picker_ht)); //mainLayout LinearLayout mainLayout = new LinearLayout(con); mainLayout.SetPadding(20, 20, 20, 30); mainLayout.SetBackgroundColor(Color.White); mainLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.6), GravityFlags.Top | GravityFlags.CenterHorizontal); mainLayout.Orientation = Orientation.Vertical; mainLayout.AddView(jobSearchLabel); mainLayout.AddView(jobSearchLabelSpacing); mainLayout.AddView(countryLabel); mainLayout.AddView(countryLabelSpacing); mainLayout.AddView(countryNameAutoComplete); mainLayout.AddView(countryAutoCompleteSpacing); mainLayout.AddView(jobFieldLabel); mainLayout.AddView(jobFieldLabelSpacing); mainLayout.AddView(jobFieldAutoComplete); mainLayout.AddView(jobFieldAutoCompleteSpacing); mainLayout.AddView(experienceLabel); mainLayout.AddView(experienceLabelSpacing); mainLayout.AddView(experienceSpinner); mainLayout.AddView(experienceSpinnerSpacing); mainLayout.AddView(searchButtonSpacing); mainLayout.AddView(searchButton); mainLayout.Touch += (object sender, View.TouchEventArgs e) => { if (countryNameAutoComplete.IsFocused || jobFieldAutoComplete.IsFocused) { Rect outRect = new Rect(); countryNameAutoComplete.GetGlobalVisibleRect(outRect); jobFieldAutoComplete.GetGlobalVisibleRect(outRect); if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) { countryNameAutoComplete.ClearFocus(); jobFieldAutoComplete.ClearFocus(); } } hideSoftKeyboard((Activity)con); }; 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.6), GravityFlags.Top | GravityFlags.CenterHorizontal); scrollView1.AddView(mainLayout); 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 = new FrameLayout(con); propertyFrameLayout.SetBackgroundColor(Color.Rgb(236, 236, 236)); propertyFrameLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.4), GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); //propertyButton Click Listener propertyButton.Click += (object sender, EventArgs e) => { buttomButtonLayout.RemoveAllViews(); propertyFrameLayout.RemoveAllViews(); countryNameAutoComplete.ClearFocus(); jobFieldAutoComplete.ClearFocus(); scrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.4), GravityFlags.Bottom | GravityFlags.CenterHorizontal); propertyFrameLayout.AddView(GetPropertyLayout(con)); }; //scrollView scrollView = new ScrollView(con); scrollView.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.4), GravityFlags.Bottom | GravityFlags.CenterHorizontal); scrollView.AddView(propertyFrameLayout); frame.AddView(scrollView); frame.AddView(buttomButtonLayout); frame.FocusableInTouchMode = true; }
//need to make this call async to make responsive screen private async void BindVehicleImages() { if (CommonFunctions.IsNetworkConnected()) { Java.IO.File _dir; //Environment.DirectoryPictures = "Images"; _dir = new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory + "/RentACar" + "/" + rentRunningTrans.RegNo); //km12akk // Get the latitude and longitude entered by the user and create a query.km12akk";// //string url = "https://uk1.ukvehicledata.co.uk/api/datapackage/VehicleImageData?v=2&api_nullitems=1&auth_apikey=a418b0ad-33ab-4953-9a00-9d3ea8a12319&key_VRM=" + rentRunningTrans.RegNo; // Fetch the vehicle information asynchronously, // parse the results, then update the screen: // objVehicleImageList = await GetVehicleImagesfromAPIAsync(url); // _markdamage.SetBackgroundResource(Resource.Drawable.UK1); // ParseAndDisplay (json); //this.progressLayout.Visibility = ViewStates.Visible; _layoutVehicleImages = FindViewById <LinearLayout>(Resource.Id.layoutVehicleImages); //if (objVehicleImageList != null) { if (_dir.Exists() && _dir.ListFiles().Count() > 0) { Java.IO.File[] _objVehicleImageList = _dir.ListFiles(); //Needed to uncommment for (int i = 0; i < _objVehicleImageList.Count(); i++) //for (int i = 0; i < 6; i++) { ImageView imgVehicle = new ImageView(this); imgVehicle.SetMaxWidth(60); imgVehicle.SetMaxHeight(60); imgVehicle.LayoutParameters = new LinearLayout.LayoutParams(150, 150); imgVehicle.Visibility = ViewStates.Visible; imgVehicle.Id = i + 1; //var imageBitmap =CommonFunctions.GetBitmapFromUrl(objVehicleImageList.Response.DataItems.VehicleImages.ImageDetailsList[i].ImageUrl); // imgVehicle.SetImageBitmap(imageBitmap); imgVehicle.SetImageURI(Android.Net.Uri.Parse(_objVehicleImageList[i].AbsolutePath)); //imgVehicle.SetBackgroundResource(Resource.Drawable.CarExterior); imgVehicle.SetOnClickListener(this); // add into my parent view _layoutVehicleImages.AddView(imgVehicle); } //objVehicleImageList["DataItems"]["VehicleImages"]["ImageDetailsList"] } else { try { ImageView imgVehicle = new ImageView(this); imgVehicle.SetMaxWidth(60); imgVehicle.SetMaxHeight(60); LinearLayout.LayoutParams obj = new LinearLayout.LayoutParams(150, 150); obj.SetMargins(5, 5, 5, 5); //imgVehicle.LayoutParameters = new LinearLayout.LayoutParams(150, 150); imgVehicle.Visibility = ViewStates.Visible; // LinearLayout.LayoutParams obj = new LinearLayout.LayoutParams(100, 100); //obj.SetMargins(5,5,5,5); imgVehicle.LayoutParameters = obj; if (rentRunningTrans.VehicleType == "Car") { imgVehicle.Id = 101; imgVehicle.SetBackgroundResource(Resource.Drawable.CarExterior); imgVehicle.SetOnClickListener(this); //imgVehicle.SetPadding(10, 10, 10, 10); // add into my parent view _layoutVehicleImages.AddView(imgVehicle); ImageView imgVehicleInterior = new ImageView(this); imgVehicleInterior.SetMaxWidth(60); imgVehicleInterior.SetMaxHeight(60); //LinearLayout.LayoutParams objj = new LinearLayout.LayoutParams(150, 150); //obj.SetMargins(5, 5, 5, 5); imgVehicleInterior.LayoutParameters = obj; // imgVehicleInterior.LayoutParameters = new LinearLayout.LayoutParams(150, 150); imgVehicleInterior.Visibility = ViewStates.Visible; imgVehicleInterior.Id = 102; imgVehicleInterior.SetBackgroundResource(Resource.Drawable.VehicleInteriorImg); imgVehicleInterior.SetOnClickListener(this); //imgVehicleInterior.SetPadding(10, 10, 10, 10); _layoutVehicleImages.AddView(imgVehicleInterior); _markdamage.SetBackgroundResource(Resource.Drawable.CarExterior); iCurrentDamageImageId = 101; } else if (rentRunningTrans.VehicleType == "Luton Van") { imgVehicle.Id = 201; imgVehicle.SetBackgroundResource(Resource.Drawable.LutonVan); imgVehicle.SetOnClickListener(this); // add into my parent view _layoutVehicleImages.AddView(imgVehicle); _markdamage.SetBackgroundResource(Resource.Drawable.LutonVan); iCurrentDamageImageId = 201; } else if (rentRunningTrans.VehicleType == "Standard Van") { imgVehicle.Id = 301; imgVehicle.SetBackgroundResource(Resource.Drawable.StandardVan); imgVehicle.SetOnClickListener(this); // add into my parent view _layoutVehicleImages.AddView(imgVehicle); _markdamage.SetBackgroundResource(Resource.Drawable.StandardVan); iCurrentDamageImageId = 301; } _markdamage.RemoveAllViews(); _markdamage.SetOnTouchListener(this); _markdamage.SetOnDragListener(this); if (rentRunningTrans.RentVehicleDamage != null) { foreach (var objVehicleMarkDamage in rentRunningTrans.RentVehicleDamage.Where(x => x.DamageImageId == iCurrentDamageImageId).OrderBy(x => x.DamageNumber)) { this.DrawDamageCircle(objVehicleMarkDamage); iLastDamageNumber = objVehicleMarkDamage.DamageNumber; } } } catch (Exception ex) { //Do nothing } } } } else { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetMessage("Please enable internet to get vehicle images from API."); alert.SetNeutralButton("OK", delegate { }); alert.Create().Show(); } //this.progressLayout.Visibility = ViewStates.Gone; }