Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PULL REQUEST - Actividad1 #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

herrerameri
Copy link

@herrerameri herrerameri commented Oct 26, 2016

Entrega de actividad 1
¡Inicio de TODOMAN!

todoman
captura_celular
captura_tablet

…manera diferente en dispositivos con menor y mayor tamaño de pantalla.

- DatePickerFragment para selección de una fecha.
- Ícono de la aplicación
- Merge de repositorio de cristiantanas
# Conflicts:
#	todoman/src/main/AndroidManifest.xml
#	todoman/src/main/java/org/uab/dedam/todoman/HomeActivity.java
#	todoman/src/main/java/org/uab/dedam/todoman/NewTaskActivity.java
#	todoman/src/main/res/layout/activity_home.xml
#	todoman/src/main/res/layout/activity_newtask.xml
#	todoman/src/main/res/values/strings.xml
@cristiantanas
Copy link
Owner

¡Muy buen trabajo! Sólo algunos comentarios:

  • En el método onCreateView de los Fragments deberíamos devolver simplemente la vista. Cualquier otra acción debería ir en algunos de los otros métodos, como por ejemplo onActivityCreated.
  • Relacionado con esto, en la clase FragmentNewTask habría que asegurarse que la Activity realmente implementa la interface DatePickerFragment.OnDateSetCallback:
((DatePickerFragment.OnDateSetCallback)getActivity()).selectDate();

Seria mejor definir una interfaz similar a como se implementa OnDateSetCallback del DatePickerFragment y siempre que hay que comunicar alguna cosa a la Activity, la comunicación pasaría a través de esta interface.

  • Habría que controlar siempre que las Activities implementen las interfaces que definimos:
public void onAttach(Activity activity) {
     super.onAttach(activity);
     try {
          this.listener = (OnDateSetCallback) activity;
     } catch(ClassCastException exception) {
          throw new ClassCastException("The activity does not implement the interface.");
     }
}
  • En la HomeActivity no acabo de entender porque la doble comprobación existsFrgNewTask. Si llegamos al evento onClick del FloatingActionButton será porque el fragment no existe, no?

- Catchear la posible excepción de ClassCastException para Activities que interactúan con DatePickerFragment
- Quitar código que no sea retorno de layout en onCreateView de fragmentos
- Corrijo error condicional duplicado en HomeActivity.java
- Corrijo a inglés "Lista de tareas" por "TASKS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants