private void LlNotification_Click(object sender, EventArgs e) { notification.Visibility = ViewStates.Visible; try { using (OpenNotification openNotification = new OpenNotification(position)) { Activity.RunOnUiThread(() => openNotification.ClickNotification() ); if (OpenNotification.NotificationIsAutoCancel(position) == true) { notification.Visibility = ViewStates.Invisible; titulo.Text = null; texto.Text = null; when.Text = null; notificationActions.RemoveAllViews(); } } } catch { Log.Wtf("OnNotificationClicked", "Metodo falla porque no existe una notificacion con esta acción"); } }
public void aplayOnClick(object sender, EventArgs e) { int count = int.Parse(FindViewById <EditText>(Resource.Id.editText1).Text); LinearLayout yourFormLayout = FindViewById <LinearLayout>(Resource.Id.linearLayout1); var parameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); //add some parameters parameters.SetMargins(20, 20, 20, 10); parameters.Width = 80; yourFormLayout.RemoveAllViews(); for (int i = 0; i < count; i++) { //create new element EditText letterTextEdit = new EditText(this); letterTextEdit.Text = ""; /*button.SetBackgroundColor(Android.Graphics.Color.); * button.SetTextColor(Android.Graphics.Color.White);*/ letterTextEdit.LayoutParameters = parameters; letterTextEdit.Text = "*"; letterTextEdit.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(1) }); letterTextEdit.Id = i; //Add the button yourFormLayout.AddView(letterTextEdit); } yourFormLayout = FindViewById <LinearLayout>(Resource.Id.linearLayout2); parameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); parameters.SetMargins(20, 20, 20, 10); parameters.Width = 80; yourFormLayout.RemoveAllViews(); for (int i = 0; i < count; i++) { //create new element EditText letterTextEdit = new EditText(this); letterTextEdit.Text = ""; /*button.SetBackgroundColor(Android.Graphics.Color.); * button.SetTextColor(Android.Graphics.Color.White);*/ letterTextEdit.LayoutParameters = parameters; letterTextEdit.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(1) }); letterTextEdit.Id = 100 + i; //Add the button yourFormLayout.AddView(letterTextEdit); } }
private void MBtnUpdatePro_Click(object sender, EventArgs e) { Btn_Activater(); mDashLayout.RemoveAllViews(); mBtnUpdatePro.Clickable = false; mBtnUpdatePro.SetBackgroundColor(Color.ParseColor("#ff20bf22")); // ListViewAdapter View inflatedLayout = inflater.Inflate(Resource.Menu.UpdateProfile, null); mDashLayout.AddView(inflatedLayout); }
protected override void InitEvents() { // 返回 ((ImageButton)FindViewById(Resource.Id.imgBtn_back)).Click += (sender, e) => { CurrActivity.Finish(); OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out); }; llBox.RemoveAllViews(); }
private void Hoch() { if (gezeigt > 0) { monsteranzeige.RemoveAllViews(); gezeigt--; for (int i = gezeigt; i < gezeigt + 5; i++) { monsteranzeige.AddView(monsterauswahl[i].Button); } } }
public View GetView() { mainView.RemoveAllViews(); if (type != CellModel.Type.Image) { mainView.AddView(this.column.GetView()); } mainView.AddView(this.cell.GetView()); mainView.SetGravity(GravityFlags.Center); mainView.SetPadding(0, 0, 20, 0); return(mainView); }
private void iniImageUser() { linearUsers.RemoveAllViews(); ItemUser item1 = new ItemUser(context, "images/e1.jpg"); item1.NameUser = "******"; ItemUser item2 = new ItemUser(context, "images/e2.jpg"); item2.NameUser = "******"; ItemUser item3 = new ItemUser(context, "images/e3.jpg"); item3.NameUser = "******"; ItemUser item4 = new ItemUser(context, "images/e4.jpg"); item4.NameUser = "******"; ItemUser item5 = new ItemUser(context, "images/e5.jpg"); item5.NameUser = "******"; linearUsers.AddView(item1); linearUsers.AddView(item2); linearUsers.AddView(item3); linearUsers.AddView(item4); linearUsers.AddView(item5); }
private void InitRouteInfo() { TextView descriptionView = (TextView)FindViewById(Resource.Id.routeDetailsDescription); TextView durationView = (TextView)FindViewById(Resource.Id.routeDetailsDuration); TextView distanceView = (TextView)FindViewById(Resource.Id.routeDetailsDistance); LinearLayout tagsLayout = (LinearLayout)FindViewById(Resource.Id.routeDetailsTagsLayout); descriptionView.Text = route.Description; int durationInMinutes = route.Duration / 60; durationView.Text = Resources.GetQuantityString( Resource.Plurals.route_activity_duration_minutes, durationInMinutes, durationInMinutes); distanceView.Text = String.Format(Resources.GetString(Resource.String.route_activity_distance_kilometer), route.Distance); //Add tags if (route.RouteTags.Any()) { tagsLayout.RemoveAllViews(); foreach (RouteTag tag in route.RouteTags) { ImageView tagImageView = new ImageView(ApplicationContext); tagImageView.SetImageDrawable(tag.Image.GetDrawable(this, tagImageView.Width, tagImageView.Height)); tagsLayout.AddView(tagImageView); } } }
public void imLoClick(object sender, EventArgs eventArgs) { var imView = sender as ImageLOView; currentLOImageIndex = imView.index; if (lastSelected != -1) { _ListLOImages_S2 [lastSelected].RemoveView(selectLayout); } imView.AddView(selectLayout); lastSelected = currentLOImageIndex; var textFormat = Android.Util.ComplexUnitType.Px; var test = new ImageView(context); test.DrawingCacheEnabled = true; test.LayoutParameters = new LinearLayout.LayoutParams(-1, -1); Picasso.With(context).Load(imView.sBackgoundUrl).Resize(Configuration.getWidth(640), Configuration.getWidth(640)).CenterCrop().Into(test); _fondo2.SetVerticalGravity(Android.Views.GravityFlags.Start); _fondo2.RemoveAllViews(); infoCursoUnidad.RemoveAllViews(); _txtCursoN.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(55)); _txtUnidadN.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(50)); //Eliminando los subtitulos innecesarios if (!_txtCursoN.Text.ToString().Equals(Resources.GetText(Resource.String.mejorescampamentos50))) { _txtUnidadN.Text = _txtCursoN.Text; _txtCursoN.Text = " "; _txtUnidadN.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(55)); } infoCursoUnidad.AddView(_txtCursoN); infoCursoUnidad.AddView(_txtUnidadN); _fondo2.AddView(test); //_txtCursoN.Text = "PROBANDO"; //_txtUnidadN.Text = "PROBANDO"; _txtCursoN.SetTextColor(Color.ParseColor("#ffffff")); _txtCursoN.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); _txtUnidadN.SetTextColor(Color.ParseColor("#ffffff")); _txtUnidadN.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); _txtCursoN.Gravity = Android.Views.GravityFlags.Right; _txtUnidadN.Gravity = Android.Views.GravityFlags.Right; //_txtCursoN.TextAlignment = Android.Views.TextAlignment.Gravity; _fondo2.AddView(infoCursoUnidad); //infoCursoUnidad.SetX (Configuration.getWidth (300)); infoCursoUnidad.SetY(Configuration.getWidth(420)); //actualizar titulo, nombreAuthor, capitulo, imAuthor }
private void RebuildView() { if (cells.Count == 0) { return; } mainIdentifierLayout.RemoveAllViews(); ImageCell = null; imageView.RemoveAllViews(); contentlayout.RemoveAllViews(); mainIdentifierLayout.AddView(cells[0].GetHeadlineView()); for (int i = 1; i < cells.Count; ++i) { if (cells[i].CellType() == CellModel.Type.Image && null == ImageCell) { imageView.AddView(cells[i].GetView()); ImageCell = cells[i]; } else { contentlayout.AddView(cells[i].GetView()); } } }
/// <summary> /// Builds the right button area /// </summary> private void BuildRightArea() { mRightArea.RemoveAllViews(); foreach (var item in mRightButtons) { if (item.Content is String) { //add a standard text button var aButton = new ImageButton(Context); //aButton.SetImageResource (Resource.Drawable.menu); //aButton.Text = item.Content as String; aButton.SetBackgroundDrawable(null); aButton.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.WrapContent, LayoutParams.FillParent); if (item.ClickCommand != null) { aButton.Click += (object sender, EventArgs e) => { item.ClickCommand(); }; } mRightArea.AddView(aButton); } } }
protected override async void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Canceled) { return; } switch (requestCode) { case (int)Constants.ActivityRequestCode.ImageViewer: horizontalImageViewer.RemoveAllViews(); await SetPicturePreviewAsync(); break; case (int)Constants.ActivityRequestCode.Camera: await data.GetMediaFileExtraAsync(this).ContinueWith(t => { var image = imageHelper.PathToCDPImage(t.Result.Path); image.Click += image_Click; horizontalImageViewer.AddView(image.Imageview); }, TaskScheduler.FromCurrentSynchronizationContext()); break; default: break; } }
private void BuildTaskLetters(List <TaskItem> taskItems, Case fontCase) { llTaskItems.RemoveAllViews(); // Convert letters to font case foreach (var item in taskItems) { item.TaskLetter.Letter = item.TaskLetter.Letter.ToCase(fontCase); item.TaskLetter.CorrectLetter = item.TaskLetter.CorrectLetter.ToCase(fontCase); } var taskItemAdapter = new TaskItemAdapter(Activity.BaseContext, 0, taskItems); for (var i = 0; i < taskItems.Count; i++) { var view = taskItemAdapter.GetView(i, null, null); // Define searched letters as drop zone if (taskItems.ElementAt(i).IsSearched) { view.Drag += View_Drag; } // Add letter to view llTaskItems.AddView(view); } }
void PrepareDots(int currentSlidePosition) { if (dotsLayout.ChildCount > 0) { dotsLayout.RemoveAllViews(); } ImageView[] dots = new ImageView[5]; for (int i = 0; i < 5; i++) { dots[i] = new ImageView(this); if (i == currentSlidePosition) { dots[i].SetImageDrawable(ContextCompat.GetDrawable(this, Resource.Drawable.active_dot)); } else { dots[i].SetImageDrawable(ContextCompat.GetDrawable(this, Resource.Drawable.inactive_dot)); } LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); layoutParams.SetMargins(4, 0, 4, 0); dotsLayout.AddView(dots[i], layoutParams); } }
private void showEventDocuments() { if (mEvent.Archivos != null) { LinearLayout documentsContainer = FindViewById <LinearLayout>(Resource.Id.eventsDocumentList); documentsContainer.RemoveAllViews(); foreach (AttachmentFile obs in mEvent.Archivos) { string privatePublicc; if (obs.Private) { privatePublicc = "Privado"; } else { privatePublicc = "Publico"; } LayoutInflater inflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService); ViewGroup view = (ViewGroup)inflater.Inflate(Resource.Layout.EventDocumentRow, documentsContainer, false); view.FindViewById <TextView>(Resource.Id.txtDocumentName).Text = obs.FileName + " " + privatePublicc; view.FindViewById <TextView>(Resource.Id.txtDocumentName).PaintFlags = Android.Graphics.PaintFlags.UnderlineText; documentsContainer.AddView(view); view.Click += (sender, e) => OnDocumentClick(this, obs); } eventsDocumentList.Parent.RequestLayout(); } }
private void PopulateButtons() { LinearLayout buttonsLayout = FindViewById <LinearLayout>(Resource.Id.loginButtonsLayout); buttonsLayout.RemoveAllViews(); var posAvail = AppSettings.Global.Positions.Split(',').Select(s => s.Trim()); ViewGroup.LayoutParams layoutParams = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); foreach (string pos in posAvail) { Button button = new Button(this) { Text = pos, LayoutParameters = layoutParams, }; button.Click += async(s, e) => await DoLogin(pos); buttonsLayout.AddView(button); } }
protected bool BuildSolutionItems(List <Concept> solutionItems) { bool itemsCreated = false; // Replace top margin of solution items SetTopMargin(3, llSolutionItems); // Add solution items to view llSolutionItems.RemoveAllViews(); foreach (var item in solutionItems) { // Init concept view var conceptView = CreateConceptView(item); var conceptContainer = CreateConceptContainer(conceptView); conceptContainer.SetBackgroundResource(Resource.Drawable.rectangle_green); // Play sound if (item is ISound) { if (!string.IsNullOrEmpty((item as ISound).SoundPath)) { SoundPlayer.PlaySound(Activity.BaseContext, (item as ISound).SoundPath); } } // Add view to solution items llSolutionItems.AddView(conceptContainer); itemsCreated = true; } return(itemsCreated); }
protected override void RefreshData() { VOOrder order = bll.GetOrder(orderId); if (order == null) { Finish(); } EditText etId = FindViewById <EditText>(Resource.Id.etId); EditText etStatus = FindViewById <EditText>(Resource.Id.etStatus); LinearLayout Products = FindViewById <LinearLayout>(Resource.Id.Products); etId.Text = order.Id; etStatus.Text = order.Status; Products.RemoveAllViews(); Products.AddView(CreateHorizontalWith2Text("Id", "Quantity")); foreach (var product in order.ProductList) { Products.AddView(CreateHorizontalWith2Text(product.Key, product.Value.ToString())); } }
public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent) { var view = (convertView ?? activity.LayoutInflater.Inflate(Resource.Layout.item, parent, false)) as LinearLayout; TextView name = (TextView)view.FindViewById <TextView>(Resource.Id.textViewName); LinearLayout view_checkboxs = (LinearLayout)view.FindViewById <LinearLayout>(Resource.Id.linearLayoutCheckBoxs); Button btnSend = (Button)view.FindViewById <TextView>(Resource.Id.buttonSend); var item = (Land)this.GetItem(position); name.Text = item.name; //Динамически добавляем флажки, если их не было view_checkboxs.RemoveAllViews(); if (view_checkboxs.ChildCount == 0) { for (int i = 0; i < item.citys.Count; i++) { var check = new CheckBox(Context); check.Text = item.citys[i].Name; check.Checked = item.citys[i].IsSel; check.Tag = item.citys[i].Name; check.SetOnCheckedChangeListener(null); check.SetOnCheckedChangeListener(new CheckedChangeListener(position, item.citys, this)); view_checkboxs.AddView(check); } } btnSend.Tag = item.name; btnSend.SetOnClickListener(null); btnSend.SetOnClickListener(new ButtonClickListener(item)); return(view); }
/// <summary> /// データを表示します。 /// </summary> private void RenderData() { mainLinearLayout.RemoveAllViews(); //テキストの配置 foreach (var keyValue in trainDataFile.DepartureTrainDatas) { var depData = keyValue.Value; var showCount = new int[] { depData.Count, showCountMax }.Min(); var destTypeGroupedTrainLinearLayout = new LinearLayout(this) { Orientation = Orientation.Vertical }; for (var j = 0; j < showCount; j++) { var trainGaiyoLayout = RenderTrainDataLayout(depData[j]); trainGaiyoLayout.SetPadding(20, 5, 20, 5); destTypeGroupedTrainLinearLayout.AddView(trainGaiyoLayout, trainDataLayoutParams); } TapToDeployLayout tapToDeployLayout = new TapToDeployLayout(this) { Title = keyValue.Key.GetName(), View = destTypeGroupedTrainLinearLayout, Color = color, }; mainLinearLayout.AddView(tapToDeployLayout.GetView(), MP_WP_LayoutParams); } }
private void FillWithD20s(int numberOfDies, int parentLayoutWidth, LinearLayout dies) { dies.RemoveAllViews(); LinearLayout sub = null; int imageSize = (parentLayoutWidth / Math.Min(numberOfDies, diesPerRow)) - 5; for (int i = 0; i < numberOfDies; i++) { if (i % diesPerRow == 0) { sub = new LinearLayout(this) { Orientation = Orientation.Horizontal }; sub.SetGravity(GravityFlags.Center); dies.AddView(sub); } ImageView image = new ImageView(this); image.SetImageDrawable(GetDrawable(R.Dies[1])); image.SetForegroundGravity(GravityFlags.Center); int diceNr = i; image.Click += (sender, e) => RollD20(diceNr); sub.AddView(image, width: imageSize, height: imageSize); } }
private void PopulateProjectListView() { // Get the projects API.Project[] projects = API.Project.GetProjects(Token.AuthToken); // Get layout container LinearLayout layout = FindViewById <LinearLayout>(Resource.Id.projectListLayout); // Clear out any existing stuff layout.RemoveAllViews(); // Add of the projects as a button to the layout foreach (var project in projects) { Button projButton = new Button(this); projButton.Text = project.Name; projButton.Click += (object sender, EventArgs e) => { // Send the user to the project menu view? var projectOptionsActivity = new Intent(this, typeof(ProjectOptionsActivity)); projectOptionsActivity.PutExtra("SelectedProjectId", project.ProjectId); this.StartActivity(projectOptionsActivity); }; layout.AddView(projButton); } }
private void CreateViewForManyCars(List <Car> cars) { _container.RemoveAllViews(); if (cars == null) { return; } foreach (var car in cars) { var images = _carRepository.GetCarImages(car.Id); var Win = new TextView(this); Win.Text = car.WIN; Win.SetTextSize(ComplexUnitType.Pt, 11); Win.SetTextColor(new Color(Color.DarkBlue)); Win.Gravity = GravityFlags.Center; //Win.SetBackgroundColor(new Color(Color.WhiteSmoke)); //Win.SetShadowLayer(2, 2, 2, Color.Black); Win.Click += delegate { CreateViewForSingleCar(car.WIN); }; var winCard = new Android.Support.V7.Widget.CardView(this); winCard.CardElevation = 10; winCard.Radius = 5; winCard.SetContentPadding(5, 5, 5, 5); var lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent); lp.SetMargins(10, 10, 10, 10); winCard.AddView(Win, lp); _container.AddView(winCard, lp); } }
async void GetData() { AgentCollection data = await Task.Run(() => GetMachData()); agents.RemoveAllViews(); foreach (Agent agent in data.Agents) { TextView view = new TextView(ApplicationContext); view.SetText(agent.Name, null); view.Gravity = Android.Views.GravityFlags.CenterHorizontal; if (agent.IsDead()) { view.SetTextColor(Color.Red); } else if (agent.IsIdle()) { view.SetTextColor(Color.White); } else { view.SetTextColor(Color.Green); } view.SetTextSize(Android.Util.ComplexUnitType.Sp, 25); view.Click += delegate { StartActivity(typeof(AgentStatus)); }; agents.AddView(view); } AllAgents = data; }
private void initView() { ll_box = mainView.FindViewById <LinearLayout>(Resource.Id.ll_box); ll_box.RemoveAllViews(); foreach (var d in DicDataType) { var itemView = LayoutInflater.FromContext(this.mContent).Inflate(Resource.Layout.item_popwin_financialyear, null); TextView tvTitle = itemView.FindViewById <TextView>(Resource.Id.tv_year); tvTitle.Text = d.Value; if (d.Value == SelectedText) { //tvTitle.SetTextColor(this.mContent.Resources.GetColor(Resource.Color.textColorHigh, null)); tvTitle.SetTextColor(new Color(ContextCompat.GetColor(this.mContent, Resource.Color.textColorHigh))); } else { //tvTitle.SetTextColor(this.mContent.Resources.GetColor(Resource.Color.textColorPrimary, null)); tvTitle.SetTextColor(new Color(ContextCompat.GetColor(this.mContent, Resource.Color.textColorPrimary))); } tvTitle.Click += (sender, e) => { if (clickItem != null) { clickItem(d.Value); } }; ll_box.AddView(itemView); } }
private void OutputListLayoutReset() { //var table = db.Table<Time>().OrderBy(t => t.SavedTime); /*if (currentUser == null) * return; * var table = await client.GetTable<RegisteredTime>().Where(t => t.TimeUserId == currentUser.Id).OrderBy(t => t.SavedTime).ThenBy(t => t.createdAt).ToEnumerableAsync();*/ var table = registeredTimesDB.Table <Time>().OrderByDescending(t => t.SavedTime).ThenByDescending(t => t.CreatedTime).ToList(); outputContainer.RemoveAllViews(); outputContainer.AddView(listButtonsGrid); foreach (Time t in table) { if (Math.Abs(DateTime.Now.DayOfYear - t.SavedTime.DayOfYear + 365 * (DateTime.Now.Year - t.SavedTime.Year)) < 14) { AddTimeToOutputList(t); } } if (outputContainer.ChildCount == 1) { listButtonsGrid.FindViewById <Button>(Resource.Id.resetAllButton).Enabled = false; } else { listButtonsGrid.FindViewById <Button>(Resource.Id.resetAllButton).Enabled = true; } //db.Close(); }
private void RevealCategoriesDialog() { var inflater = GetSystemService(Context.LayoutInflaterService) as LayoutInflater; _categoriesList.RemoveAllViews(); View view = this.CurrentFocus; if (view != null) { (this.GetSystemService(InputMethodService) as InputMethodManager) .HideSoftInputFromWindow(view.WindowToken, 0); } foreach (var category in NoteStorage.GetCurrentCategories(this)) { View entry = inflater.Inflate(Resource.Layout.CategoriesDialogItem, null); entry.FindViewById <Button>(Resource.Id.categoriesDialogEntryText).Text = category; entry.FindViewById <Button>(Resource.Id.categoriesDialogEntryText).Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/MINIONPRO-REGULAR.OTF"); entry.Click += (object sender, EventArgs e) => { _categoriesListButton.Text = category; _categoriesListButton.Tag = NoteStorage.GetCurrentCategories(this).IndexOf(category); FindViewById <RelativeLayout>(Resource.Id.categoriesDialogBG).Visibility = ViewStates.Invisible; }; _categoriesList.AddView(entry); } FindViewById <RelativeLayout>(Resource.Id.categoriesDialogBG).Visibility = ViewStates.Visible; }
void RefreshPhotoList() { //llPhotoList.RemoveViews (1, llPhotoList.ChildCount - 1); PhotoTable.RemoveAllViews(); int i = 0; foreach (var item in Photos) { i++; View vPhoto = Inflater.Inflate(Resource.Layout.PhotoTableItem, null); vPhoto.SetTag(Resource.String.PhotoPath, item.PhotoPath); vPhoto.FindViewById <TextView>(Resource.Id.ptiNumTV).Text = i.ToString(); var photoType = MainDatabase.GetItem <PhotoType>(item.PhotoType); vPhoto.FindViewById <TextView>(Resource.Id.ptiTypeTV).Text = photoType.name; string drugBrand = (photoType.isNeedBrand) ? MainDatabase.GetItem <DrugBrand>(item.Brand).name : @"<не требуется>"; vPhoto.FindViewById <TextView>(Resource.Id.ptiSubTypeTV).Text = drugBrand; vPhoto.FindViewById <TextView>(Resource.Id.ptiDateTimeTV).Text = item.Stamp.ToString("G"); vPhoto.Click += (object sender, EventArgs e) => { View view = (View)sender; //Toast.MakeText(Activity, view.GetTag(Resource.String.PhotoPath).ToString(), ToastLength.Short).Show(); Intent intent = new Intent(Intent.ActionView); intent.SetDataAndType(Android.Net.Uri.Parse("file://" + view.GetTag(Resource.String.PhotoPath).ToString()), "image/*"); StartActivity(intent); }; PhotoTable.AddView(vPhoto); } }
private void initView() { ll_box = mainView.FindViewById <LinearLayout>(Resource.Id.ll_box); ll_box.RemoveAllViews(); foreach (var quarter in quarterList) { var itemView = LayoutInflater.FromContext(this.mContent).Inflate(Resource.Layout.item_popwin_financialyear, null); TextView tvTitle = itemView.FindViewById <TextView>(Resource.Id.tv_year); tvTitle.Text = quarter.QuarterName; if (quarter.IsCurrent) { tvTitle.SetTextColor(new Color(ContextCompat.GetColor(this.mContent, Resource.Color.textColorHigh))); } tvTitle.Click += (sender, e) => { if (clickItem != null) { clickItem(quarter); } }; ll_box.AddView(itemView); } }
private void CreateIndicator() { indicatorImages.Clear(); indicator.RemoveAllViews(); indicatorInside.RemoveAllViews(); for (int i = 0; i < count; i++) { ImageView imageView = new ImageView(context); imageView.SetScaleType(ImageView.ScaleType.CenterCrop); LinearLayout.LayoutParams @params = new LinearLayout.LayoutParams(mIndicatorWidth, mIndicatorHeight) { LeftMargin = mIndicatorMargin, RightMargin = mIndicatorMargin }; if (i == 0) { imageView.SetImageResource(mIndicatorSelectedResId); } else { imageView.SetImageResource(mIndicatorUnselectedResId); } indicatorImages.Add(imageView); if (bannerStyle == BannerConfig.CIRCLE_INDICATOR || bannerStyle == BannerConfig.CIRCLE_INDICATOR_TITLE) { indicator.AddView(imageView, @params); } else if (bannerStyle == BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE) { indicatorInside.AddView(imageView, @params); } } }
public static void addFileView(Context context, List<BookingDocumentDto> documents, bool isInConference, OnAddFileToView addFiles, DeleteFile deleteFile, LinearLayout llFileAttachment){ if (addFiles == null) { addFiles = new OnAddFileToView (context, deleteFile, isInConference); } addFiles.InitView (documents); llFileAttachment.RemoveAllViews (); llFileAttachment.AddView (addFiles); }
AdView AddAd (LinearLayout adViewContainer, string adid) { AdView adView = null; if (adViewContainer != null && !string.IsNullOrEmpty (adid)) { adViewContainer.RemoveAllViews (); adView = new AdView (this) { AdSize = AdSize.SmartBanner, AdUnitId = adid, }; adViewContainer.AddView (adView); adView.LoadAd (new AdRequest.Builder ().Build ()); } return adView; }
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 openDrawer(object sender, EventArgs e) { ImageButton button = (ImageButton)sender; if (!drawerState) RunOnUiThread(() => drawer.Close()); drawerState = true; LinearLayout content = FindViewById<LinearLayout>(Resource.Id.content); LinearLayout v = new LinearLayout(context); v.RemoveAllViews(); content.RemoveAllViews(); RunOnUiThread(() => sliderToggle.SetBackgroundResource(Resource.Drawable.scrolldown)); switch (button.Id) { case Resource.Id.imgColour: Intent r = new Intent(this, typeof(ColorPickerDialog)); StartActivityForResult(r, COLOR); break; case Resource.Id.imgConfig: v = createConfigPicker(); RunOnUiThread(delegate { content.AddView(v); drawer.Open(); }); drawerState = false; break; case Resource.Id.imgPaint: v = createPaintBrushes(); RunOnUiThread(delegate { content.AddView(v); drawer.Open(); }); drawerState = false; break; case Resource.Id.imgStamp: case Resource.Id.imgText: case Resource.Id.imgComix: Intent i = new Intent(this, typeof(Messages.ContentPackActivity)); if (button.Id == Resource.Id.imgStamp) { i.PutExtra("pack", 4); i.PutExtra("animated", true); i.PutExtra("fromanimated", true); StartActivityForResult(i, STAMP); } else { if (button.Id == Resource.Id.imgText) { i.PutExtra("pack", 0); i.PutExtra("animated", true); i.PutExtra("fromanimated", true); StartActivityForResult(i, TEXT); } else { i.PutExtra("pack", 2); i.PutExtra("animated", true); i.PutExtra("fromanimated", true); StartActivityForResult(i, COMIX); } } break; case Resource.Id.imgSound: case Resource.Id.imgPicture: ShowModalPreviewDialog(button.Id == Resource.Id.imgPicture ? 0 : 1); break; } }
/// <summary> /// ����������� /// </summary> /// <param name="llRects"></param> public void CreateRect(LinearLayout llRects) { llRects.RemoveAllViews(); //��ͼ��ÿ��ͼƬ�ÿ�߶�һ�� Bitmap[] mBitmaps = new Bitmap[5]{ ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_jian)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_ling)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_qianzhong)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_yao)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_yexia)).Bitmap }; Bitmap[] sBitmaps = new Bitmap[5] { ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_jian_selected)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_ling_selected)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_qianzhong_selected)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_yao_selected)).Bitmap, ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.s_yexia_selected)).Bitmap }; Bitmap line = ((BitmapDrawable)Resources.GetDrawable(Resource.Drawable.game_line)).Bitmap; RectsView rectsView = new RectsView(this, null, mBitmaps, sBitmaps, line, shengDaoSelected); rectsView.LayoutParameters = new LinearLayout.LayoutParams(line.Width, line.Height); shengDaoSelected.RectsView = rectsView; llRects.AddView(rectsView); }
/// <summary> /// Gets the meal removed. /// </summary> /// <param name="url">URL.</param> /*private void GetMealRemoved (string url) { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create (new Uri (url)); request.ContentType = ""; request.Method = "GET"; // Send the request to the server and wait for the response: using (WebResponse response = request.GetResponse()) { } }*/ /// <summary> /// Loads the recipes based on the meal id and has place to put the recipe results /// </summary> /// <param name="mealArea">Meal area to put results.</param> /// <param name="mealId">Meal identifier to find recipes related to.</param> private async void LoadRecipes (LinearLayout mealArea, int mealId) { mealArea.RemoveAllViews (); string user = "******"; string url = "/CalendarScreen/GetRecipesForMeal?user="******"&mealId=" + mealId; JsonValue json = await WebUtils.getJSONResponseAsync (url); ParseRecipes (mealArea, mealId, json); }