PacientesFragment

com.uva.rafael.tfg_goniometer.view.fragments

## Class PacientesFragment

- java.lang.Object
- - android.app.Fragment
  - - com.uva.rafael.tfg_goniometer.view.fragments.PacientesFragment

- All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.text.NoCopySpan, android.text.TextWatcher, android.view.View.OnCreateContextMenuListener

      public class PacientesFragment
      extends android.app.Fragment
      implements android.text.TextWatcher

  Esta clase es el `Fragment` que se encarga de mostrar el listado de pacientes que se encuentran almacenados en la Base de Datos, y acceder al perfil de cada uno de ellos pulsando sobre su nombre.

  Ademas, permite hacer un filtrado de este listado de pacientes en tiempo real (segun va introduciendo caracteres el usuario) en funcion del criterio de busqueda seleccionado en el `Spinner` (Nombre, ID o Tags) y de la informacion introducida en el `EditText`.

  Esta clase forma parte de la aplicacion TFG-Goniometer, desarrollada para el Trabajo de Fin de Grado - Grado en Ingenieria Informatica (Universidad de Valladolid)

  Version:
    1.0
  Author:
    Rafael Matamoros Luque
  See Also:
    `PacientesPresenter`, `TextWatcher`, `Spinner`, `Toolbar`, `RecyclerView`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.app.Fragment

      `android.app.Fragment.InstantiationException, android.app.Fragment.SavedState`

    - ### Nested classes/interfaces inherited from interface android.text.NoCopySpan

      `android.text.NoCopySpan.Concrete`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) PacientesPresenter` | `presenter`

    - ### Fields inherited from interface android.content.ComponentCallbacks2

      `TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PacientesFragment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterTextChanged(android.text.Editable s)` This method is called to notify you that, somewhere within 's', the text has been changed.
    `void` | `beforeTextChanged(java.lang.CharSequence charSequence, int start, int count, int after)` This method is called to notify you that, within 'charSequence', the 'count' characters beginning at 'start' are about to be replaced by new text with length 'after'.
    `android.view.View` | `onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)` Metodo llamado para instanciar el `Fragment` con su layout asociada (R.layout.pacientes_fragment, en este caso).
    `void` | `onDestroy()` Perform any final cleanup before an activity is destroyed.
    `void` | `onTextChanged(java.lang.CharSequence charSequence, int start, int before, int count)` This method is called to notify you that, within 'charSequence', the 'count' characters beginning at 'start' have just replaced old text that had length 'before'.

    - ### Methods inherited from class android.app.Fragment

      `dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDestroyView, onDetach, onHiddenChanged, onInflate, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onTrimMemory, onViewCreated, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, toString, unregisterForContextMenu`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### presenter

          @Inject
          PacientesPresenter presenter

  - ### Constructor Detail

    - #### PacientesFragment

          public PacientesFragment()

  - ### Method Detail

    - #### onCreateView

          @Nullable
          public android.view.View onCreateView(android.view.LayoutInflater inflater,
                                                          @Nullable
                                                          android.view.ViewGroup container,
                                                          android.os.Bundle savedInstanceState)

      Metodo llamado para instanciar el `Fragment` con su layout asociada (R.layout.pacientes_fragment, en este caso). Ademas de eso, se encarga de notificar a `PacientesPresenter` cuando el usuario pulsa sobre uno de los elementos del `RecyclerView`, o cuando pulsa sobre el boton para añadir un nuevo paciente en la Base de Datos.
      Overrides:
        `onCreateView` in class `android.app.Fragment`
      Parameters:
        `inflater` - The LayoutInflater object that can be used to inflate any view in the fragment.
        `container` - If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.
        `savedInstanceState` - If non-null, this fragment is being re-constructed from a previous saved state as given here. Return the View for the fragment's UI, or null.

    - #### beforeTextChanged

          public void beforeTextChanged(java.lang.CharSequence charSequence,
                                        int start,
                                        int count,
                                        int after)

      This method is called to notify you that, within 'charSequence', the 'count' characters beginning at 'start' are about to be replaced by new text with length 'after'.
      Specified by:
        `beforeTextChanged` in interface `android.text.TextWatcher`
      Parameters:
        `charSequence` - CharSequence
        `start` - int
        `count` - int
        `after` - int

    - #### onTextChanged

          public void onTextChanged(java.lang.CharSequence charSequence,
                                    int start,
                                    int before,
                                    int count)

      This method is called to notify you that, within 'charSequence', the 'count' characters beginning at 'start' have just replaced old text that had length 'before'. Ademas, se encarga de notificar a `PacientesPresenter` que el usuario ha introducido un caracter, para que actualice el adaptador del `RecyclerView` teniendo en cuenta la informacion que acaba de introducir el usuario en el `EditText` y el criterio de filtrado seleccionado en el `Spinner`.
      Specified by:
        `onTextChanged` in interface `android.text.TextWatcher`
      Parameters:
        `charSequence` - CharSequence
        `start` - int
        `before` - int
        `count` - int

    - #### afterTextChanged

          public void afterTextChanged(android.text.Editable s)

      This method is called to notify you that, somewhere within 's', the text has been changed.
      Specified by:
        `afterTextChanged` in interface `android.text.TextWatcher`
      Parameters:
        `s` - Editable

    - #### onDestroy

          public void onDestroy()

      Perform any final cleanup before an activity is destroyed.
      Overrides:
        `onDestroy` in class `android.app.Fragment`