MedicionFragment

com.uva.rafael.tfg_goniometer.view.fragments

## Class MedicionFragment

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

- All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.view.View.OnCreateContextMenuListener, ViewFunctions.MedicionFunctions

      public class MedicionFragment
      extends android.app.Fragment
      implements ViewFunctions.MedicionFunctions

  Esta clase es el `Fragment` que se encarga de, utilizando el vector de rotacion del dispositivo, medir el angulo de desplazamiento desde la posicion inicial hasta la posicion final del mismo. Ademas, se encarga de iniciar el proceso para almacenar esa medicion (el desplazamiento del dispositivo) en el sistema.

  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:
    `Toolbar`, `AlertDialog`, `MedicionPresenter`

- - ### Nested Class Summary

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

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

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) MedicionPresenter` | `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
    `MedicionFragment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `displayResult(android.support.v7.app.AlertDialog dialog)` Metodo que simplemente muestra el `AlertDialog` que ha recibido como parametro.
    `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.medicion_fragment, en este caso).
    `void` | `onDestroy()` Perform any final cleanup before an activity is destroyed.
    `void` | `onPause()` Called as part of the fragment lifecycle when a fragment is going into the background, but has not (yet) been killed.
    `void` | `onResume()` Called as part of the fragment lifecycle when your fragment is ready to start interacting with the user.
    `void` | `setLecturaGoniometroText(java.lang.String lectura)` Metodo "setter" del parametro `lecturaGoniometro` de tipo `TextView`.
    `void` | `setTamañoGoniometro(int tamañoGoniometro)` Metodo que se encarga de fijar el tamaño del goniometro en funcion del ancho de la pantalla del dispositivo.
    `void` | `setTamañoReiniciar(int tamañoReiniciar)` Metodo que se encarga de fijar el tamaño del boton "Reiniciar" en funcion del ancho de la pantalla del dispositivo.
    `void` | `startAnimation(android.view.animation.Animation animation)` Metodo que inicia la animacion sobre la `View` que refleja graficamente el desplazamiento del dispositivo.

    - ### 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, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, 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
          MedicionPresenter presenter

  - ### Constructor Detail

    - #### MedicionFragment

          public MedicionFragment()

  - ### 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.medicion_fragment, en este caso). Ademas de eso, se encarga de notificar a `MedicionPresenter` cuando el usuario pulse sobre alguno de los botones que posee el layout.
      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.

    - #### onResume

          public void onResume()

      Called as part of the fragment lifecycle when your fragment is ready to start interacting with the user.
      Overrides:
        `onResume` in class `android.app.Fragment`

    - #### onPause

          public void onPause()

      Called as part of the fragment lifecycle when a fragment is going into the background, but has not (yet) been killed.
      Overrides:
        `onPause` in class `android.app.Fragment`

    - #### onDestroy

          public void onDestroy()

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

    - #### displayResult

          public void displayResult(android.support.v7.app.AlertDialog dialog)

      Metodo que simplemente muestra el `AlertDialog` que ha recibido como parametro.
      Specified by:
        `displayResult` in interface `ViewFunctions.MedicionFunctions`
      Parameters:
        `dialog` - `AlertDialog` a mostrar

    - #### setLecturaGoniometroText

          public void setLecturaGoniometroText(java.lang.String lectura)

      Metodo "setter" del parametro `lecturaGoniometro` de tipo `TextView`.
      Specified by:
        `setLecturaGoniometroText` in interface `ViewFunctions.MedicionFunctions`
      Parameters:
        `lectura` - Cadena de texto a mostrar en el `TextView`

    - #### startAnimation

          public void startAnimation(android.view.animation.Animation animation)

      Metodo que inicia la animacion sobre la `View` que refleja graficamente el desplazamiento del dispositivo.
      Specified by:
        `startAnimation` in interface `ViewFunctions.MedicionFunctions`
      Parameters:
        `animation` - `Animation` que se asignara al parametro `desplazamiento`.

    - #### setTamañoGoniometro

          public void setTamañoGoniometro(int tamañoGoniometro)

      Metodo que se encarga de fijar el tamaño del goniometro en funcion del ancho de la pantalla del dispositivo.
      Specified by:
        `setTamañoGoniometro` in interface `ViewFunctions.MedicionFunctions`
      Parameters:
        `tamañoGoniometro` - Tamaño final del goniometro

    - #### setTamañoReiniciar

          public void setTamañoReiniciar(int tamañoReiniciar)

      Metodo que se encarga de fijar el tamaño del boton "Reiniciar" en funcion del ancho de la pantalla del dispositivo.
      Specified by:
        `setTamañoReiniciar` in interface `ViewFunctions.MedicionFunctions`
      Parameters:
        `tamañoReiniciar` - Tamaño final del boton "Reiniciar"