Ejemplo n.º 1
0
        void OnItemClick(object sender, Event eventSelected)
        {
            EventDataHolder.getInstance().setData(eventSelected);
            var detailEventActivity = new Intent(this.Context, typeof(EventDetailActivity));

            StartActivity(detailEventActivity);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.mEvent    = EventDataHolder.getInstance().getData();
            showEditButton = mEvent.CanEdit;

            setUpViews();

            LoadActiveSectionsInView();

            loadFullEvent(this.mEvent);

            SetUpViewAccordingUserPermissions();
        }
Ejemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.mEvent = EventDataHolder.getInstance().getData();

            SetContentView(Resource.Layout.EventDetail);

            // Progress indicator
            progressOverlay = FindViewById <FrameLayout>(Resource.Id.progress_overlay);

            // Set toolbar and title
            global::Android.Support.V7.Widget.Toolbar toolbar = (global::Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.toolbar);
            toolbar.Title = "Evento #" + mEvent.NroEvento.ToString();

            // Add back button
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            //Button btnCreate = FindViewById<Button>(Resource.Id.btnEventCreate);
            //btnCreate.Click += BtnCreate_Click;

            //titleEditText = FindViewById<EditText>(Resource.Id.editTextEventTitle);
            //observationsEditText = FindViewById<EditText>(Resource.Id.editTextEventObservaciones);
            //dateEditText = FindViewById<EditText>(Resource.Id.editTextEventDate);
            //placeEditText = FindViewById<EditText>(Resource.Id.editTextEventPlace);
            //detailEditText = FindViewById<EditText>(Resource.Id.editTextEventDetail);
            //tagsEditText = FindViewById<EditText>(Resource.Id.editTextEventTags);
            //referenceEditText = FindViewById<EditText>(Resource.Id.editTextEventReference);
            //generalEditText = FindViewById<EditText>(Resource.Id.editTextEventObservaciones);

            // Date Field
            //dateEditText.Click += DateEditText_Click;

            // Type field
            //spinnerType = FindViewById<Spinner>(Resource.Id.spinnerType);
            //spinnerType.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs>(spinner_ItemSelectedType);
            //// Sector field
            //spinnerSectors = FindViewById<Spinner>(Resource.Id.spinnerSectors);
            //spinnerSectors.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs>(spinner_ItemSelectedSector);


            //// Load lists of values from server
            //GetEventTypesFromServer();

            //LoadActiveSectionsInView();
        }
Ejemplo n.º 4
0
        public async void loadFullEvent(Event eventSelected)
        {
            ShowProgress(true);
            // Get complete data of event selected from server
            await Task.Run(async() =>
            {
                try
                {
                    mEvent          = await AysaClient.Instance.GetEventById(eventSelected.Id);
                    mEvent.Archivos = await AysaClient.Instance.GetFilesOfEvent(mEvent.Id);
                }
                catch (HttpUnauthorized)
                {
                    RunOnUiThread(() =>
                    {
                        ShowErrorAlert("Sesión expirada.");
                    });
                }
                catch (Exception ex)
                {
                    RunOnUiThread(() =>
                    {
                        ShowErrorAlert(ex.Message);
                    });
                }
            });

            // Go to event detail
            showEventData();

            EventDataHolder.getInstance().setData(mEvent);
            if (mEvent.Archivos.Count > 0)
            {
                showEventDocuments();
            }
            ShowProgress(false);
            clickEditButton = true;
        }
