Exemple #1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Evidences);

            if (Intent != null)
            {
                Token    = Intent.GetStringExtra("Token");
                FullName = Intent.GetStringExtra("FullName");
            }
            var ServiceClient = new SAL.ServiceClient();

            Evidences = (EvidencesFragment)this.FragmentManager.FindFragmentByTag("Evidences");
            if (Evidences == null)
            {
                Evidences           = new EvidencesFragment();
                Evidences.Evidences = await ServiceClient.GetEvidencesAsync(Token);

                var FragmentTransaction = this.FragmentManager.BeginTransaction();
                FragmentTransaction.Add(Evidences, "Evidences");
                FragmentTransaction.Commit();
            }

            var FullNameText = FindViewById <TextView>(Resource.Id.textViewName);

            FullNameText.Text = FullName;
            var ListEvidences = FindViewById <ListView>(Resource.Id.listViewEvidences);

            ListEvidences.Adapter = new CustomAdapters.EvidencesAdapter(
                this, Evidences.Evidences, Resource.Layout.ListItem, Resource.Id.textViewTitle,
                Resource.Id.textViewStatus);
            ListEvidences.ItemClick += ListEvidencesLoad;
        }
Exemple #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Datos);

            if (Intent != null)
            {
                Email = Intent.GetStringExtra("email");
                Pass  = Intent.GetStringExtra("pass");
            }

            lvEvidencia = FindViewById <ListView>(Resource.Id.lvEvidencia);
            var txName = FindViewById <TextView>(Resource.Id.txName);

            txName.Text = Pass;

            lvEvidencia.ItemClick += (sender, e) =>
            {
                var ActivityIntent =
                    new Intent(this, typeof(EvidencesDetail));
                ActivityIntent.PutExtra("Email", Email);
                ActivityIntent.PutExtra("Pass", Pass);
                ActivityIntent.PutExtra("EvidenceID", evidencias.Evidences[e.Position].EvidenceID);
                ActivityIntent.PutExtra("Title", evidencias.Evidences[e.Position].Title);
                ActivityIntent.PutExtra("Status", evidencias.Evidences[e.Position].Status);
                StartActivity(ActivityIntent);
            };

            evidencias = new EvidencesFragment();
            if (evidencias.Evidences == null)
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Please...");
                progress.SetCancelable(false);
                progress.Show();

                var fragmentTransaction = this.FragmentManager.BeginTransaction();
                fragmentTransaction.Add(evidencias, "Evidences");
                fragmentTransaction.Commit();

                GetEvidences();
                progress.Cancel();
            }
            else
            {
                lvEvidencia.Adapter = evidencias.EvidencesAdapter;
            }
        }
Exemple #3
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Evidence);
            //Get String Extra
            string Token    = Intent.GetStringExtra("Token");
            string UserName = Intent.GetStringExtra("UserName");
            //Set Txt User Name value UserName
            var TextUserName = FindViewById <TextView>(Resource.Id.TextViewUserName);

            TextUserName.Text = UserName;

            Data = (EvidencesFragment)this.FragmentManager.FindFragmentByTag("Data");
            if (Data == null)
            {
                Data = new EvidencesFragment();
                ServiceClient   ServiceClient = new ServiceClient();
                List <Evidence> EvidencesList = await ServiceClient.GetEvidencesAsync(Token);

                var FragmentTransaction = this.FragmentManager.BeginTransaction();
                Data.EvidencesList = EvidencesList;
                FragmentTransaction.Add(Data, "Data");
                FragmentTransaction.Commit();
            }
            var ListEvidences = FindViewById <ListView>(Resource.Id.ListViewEvidences);

            ListEvidences.Adapter = new EvidencesAdapter(this, Data.EvidencesList, Resource.Layout.EvidenceItem, Resource.Id.TextViewTitleEvidence, Resource.Id.TextViewStatusEvidence);

            ListEvidences.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                EvidencesAdapter AdapterEv    = (EvidencesAdapter)ListEvidences.Adapter;
                Evidence         SelectedItem = AdapterEv[e.Position];
                var EvidenceDetailIntent      = new Android.Content.Intent(this, typeof(EvidenceDetailActivity));
                EvidenceDetailIntent.PutExtra("EvidenceID", SelectedItem.EvidenceID);
                EvidenceDetailIntent.PutExtra("EvidenceTitle", SelectedItem.Title);
                EvidenceDetailIntent.PutExtra("EvidenceStatus", SelectedItem.Status);
                EvidenceDetailIntent.PutExtra("UserName", UserName);
                EvidenceDetailIntent.PutExtra("Token", Token);
                StartActivity(EvidenceDetailIntent);
            };
        }