public void OnItemClick(AdapterView parent, View view, int position, long id) { ImageView icRightBtn = view.FindViewById <ImageView>(Resource.Id.ivWeClipItem_icRight); EventFiles model = ListOfEventFiles.listOfEventFiles[position]; if (model.isSelected()) { if (model.IsVideo) { NoofVideo--; } else { NoofImage--; } model.setSelected(false); icRightBtn.Visibility = ViewStates.Gone; } else { if (model.IsVideo) { NoofVideo++; } else { NoofImage++; } model.setSelected(true); icRightBtn.Visibility = ViewStates.Visible; } etTitle.Text = NoofVideo + " Videos |" + " " + NoofImage + " Images"; }
//This would be my Update function, based on the ComboBox selection I would show some files in my ListBox, but it's not public void GetFiles(string ptr) { _filesList = Directory.GetFiles(@"\\mp-2624/c$/xampp/htdocs/desenv2/public/esocial/eventos/aguardando/"); EventFiles.Clear(); foreach (string file in _filesList) { var r = new Regex(ptr, RegexOptions.IgnoreCase); var tempFiles = new EventFiles { Key = file, Value = file.Split('/')[9] }; if (r.Match(file).Success) { EventFiles.Add(tempFiles); } } OnPropertyChanged(nameof(EventFilesViewModel)); }
public void OnItemClick(AdapterView parent, View view, int position, long id) { ImageView icRightBtn = view.FindViewById <ImageView>(Resource.Id.ivWeClipItem_icRight); EventFiles model = ListOfDefultEventFiles.listOfEventFiles[position]; if (model.ID != 0) { if (model.isSelected()) { if (model.IsVideo) { NoofVideo--; } else { NoofImage--; } model.setSelected(false); icRightBtn.Visibility = ViewStates.Gone; } else { if (model.IsVideo) { NoofVideo++; } else { NoofImage++; } model.setSelected(true); icRightBtn.Visibility = ViewStates.Visible; } etTitle.Text = NoofVideo + " Videos |" + " " + NoofImage + " Images"; } else { Intent intent = new Intent(context, typeof(AddImageAndVideoForEventActivity)); intent.PutExtra("strCapture", model.EventID); intent.PutExtra("strIsDefaultEvent", true); context.StartActivity(intent); context.Finish(); } }
public itemClickListner(EventFiles evFileInfo, Activity context, ImageView imageView) { this.evFileInfo = evFileInfo; this.context = context; this.imageView = imageView; }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.VideoPlayer); Toolbar toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); TextView toolbar_title = (TextView)FindViewById(Resource.Id.toolbar_title); pDialog = FindViewById <ProgressBar>(Resource.Id.progessbar); SetSupportActionBar(toolbar); Window.SetSoftInputMode(SoftInput.StateAlwaysHidden); if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop) { Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark))); } SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); var url = Intent.GetStringExtra("VideoUrl") ?? null; var urlFromEvent = Intent.GetStringExtra("VideoUrlFromEvent") ?? null; urlFromTheme = Intent.GetStringExtra("VideoUrlFromTheme") ?? null; if (url != null && url != "") { SupportActionBar.Title = ""; toolbar_title.Text = "WeClip"; videoInfo = JsonConvert.DeserializeObject <WeClipVideo>(url); videoUri = Android.Net.Uri.Parse(videoInfo.VideoFileUrl); EventName = videoInfo.EventName; EventDate = videoInfo.EventDate; videoFileName = videoInfo.VideoFileName; videoUrl = videoInfo.VideoFileUrl; shareTitle = videoInfo.EventName; shareDate = videoInfo.EventDate != null?videoInfo.EventDate.ToString() : ""; sharePath = videoInfo.VideoFileUrl; } else if (!string.IsNullOrEmpty(urlFromEvent)) { SupportActionBar.Title = ""; toolbar_title.Text = "Event Video"; EventvideoInfo = JsonConvert.DeserializeObject <EventFiles>(urlFromEvent); videoUri = Android.Net.Uri.Parse(EventvideoInfo.FileUrl); EventName = EventvideoInfo.EventName; videoFileName = EventvideoInfo.FileName; videoUrl = EventvideoInfo.FileUrl; shareTitle = EventvideoInfo.EventName; shareDate = ""; sharePath = EventvideoInfo.FileUrl; } else if (!string.IsNullOrEmpty(urlFromTheme)) { SupportActionBar.Title = ""; videoInfo = JsonConvert.DeserializeObject <WeClipVideo>(urlFromTheme); toolbar_title.Text = videoInfo.EventName; videoUri = Android.Net.Uri.Parse(videoInfo.VideoFileUrl); videoFileName = videoInfo.VideoFileName; videoUrl = videoInfo.VideoFileUrl; shareTitle = videoInfo.EventName; shareDate = videoInfo.EventDate != null?videoInfo.EventDate.ToString() : ""; sharePath = videoInfo.VideoFileUrl; } if (videoUri == null) { AlertBox.Create("Alert", "Error in WeClip source.", this); return; } if (getfileFromPath(videoFileName)) { videoUri = localFileUrl; } llVideoView = FindViewById <LinearLayout>(Resource.Id.llVideoView); playerSurface = FindViewById <SurfaceView>(Resource.Id.playerSurface); vidHolder = playerSurface.Holder; vidHolder.AddCallback(this); pDialog.Visibility = ViewStates.Visible; mediaController = new Android.Widget.MediaController(this); } catch (System.Exception ex) { } }