public void FileReceivedDelegate(string fileName, string fileDescription, string filePath, int fileSize, TextView associatedTextView) { MimeTypeMap mime = MimeTypeMap.Singleton; string ext = fileName.ToLower(); string extension = MimeTypeMap.GetFileExtensionFromUrl(ext); string type = null; if (extension != null) { type = MimeTypeMap.Singleton.GetMimeTypeFromExtension(extension); } if (type == null) { type = "application/octet-stream"; } DownloadManager downloadManager = DownloadManager.FromContext(Android.App.Application.Context); downloadManager.AddCompletedDownload(fileName, fileDescription, true, type, filePath, fileSize, true); CommClientAndroid client2 = ClientHolder.Client; client2.RemoveFile(associatedTextView.Text); ViewGroup parent = (ViewGroup)associatedTextView.Parent; parent.Post(delegate { parent.RemoveView(associatedTextView); }); client.currentlyDownloadingFile = false; }
public void OnAnimationEnd(Animation animation) { View view = appMsg.View; if (appMsg.Floating) { ViewGroup parent = view.Parent as ViewGroup; if (parent != null) { parent.Post(() => { parent.RemoveView(view); }); } } else { view.Visibility = ViewStates.Gone; } }
public void OnAnimationEnd(Animation animation) { container.Post(new SwapViews(position, container, photos_list, image_view)); }
private void Reset() { TurningButtonPressed(true); _root.RemoveAllViews(); _gridView = new GridView(this); _root.AddView(_gridView); _drawView = new DrawView(this); _root.AddView(_drawView); _commentView = new TextView(this); _commentView.SetTextColor(Color.DarkRed); var layoutParams = new RelativeLayout.LayoutParams(400, 250) { LeftMargin = 100, TopMargin = 100 }; _commentView.LayoutParameters = layoutParams; _root.AddView(_commentView); DrawPilots(); DrawRevKites(); _root.Post(() => { _viewModel.Team.Pilots.Clear(); _viewModel.AddPilot(new Pilot { Name = "Vienna", PlaceInLine = 1, Position = new Position { X = _pilotVienna.GetX(), Y = _pilotVienna.GetY() }, Kite = new Kite { Rotation = _kiteVienna.Rotation, Position = new Position { X = _kiteVienna.GetX(), Y = _kiteVienna.GetY() } } }); _viewModel.AddPilot(new Pilot { Name = "Tim", PlaceInLine = 2, Position = new Position { X = _pilotTim.GetX(), Y = _pilotTim.GetY() }, Kite = new Kite { Rotation = _kiteTim.Rotation, Position = new Position { X = _kiteTim.GetX(), Y = _kiteTim.GetY() } } }); _viewModel.AddPilot(new Pilot { Name = "Mario", PlaceInLine = 3, Position = new Position { X = _pilotMario.GetX(), Y = _pilotMario.GetY() }, Kite = new Kite { Rotation = _kiteMario.Rotation, Position = new Position { X = _kiteMario.GetX(), Y = _kiteMario.GetY() } } }); _viewModel.AddPilot(new Pilot { Name = "Twan", PlaceInLine = 4, Position = new Position { X = _pilotTwan.GetX(), Y = _pilotTwan.GetY() }, Kite = new Kite { Rotation = _kiteTwan.Rotation, Position = new Position { X = _kiteTwan.GetX(), Y = _kiteTwan.GetY() } } }); _viewModel.AddPilot(new Pilot { Name = "Judith", PlaceInLine = 5, Position = new Position { X = _pilotJudith.GetX(), Y = _pilotJudith.GetY() }, Kite = new Kite { Rotation = _kiteJudith.Rotation, Position = new Position { X = _kiteJudith.GetX(), Y = _kiteJudith.GetY() } } }); _viewModel.AddPilot(new Pilot { Name = "Sanne", PlaceInLine = 6, Position = new Position { X = _pilotSanne.GetX(), Y = _pilotSanne.GetY() }, Kite = new Kite { Rotation = _kiteSanne.Rotation, Position = new Position { X = _kiteSanne.GetX(), Y = _kiteSanne.GetY() } } }); _drawView.UpdateTeam(_viewModel.Team); _drawView.Invalidate(); }); }