Ejemplo n.º 5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            System.Diagnostics.Debug.WriteLine("EventsFragment.OnCreateView");
            View view = inflater.Inflate(Resource.Layout.EventsFragment, null);

            EventsFromServer = new List <Event>();

            mRecyclerView  = view.FindViewById <RecyclerView>(Resource.Id.EventsRecyclerView);
            mLayoutManager = new LinearLayoutManager(Activity);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            progressOverlay = view.FindViewById <FrameLayout>(Resource.Id.progress_overlay);

            addEventButton        = view.FindViewById <FloatingActionButton>(Resource.Id.floatingActionButton1);
            addEventButton.Click += delegate
            {
                EventDataHolder.getInstance().setData(null);
                var addEventActivity = new Intent(this.Context, typeof(AddEventActivity));
                StartActivityForResult(addEventActivity, ADD_EVENT_CODE);
            };

            // Search EditText
            EditText editSearch = view.FindViewById <EditText>(Resource.Id.editTextSearchEvent);

            editSearch.EditorAction += (object sender, TextView.EditorActionEventArgs e) =>
            {
                if (e.ActionId == ImeAction.Done)
                {
                    EditText et = sender as EditText;
                    SetAdapterWithFilterText(et.Text);
                }
                e.Handled = false;
            };

            return(view);
        }
Ejemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.mEvent = EventDataHolder.getInstance().getData();

            SetContentView(Resource.Layout.AddEvent);
            progressOverlay = FindViewById <FrameLayout>(Resource.Id.progress_overlay);

            Button btnCreate = FindViewById <Button>(Resource.Id.btnEventCreate);

            btnCreate.Click += BtnCreate_Click;

            global::Android.Support.V7.Widget.Toolbar toolbar = (global::Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.toolbar);

            if (mEvent != null)
            {
                //MODO EDITAR EVENTO
                toolbar.Title  = "Editar Evento #" + mEvent.NroEvento.ToString();
                btnCreate.Text = "Guardar";
                editMode       = true;
                FindViewById <LinearLayout>(Resource.Id.containerObservaciones).Visibility = ViewStates.Gone;
            }
            else
            {
                //MODO AGREGAR NUEVO EVENTO
                toolbar.SetTitle(Resource.String.addevent_title);
                attachedFiles = new List <AttachmentFile>();
            }

            // Add back button
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);


            titleEditText        = FindViewById <EditText>(Resource.Id.editTextEventTitle);
            observationsEditText = FindViewById <EditText>(Resource.Id.editTextEventObservaciones);
            dateEditText         = FindViewById <EditText>(Resource.Id.editTextEventDate);
            placeEditText        = FindViewById <EditText>(Resource.Id.editTextEventPlace);
            detailEditText       = FindViewById <EditText>(Resource.Id.editTextEventDetail);
            tagsEditText         = FindViewById <EditText>(Resource.Id.editTextEventTags);
            referenceEditText    = FindViewById <EditText>(Resource.Id.editTextEventReference);
            generalEditText      = FindViewById <EditText>(Resource.Id.editTextEventObservaciones);
            filesContainer       = FindViewById <LinearLayout>(Resource.Id.addEventFilesContainer);
            privateCheckBox      = FindViewById <CheckBox>(Resource.Id.confidentialCheckBox);
            //privateTextView = FindViewById<TextView>(Resource.Id.privateTextView);

            FindViewById <Button>(Resource.Id.btnUploadFiles).Click += UploadFile_Click;


            statusContainer            = FindViewById <View>(Resource.Id.status_container);
            statusContainer.Visibility = ViewStates.Visible;

            SetUpSegmentedControl();

            if (mEvent != null)
            {
                titleEditText.Text     = mEvent.Titulo;
                dateEditText.Text      = mEvent.Fecha.ToString(AysaConstants.FormatDate);
                placeEditText.Text     = mEvent.Lugar;
                detailEditText.Text    = mEvent.Detalle;
                tagsEditText.Text      = mEvent.Tag;
                referenceEditText.Text = mEvent.Referencia.ToString() == "0" ? "" : mEvent.Referencia.ToString();

                if (mEvent.Archivos != null)
                {
                    foreach (AttachmentFile file in mEvent.Archivos)
                    {
                        addAttachedFile(file.FileName);
                    }
                }

                attachedFiles.AddRange(mEvent.Archivos);
            }
            // Date Field
            dateEditText.Click += DateEditText_Click;

            // Type field
            spinnerType = FindViewById <Spinner>(Resource.Id.spinnerType);
            // Sector field
            spinnerSectors = FindViewById <Spinner>(Resource.Id.spinnerSectors);


            // Load lists of values from server
            GetEventTypesFromServer();

            LoadActiveSectionsInView();
        }