示例#1
0
        protected override async void OnResume()
        {
            base.OnResume();

            gridView.ItemClick  += GridView_ItemClick;
            add_person.Click    += Add_Person_Click;
            done_and_save.Click += Done_And_Save_Click;

            try
            {
                if (Group != null)
                {
                    var editTextPersonGroupName = FindViewById <EditText> (Resource.Id.edit_person_group_name);
                    editTextPersonGroupName.Text = Group.Name;

                    if (!Group.PeopleLoaded)
                    {
                        await FaceClient.Shared.GetPeopleForGroup(Group);
                    }

                    await FaceClient.Shared.LoadFacesForAllGroupPeople(Group);

                    personGridViewAdapter = new PersonGridViewAdapter(Group, this);
                    gridView.Adapter      = personGridViewAdapter;

                    await CheckTrainingStatus();
                }
            }
            catch (Exception ex)
            {
                Log.Error($"Error getting people/faces for group :: {ex.Message}");
            }
        }
        protected override void OnResume()
        {
            base.OnResume();
            gridView.ItemClick  += GridView_ItemClick;
            add_person.Click    += Add_Person_Click;
            done_and_save.Click += Done_And_Save_Click;

            if (personGroupExists)
            {
                personGridViewAdapter = new PersonGridViewAdapter(this);
                gridView.Adapter      = personGridViewAdapter;
            }
        }
        private async void ExecuteAddPersonGroup(bool mAddPerson, string mPersonGroupId)
        {
            string result = string.Empty;

            mProgressDialog.Show();
            AddLog("Request: Creating person group " + mPersonGroupId);

            try
            {
                var faceClient = new FaceClient();
                mProgressDialog.SetMessage("Syncing with server to add person group...");
                SetInfo("Syncing with server to add person group...");
                await faceClient.CreatePersonGroup(
                    mPersonGroupId,
                    Application.Context.GetString(Resource.String.user_provided_person_group_name),
                    Application.Context.GetString(Resource.String.user_provided_person_group_description_data));

                result = mPersonGroupId;
            }
            catch (Java.Lang.Exception e)
            {
                result = null;
                AddLog(e.Message);
            }

            RunOnUiThread(() =>
            {
                mProgressDialog.Dismiss();

                if (result != null)
                {
                    AddLog("Response: Success. Person group " + result + " created");

                    personGroupExists     = true;
                    personGridViewAdapter = new PersonGridViewAdapter(this);
                    gridView.Adapter      = personGridViewAdapter;

                    SetInfo("Success. Group " + result + " created");

                    if (mAddPerson)
                    {
                        AddPerson();
                    }
                    else
                    {
                        DoneAndSave(false);
                    }
                }
            });
        }
示例#4
0
        async Task ExecuteAddPersonGroup(bool addPerson)
        {
            progressDialog.Show();
            AddLog("Request: Creating person group");

            try
            {
                progressDialog.SetMessage("Syncing with server to add person group...");
                SetInfo("Syncing with server to add person group...");

                var editTextPersonGroupName = FindViewById <EditText> (Resource.Id.edit_person_group_name);

                FaceState.Current.CurrentGroup = await FaceClient.Shared.CreatePersonGroup(editTextPersonGroupName.Text);

                AddLog("Response: Success. Person group " + Group.Id + " created");

                personGridViewAdapter = new PersonGridViewAdapter(Group, this);
                gridView.Adapter      = personGridViewAdapter;

                SetInfo("Success. Group " + Group.Id + " created");

                if (addPerson)
                {
                    AddPerson();
                }
                else
                {
                    await DoneAndSave(false);
                }
            }
            catch (Exception e)
            {
                AddLog(e.Message);
            }

            progressDialog.Dismiss();
        }
 public SetOnCheckedChangeListener(PersonGridViewAdapter adap, int pos)
 {
     this.adapter  = adap;
     this.position = pos;
 }