From 648f853e4657447e493d7371631138b9aac8c69c Mon Sep 17 00:00:00 2001 From: Martin Laiz Date: Wed, 5 Jun 2019 15:48:04 +0200 Subject: [PATCH 1/6] =?UTF-8?q?Cambiada=20la=20versi=C3=B3n=20a=20v0.3-SNA?= =?UTF-8?q?PSHOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 36d3af6..40b1bda 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId 'com.martinlaizg.geofind' minSdkVersion 24 targetSdkVersion 28 - versionCode 5 - versionName 'v0.2' + versionCode 6 + versionName 'v0.3-SNAPSHOT' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } From 1d14e49405ce849262fcac34440d7f7d49636564 Mon Sep 17 00:00:00 2001 From: Martin Laiz Date: Thu, 6 Jun 2019 19:58:52 +0200 Subject: [PATCH 2/6] =?UTF-8?q?A=C3=B1adido=20nuevos=20ajustes=20de=20Andr?= =?UTF-8?q?oid=20Studio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android-studio-settings/settings.zip | Bin 11870 -> 12063 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/android-studio-settings/settings.zip b/android-studio-settings/settings.zip index 6980d27b1e71d66318e932c1fae56c0742d89e20..96ab15ef3e8e0727f8e082b38089f8c4f6ed29f2 100644 GIT binary patch delta 3343 zcmY*b2{_bS8z29%Om<_;3}YG03^QXeCCx2yQOQn)$i7B)*)Q|S5>n`hN|v%@x!Jcu zQxuV#on%XjvUP1qTE5Zu-0$9dp65L0egE${?{?nz{C`undG-QkhHy?441qwvHe)(~ z9XF8)`h72`q7puCp^j8?#oR{T*mLK`k-3z!nRe+Ey^+&4C%TLMw6M=!-b%tWFX}&B z&tV-djlUZAS_*l+zdwg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@2XzHlRbpZ=DD)DaFal5>ueN&Xpso?R342iiwtURfO`prW^8#|&j{OGCLZKk3tvoJa(-m(B) zfjQRBs5>A;T8b8*)alWr%mv$;=ap@1ET6>4D|x>-jmKF|0V$g5$cY*FdV$BX#p7(${W;6J z<6WMMYW2<6F4`w;rDrFt9jv?fkN2zB!wkx?ewR8;?F$S{-b0VNn2pC*Zz2f}4ljo1 z;hLFaIV3lgxauCg8rT1d|9lWMw3o-p-8at$tZ67)*${%kR+zx>-cQNj#Z1ovHi2 zegW>jKK@Exj&1-;M1dfpD5MX8(A`)dNFcKa0)4_>NQ)JSvWd%6j9DNQ?5D-rKI6aU zOX~LlOcccqo)VO>Odn?U+hD+80{)h(d*2fLm4=5QzlH8VM*&5|She>G1+xlnC<| z#K9>N4>ZXOyh&P+03VnmiGW5D89K5JO&}fqojX=!T}XTP4lE(>h0Y4>zzAU;z$r(D z98uu3h!8N9BSJ|ikSHPs4w6Jcu^bQ7h61&6`=AvR*pM@U z^h9PmUHPji(f(ffom%3P|za zodJXG{!L^egamjij|G|v5-c;oR^bTCB*;}DfO?_?RD%WYh$JktgUtS0RDAz?zfcO0 z6eV`TYOE*+Yls3^8mf?bMYP@4>xQB>kU;kKXt E3lb?-rT_o{ From 8d3e8ce2acd201d17ff9372e422a9c85136a7fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Laiz=20G=C3=B3mez?= Date: Thu, 6 Jun 2019 20:06:01 +0200 Subject: [PATCH 3/6] =?UTF-8?q?A=C3=B1adios=20comentarios=20al=20servicio?= =?UTF-8?q?=20de=20tours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/access/api/service/TourService.java | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/TourService.java b/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/TourService.java index 9e905a4..daa33cc 100644 --- a/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/TourService.java +++ b/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/TourService.java @@ -9,7 +9,6 @@ import com.martinlaizg.geofind.data.access.api.service.exceptions.APIException; import com.martinlaizg.geofind.data.access.database.entities.Tour; -import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -31,6 +30,13 @@ public static TourService getInstance() { return tourService; } + /** + * Retrieve all tours form de server + * + * @return the list of tours + * @throws APIException + * server errors + */ public List getAllTours() throws APIException { Response> response; APIException apiException; @@ -41,13 +47,22 @@ public List getAllTours() throws APIException { } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "getTours: ", e); } throw apiException; } + /** + * Create de tour in the server + * + * @param tour + * the tour to create + * @return the created tour + * @throws APIException + * server errors + */ public Tour create(Tour tour) throws APIException { Response response; APIException apiException; @@ -58,13 +73,22 @@ public Tour create(Tour tour) throws APIException { } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "create: ", e); } throw apiException; } + /** + * Get a single tour by id + * + * @param id + * the id of the Tour to get + * @return the tour + * @throws APIException + * server errors + */ public Tour getTour(Integer id) throws APIException { Response response; APIException apiException; @@ -74,13 +98,22 @@ public Tour getTour(Integer id) throws APIException { return response.body(); } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "getTour: ", e); } throw apiException; } + /** + * Update the tour with id=tour.getId() with the data in tour + * + * @param tour + * the new data + * @return the new tour + * @throws APIException + * server errors + */ public Tour update(Tour tour) throws APIException { Response response; APIException apiException; @@ -90,7 +123,7 @@ public Tour update(Tour tour) throws APIException { return response.body(); } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "update: ", e); } From 4a4581f48a88ba47100e78a4c89aef0a1d1c7ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Laiz=20G=C3=B3mez?= Date: Thu, 6 Jun 2019 23:05:52 +0200 Subject: [PATCH 4/6] Arreglada carga de lista de tours --- .../data/access/api/service/UserService.java | 9 +- .../data/access/database/dao/TourDAO.java | 30 +++++ .../data/repository/TourRepository.java | 107 +++++++++++------- .../martinlaizg/geofind/utils/DateUtils.java | 2 +- .../views/fragment/list/TourListFragment.java | 25 +++- .../views/fragment/single/PlaceFragment.java | 8 +- .../views/fragment/single/TourFragment.java | 7 +- .../views/viewmodel/TourListViewModel.java | 11 +- .../views/viewmodel/TourViewModel.java | 25 ++-- .../main/res/layout/fragment_create_tour.xml | 14 +-- app/src/main/res/layout/fragment_creator.xml | 6 +- .../main/res/layout/fragment_edit_profile.xml | 20 ++-- app/src/main/res/layout/fragment_login.xml | 12 +- app/src/main/res/layout/fragment_place.xml | 8 +- .../main/res/layout/fragment_place_item.xml | 4 +- .../main/res/layout/fragment_play_compass.xml | 10 +- app/src/main/res/layout/fragment_play_map.xml | 18 +-- .../main/res/layout/fragment_play_therm.xml | 10 +- app/src/main/res/layout/fragment_registry.xml | 12 +- app/src/main/res/layout/fragment_tour.xml | 64 ++++++----- .../main/res/layout/fragment_tour_item.xml | 14 +-- .../main/res/layout/fragment_tour_list.xml | 26 +++-- app/src/main/res/layout/preferences_about.xml | 16 +-- app/src/main/res/layout/support_message.xml | 10 +- app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 26 files changed, 276 insertions(+), 194 deletions(-) diff --git a/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/UserService.java b/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/UserService.java index b8f9d3d..ac8c696 100644 --- a/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/UserService.java +++ b/app/src/main/java/com/martinlaizg/geofind/data/access/api/service/UserService.java @@ -10,7 +10,6 @@ import com.martinlaizg.geofind.data.access.api.service.exceptions.APIException; import com.martinlaizg.geofind.data.access.database.entities.User; -import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -53,7 +52,7 @@ public User login(Login login) throws APIException { return response.body(); } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "login: ", e); } @@ -69,7 +68,7 @@ public User registry(Login login) throws APIException { return response.body(); } apiException = ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "registry: ", e); } @@ -89,7 +88,7 @@ public boolean sendMessage(String title, String message) throws APIException { return true; } throw ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "registry: ", e); throw apiException; @@ -106,7 +105,7 @@ public User update(Login login, User user) throws APIException { return response.body(); } throw ErrorUtils.parseError(response); - } catch(IOException e) { + } catch(Exception e) { apiException = new APIException(ErrorType.NETWORK, e.getMessage()); Log.e(TAG, "registry: ", e); throw apiException; diff --git a/app/src/main/java/com/martinlaizg/geofind/data/access/database/dao/TourDAO.java b/app/src/main/java/com/martinlaizg/geofind/data/access/database/dao/TourDAO.java index 9f4310e..4450e0a 100644 --- a/app/src/main/java/com/martinlaizg/geofind/data/access/database/dao/TourDAO.java +++ b/app/src/main/java/com/martinlaizg/geofind/data/access/database/dao/TourDAO.java @@ -13,18 +13,48 @@ @Dao public interface TourDAO { + /** + * Insert a tour into the database + * + * @param tour + * the tour to be inserted + */ @Insert(onConflict = OnConflictStrategy.REPLACE) void insert(Tour tour); + /** + * Update a tour + * + * @param tour + * the tour to be updated + */ @Update void update(Tour tour); + /** + * Get a single tour by id + * + * @param tour_id + * the id of the tour to retrieve + * @return the tour + */ @Query("SELECT * FROM tours WHERE id = :tour_id") Tour getTour(Integer tour_id); + /** + * Delete a single tour by id + * + * @param tour_id + * the id of the tour to delete + */ @Query("DELETE FROM tours WHERE id = :tour_id") void delete(int tour_id); + /** + * Get all the tours + * + * @return the list of tours + */ @Query("SELECT * FROM tours") List getAll(); } diff --git a/app/src/main/java/com/martinlaizg/geofind/data/repository/TourRepository.java b/app/src/main/java/com/martinlaizg/geofind/data/repository/TourRepository.java index 1c5048c..e8bdb89 100644 --- a/app/src/main/java/com/martinlaizg/geofind/data/repository/TourRepository.java +++ b/app/src/main/java/com/martinlaizg/geofind/data/repository/TourRepository.java @@ -30,20 +30,17 @@ public class TourRepository { } /** - * Get the TourCreatorPlaces list from local and update each item from server + * Get the list of tours from local and removes the outdated ones + * At the same time refresh the local tours with the server * * @return the list of elements */ - public List getAllTours() { + public List getAllTours() throws APIException { List tours = tourDAO.getAll(); for(int i = 0; i < tours.size(); i++) { if(tours.get(i).isOutOfDate()) { - Tour newTour = refresh(tours.get(i)); - if(newTour == null) { - tours.remove(i); - i--; - } - tours.set(i, newTour); + tours.remove(i); + i--; } else { Tour t = tours.get(i); t.setCreator(userRepo.getUser(t.getCreator_id())); @@ -51,36 +48,43 @@ public List getAllTours() { tours.set(i, t); } } + + // If the list of tours is empty wait for refresh + if(tours.isEmpty()) { + tours = refreshTours(); + } else { + // start the refresh on new thread to do it in background + new Thread(() -> { + try { + refreshTours(); + } catch(APIException e) { + Log.e(TAG, "getAllTours: ", e); + } + }).start(); + } return tours; } /** - * Refresh the tour from the server and insert into the local database + * Load tours from server and insert into de local database * - * @param tour the tour to refresh, return null on error - * @return the tour refreshed + * @throws APIException + * the server exception */ - private Tour refresh(Tour tour) { - int tour_id = tour.getId(); - try { - tour = tourService.getTour(tour.getId()); - if(tour != null) { - insert(tour); - } else { - tourDAO.delete(tour_id); - } - return tour; - } catch(APIException e) { - Log.e(TAG, "refresh: ", e); + private List refreshTours() throws APIException { + List tours = tourService.getAllTours(); + for(Tour t : tours) { + insert(t); } - return null; + return tours; } /** * Insert a Tour to the local database * Insert the User creator and the list of Place recursively * - * @param tour Tour to insert + * @param tour + * Tour to insert */ public void insert(Tour tour) { if(tour != null) { @@ -95,13 +99,38 @@ public void insert(Tour tour) { } } + /** + * Refresh the tour from the server and insert into the local database + * + * @param tour + * the tour to refresh, return null on error + * @return the tour refreshed + */ + private Tour refresh(Tour tour) { + int tour_id = tour.getId(); + try { + tour = tourService.getTour(tour.getId()); + if(tour != null) { + insert(tour); + } else { + tourDAO.delete(tour_id); + } + return tour; + } catch(APIException e) { + Log.e(TAG, "refresh: ", e); + } + return null; + } + /** * Update the tour on server and local * If the tour is removed from server, return null * - * @param tour tour to update + * @param tour + * tour to update * @return tour updated or null if no exist on server - * @throws APIException exception from server + * @throws APIException + * exception from server */ public Tour update(Tour tour) throws APIException { int tour_id = tour.getId(); @@ -117,9 +146,11 @@ public Tour update(Tour tour) throws APIException { /** * Create a tour on server and insert into local database * - * @param tour tour to insert + * @param tour + * tour to insert * @return inserted tour - * @throws APIException the exception from API + * @throws APIException + * the exception from API */ public Tour create(Tour tour) throws APIException { tour = tourService.create(tour); @@ -130,9 +161,11 @@ public Tour create(Tour tour) throws APIException { /** * Get the tour with this id * - * @param id the tour id + * @param id + * the tour id * @return the tour - * @throws APIException the server exception + * @throws APIException + * the server exception */ public Tour getTour(Integer id) throws APIException { Tour t = tourDAO.getTour(id); @@ -145,16 +178,4 @@ public Tour getTour(Integer id) throws APIException { } return t; } - - /** - * Load tours from server and insert into de local database - * - * @throws APIException the server exception - */ - public void refreshTours() throws APIException { - List tours = tourService.getAllTours(); - for(Tour t : tours) { - insert(t); - } - } } diff --git a/app/src/main/java/com/martinlaizg/geofind/utils/DateUtils.java b/app/src/main/java/com/martinlaizg/geofind/utils/DateUtils.java index c059dbc..f1b9e40 100644 --- a/app/src/main/java/com/martinlaizg/geofind/utils/DateUtils.java +++ b/app/src/main/java/com/martinlaizg/geofind/utils/DateUtils.java @@ -6,7 +6,7 @@ public class DateUtils { public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - public static final long TIME_TO_EXPIRE = 5 * 60 * 1000; // 15min * 60s * 1000ms + public static final long TIME_TO_EXPIRE = 15 * 60 * 1000; // 15min * 60s * 1000ms public static boolean isDateExpire(Date fromDate) { return Calendar.getInstance().getTime().getTime() - fromDate.getTime() > TIME_TO_EXPIRE; diff --git a/app/src/main/java/com/martinlaizg/geofind/views/fragment/list/TourListFragment.java b/app/src/main/java/com/martinlaizg/geofind/views/fragment/list/TourListFragment.java index 8be80d3..9d07078 100644 --- a/app/src/main/java/com/martinlaizg/geofind/views/fragment/list/TourListFragment.java +++ b/app/src/main/java/com/martinlaizg/geofind/views/fragment/list/TourListFragment.java @@ -1,6 +1,7 @@ package com.martinlaizg.geofind.views.fragment.list; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -13,6 +14,7 @@ import androidx.navigation.Navigation; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.martinlaizg.geofind.R; @@ -35,6 +37,9 @@ public class TourListFragment @BindView(R.id.create_tour_button) FloatingActionButton create_tour_button; + @BindView(R.id.swipe_refresh) + SwipeRefreshLayout swipe_refresh; + private TourListViewModel viewModel; private TourListAdapter adapter; @@ -48,9 +53,22 @@ public View onCreateView(@NonNull final LayoutInflater inflater, tour_list.setLayoutManager(new LinearLayoutManager(requireActivity())); adapter = new TourListAdapter(); tour_list.setAdapter(adapter); + return view; + } + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { viewModel = ViewModelProviders.of(this).get(TourListViewModel.class); + swipe_refresh.setRefreshing(true); + refreshTours(); + create_tour_button + .setOnClickListener(Navigation.createNavigateOnClickListener(R.id.toCreator)); + swipe_refresh.setOnRefreshListener(this::refreshTours); + } + + private void refreshTours() { viewModel.getTours().observe(this, tours -> { + swipe_refresh.setRefreshing(false); if(tours != null) { adapter.setTours(tours); } else { @@ -60,14 +78,9 @@ public View onCreateView(@NonNull final LayoutInflater inflater, getResources().getString(R.string.network_error), Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(requireActivity(), error.getMessage(), Toast.LENGTH_SHORT) - .show(); + Log.e(TAG, "onCreateView: ", error); } } }); - viewModel.refresh(); - create_tour_button - .setOnClickListener(Navigation.createNavigateOnClickListener(R.id.toCreator)); - return view; } } diff --git a/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/PlaceFragment.java b/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/PlaceFragment.java index 3ee357c..86d8c6c 100644 --- a/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/PlaceFragment.java +++ b/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/PlaceFragment.java @@ -49,7 +49,8 @@ public class PlaceFragment @Nullable @Override - public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_place, container, false); ButterKnife.bind(this, view); place_map.onCreate(savedInstanceState); @@ -67,7 +68,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat super.onViewCreated(view, savedInstanceState); viewModel = ViewModelProviders.of(requireActivity()).get(TourViewModel.class); - viewModel.loadPlace(place_id).observe(this, this::setPlace); + viewModel.getPlace(place_id).observe(this, this::setPlace); } private void setPlace(Place place) { @@ -77,7 +78,8 @@ private void setPlace(Place place) { place_image.setImageResource(R.drawable.default_map_image); int number = place.getOrder() + 1; int total = viewModel.getPlaces().size(); - place_position.setText(getResources().getString(R.string.place_completeness, number, total)); + place_position + .setText(getResources().getString(R.string.place_completeness, number, total)); if(googleMap != null) { googleMap.addMarker(new MarkerOptions().position(place.getPosition())); CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(place.getPosition(), MAP_ZOOM); diff --git a/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/TourFragment.java b/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/TourFragment.java index 344f03d..aa7e556 100644 --- a/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/TourFragment.java +++ b/app/src/main/java/com/martinlaizg/geofind/views/fragment/single/TourFragment.java @@ -19,6 +19,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.button.MaterialButton; +import com.google.android.material.chip.Chip; import com.martinlaizg.geofind.R; import com.martinlaizg.geofind.config.Preferences; import com.martinlaizg.geofind.data.access.database.entities.Place; @@ -47,7 +48,7 @@ public class TourFragment @BindView(R.id.tour_description) TextView tour_description; @BindView(R.id.tour_creator) - TextView tour_creator; + Chip tour_creator; @BindView(R.id.tour_num_places) TextView tour_num_places; @BindView(R.id.edit_button) @@ -104,8 +105,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat .popBackStack(); } viewModel = ViewModelProviders.of(requireActivity()).get(TourViewModel.class); - viewModel.loadTour(tour_id, user.getId()).observe(requireActivity(), this::setTour); - + viewModel.getTour(tour_id, user.getId()).observe(this, this::setTour); } private void setTour(Tour tour) { @@ -133,7 +133,6 @@ private void setTour(Tour tour) { places.size())); play_button.setOnClickListener(v -> alert.show()); - setDifficultyDialog(tour.getId(), tour.getMin_level()); } } diff --git a/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourListViewModel.java b/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourListViewModel.java index 8927705..eb6cd74 100644 --- a/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourListViewModel.java +++ b/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourListViewModel.java @@ -1,7 +1,6 @@ package com.martinlaizg.geofind.views.viewmodel; import android.app.Application; -import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; @@ -29,19 +28,15 @@ public TourListViewModel(@NonNull Application application) { public MutableLiveData> getTours() { MutableLiveData> tours = new MutableLiveData<>(); - new Thread(() -> tours.postValue(tourRepo.getAllTours())).start(); - return tours; - } - - public void refresh() { new Thread(() -> { try { - tourRepo.refreshTours(); + tours.postValue(tourRepo.getAllTours()); } catch(APIException e) { - Log.e(TAG, "getTours: ", e); setError(e); + tours.postValue(null); } }).start(); + return tours; } public APIException getError() { diff --git a/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourViewModel.java b/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourViewModel.java index 859d9dd..3e21a29 100644 --- a/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourViewModel.java +++ b/app/src/main/java/com/martinlaizg/geofind/views/viewmodel/TourViewModel.java @@ -25,7 +25,7 @@ public class TourViewModel private APIException error; private Tour tour; - private Play userPlay; + private Play play; public TourViewModel(@NonNull Application application) { super(application); @@ -33,12 +33,12 @@ public TourViewModel(@NonNull Application application) { playRepo = RepositoryFactory.getPlayRepository(application); } - public MutableLiveData loadTour(int tour_id, int user_id) { + public MutableLiveData getTour(int tour_id, int user_id) { MutableLiveData m = new MutableLiveData<>(); new Thread(() -> { try { tour = tourRepo.getTour(tour_id); - userPlay = playRepo.getPlay(user_id, tour_id); + play = playRepo.getPlay(user_id, tour_id); } catch(APIException e) { setError(e); tour = null; @@ -48,7 +48,7 @@ public MutableLiveData loadTour(int tour_id, int user_id) { return m; } - public MutableLiveData loadPlace(int place_id) { + public MutableLiveData getPlace(int place_id) { MutableLiveData p = new MutableLiveData<>(); new Thread(() -> { for(Place place : tour.getPlaces()) { @@ -74,24 +74,31 @@ public List getPlaces() { } public List getCompletedPlaces() { - List places = new ArrayList<>(); - if(userPlay != null) places.addAll(userPlay.getPlaces()); - return places; + if(play != null) return play.getPlaces(); + return new ArrayList<>(); } public List getNoCompletedPlaces() { List places = tour.getPlaces(); - if(userPlay == null) { + if(play == null) { return places; } List noCompleted = new ArrayList<>(); for(Place tp : places) { boolean completed = false; - for(Place pp : userPlay.getPlaces()) { + for(Place pp : play.getPlaces()) { if(tp.getId() == pp.getId()) completed = true; } if(!completed) noCompleted.add(tp); } return noCompleted; } + + public MutableLiveData> getPlaces(int tour_id, int user_id) { + MutableLiveData> m = new MutableLiveData<>(); + new Thread(() -> { + m.postValue(new ArrayList<>()); + }).start(); + return m; + } } diff --git a/app/src/main/res/layout/fragment_create_tour.xml b/app/src/main/res/layout/fragment_create_tour.xml index 797b143..5a63544 100644 --- a/app/src/main/res/layout/fragment_create_tour.xml +++ b/app/src/main/res/layout/fragment_create_tour.xml @@ -7,7 +7,7 @@ @@ -46,7 +46,7 @@ app:hintEnabled="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_name_text"> + app:layout_constraintTop_toBottomOf="@id/new_name_text"> + app:layout_constraintTop_toBottomOf="@id/tour_name_layout"> + app:layout_constraintTop_toBottomOf="@id/tour_description_layout" /> + app:layout_constraintTop_toBottomOf="@id/tour_description_layout" /> + app:layout_constraintTop_toBottomOf="@id/select_difficulty_text" /> diff --git a/app/src/main/res/layout/fragment_creator.xml b/app/src/main/res/layout/fragment_creator.xml index ab235d1..bac2f8a 100644 --- a/app/src/main/res/layout/fragment_creator.xml +++ b/app/src/main/res/layout/fragment_creator.xml @@ -37,7 +37,7 @@ android:layout_toStartOf="@id/edit_button" android:text="@string/tour_without_name" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/edit_button" + app:layout_constraintTop_toTopOf="@id/edit_button" tools:text="@sample/tours.json/data/name[0]" /> + app:layout_constraintTop_toBottomOf="@id/card" /> @@ -90,7 +90,7 @@ app:errorEnabled="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/name_input"> + app:layout_constraintTop_toBottomOf="@id/name_input"> + app:layout_constraintTop_toBottomOf="@id/username_input"> + app:layout_constraintTop_toBottomOf="@id/email_input" /> @@ -160,7 +160,7 @@ android:text="@string/change_password" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/divider" /> + app:layout_constraintTop_toBottomOf="@id/divider" /> + app:layout_constraintTop_toBottomOf="@id/change_password_text"> + app:layout_constraintTop_toBottomOf="@id/new_password_input"> + app:layout_constraintTop_toBottomOf="@id/c_new_password_input" /> diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index 0094dea..7e23ecd 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -34,7 +34,7 @@ app:errorEnabled="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/image_register"> + app:layout_constraintTop_toBottomOf="@id/image_register"> + app:layout_constraintTop_toBottomOf="@id/password_input" /> + app:layout_constraintTop_toBottomOf="@id/login_button" /> + app:layout_constraintTop_toTopOf="@id/login_button" /> @@ -52,7 +52,7 @@ android:text="@string/place_completeness" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/place_description" /> + app:layout_constraintTop_toBottomOf="@id/place_description" /> + app:layout_constraintTop_toBottomOf="@id/place_image" /> diff --git a/app/src/main/res/layout/fragment_place_item.xml b/app/src/main/res/layout/fragment_place_item.xml index 554013a..25de27d 100644 --- a/app/src/main/res/layout/fragment_place_item.xml +++ b/app/src/main/res/layout/fragment_place_item.xml @@ -43,8 +43,8 @@ android:maxLines="3" android:minLines="1" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="@+id/place_name" - app:layout_constraintTop_toBottomOf="@+id/place_name" + app:layout_constraintStart_toStartOf="@id/place_name" + app:layout_constraintTop_toBottomOf="@id/place_name" tools:text="@sample/places.json/data/description" /> diff --git a/app/src/main/res/layout/fragment_play_compass.xml b/app/src/main/res/layout/fragment_play_compass.xml index d806b0d..34dbc11 100644 --- a/app/src/main/res/layout/fragment_play_compass.xml +++ b/app/src/main/res/layout/fragment_play_compass.xml @@ -30,8 +30,8 @@ android:ellipsize="end" android:maxLines="4" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="@+id/place_name" - app:layout_constraintTop_toBottomOf="@+id/place_name" + app:layout_constraintStart_toStartOf="@id/place_name" + app:layout_constraintTop_toBottomOf="@id/place_name" tools:text="@sample/places.json/data/description[0]" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_play_map.xml b/app/src/main/res/layout/fragment_play_map.xml index 74a2232..18b7752 100644 --- a/app/src/main/res/layout/fragment_play_map.xml +++ b/app/src/main/res/layout/fragment_play_map.xml @@ -29,8 +29,8 @@ android:ellipsize="end" android:maxLines="4" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="@+id/place_name" - app:layout_constraintTop_toBottomOf="@+id/place_name" + app:layout_constraintStart_toStartOf="@id/place_name" + app:layout_constraintTop_toBottomOf="@id/place_name" tools:text="@sample/places.json/data/description[0]" /> + app:layout_constraintTop_toBottomOf="@id/place_complete" /> + app:layout_constraintStart_toStartOf="@id/map_view" + app:layout_constraintTop_toTopOf="@id/map_view" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_play_therm.xml b/app/src/main/res/layout/fragment_play_therm.xml index ee76c21..ac05480 100644 --- a/app/src/main/res/layout/fragment_play_therm.xml +++ b/app/src/main/res/layout/fragment_play_therm.xml @@ -29,8 +29,8 @@ android:ellipsize="end" android:maxLines="4" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="@+id/place_name" - app:layout_constraintTop_toBottomOf="@+id/place_name" + app:layout_constraintStart_toStartOf="@id/place_name" + app:layout_constraintTop_toBottomOf="@id/place_name" tools:text="@sample/places.json/data/description[0]" /> + app:layout_constraintTop_toBottomOf="@id/place_distance" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_registry.xml b/app/src/main/res/layout/fragment_registry.xml index d6be95d..2de6043 100644 --- a/app/src/main/res/layout/fragment_registry.xml +++ b/app/src/main/res/layout/fragment_registry.xml @@ -35,7 +35,7 @@ app:errorEnabled="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/image_register"> + app:layout_constraintTop_toBottomOf="@id/image_register"> + app:layout_constraintEnd_toEndOf="@id/c_password_input" + app:layout_constraintStart_toStartOf="@id/c_password_input" + app:layout_constraintTop_toBottomOf="@id/c_password_input" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_tour.xml b/app/src/main/res/layout/fragment_tour.xml index 2c22269..01bcbe7 100644 --- a/app/src/main/res/layout/fragment_tour.xml +++ b/app/src/main/res/layout/fragment_tour.xml @@ -27,7 +27,7 @@ android:ellipsize="end" android:maxLines="1" android:textAppearance="?android:attr/textAppearanceLarge" - app:layout_constraintEnd_toStartOf="@+id/edit_button" + app:layout_constraintEnd_toStartOf="@id/edit_button" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="@sample/tours.json/data/name" /> @@ -36,7 +36,7 @@ android:id="@+id/edit_button" android:layout_width="wrap_content" android:layout_height="0dp" - android:layout_marginEnd="8dp" + android:layout_marginEnd="16dp" android:text="@string/edit" android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" @@ -47,51 +47,57 @@ android:id="@+id/tour_description" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginStart="16dp" android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" android:ellipsize="end" android:maxLines="5" android:minLines="1" android:textAppearance="?android:attr/textAppearanceMedium" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tour_name" + app:layout_constraintEnd_toEndOf="@+id/edit_button" + app:layout_constraintStart_toStartOf="@+id/tour_name" + app:layout_constraintTop_toBottomOf="@id/tour_name" tools:text="@sample/tours.json/data/description" /> - + android:layout_marginTop="8dp" + app:chipIcon="@drawable/ic_user_black" + app:layout_constraintStart_toStartOf="@+id/tour_description" + app:layout_constraintTop_toBottomOf="@id/tour_description" + tools:text="@sample/user.json/data/username" /> + + @@ -112,7 +118,7 @@ diff --git a/app/src/main/res/layout/fragment_tour_item.xml b/app/src/main/res/layout/fragment_tour_item.xml index ec3f784..e844dd4 100644 --- a/app/src/main/res/layout/fragment_tour_item.xml +++ b/app/src/main/res/layout/fragment_tour_item.xml @@ -50,7 +50,7 @@ android:textAppearance="?android:attr/textAppearanceLarge" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/map_image" + app:layout_constraintTop_toBottomOf="@id/map_image" tools:text="@sample/tours.json/data/name" /> @@ -84,9 +84,9 @@ android:minLines="1" android:textAppearance="?android:attr/textAppearanceMedium" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/tour_creator" - app:layout_constraintStart_toStartOf="@+id/tour_name" - app:layout_constraintTop_toBottomOf="@+id/tour_creator" + app:layout_constraintEnd_toEndOf="@id/tour_creator" + app:layout_constraintStart_toStartOf="@id/tour_name" + app:layout_constraintTop_toBottomOf="@id/tour_creator" tools:text="@sample/tours.json/data/description" /> diff --git a/app/src/main/res/layout/fragment_tour_list.xml b/app/src/main/res/layout/fragment_tour_list.xml index cf1ba99..7c93a48 100644 --- a/app/src/main/res/layout/fragment_tour_list.xml +++ b/app/src/main/res/layout/fragment_tour_list.xml @@ -5,16 +5,23 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + android:layout_height="match_parent"> + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/preferences_about.xml b/app/src/main/res/layout/preferences_about.xml index 69b4dd4..1162076 100644 --- a/app/src/main/res/layout/preferences_about.xml +++ b/app/src/main/res/layout/preferences_about.xml @@ -25,9 +25,9 @@ android:layout_marginStart="4dp" android:layout_marginEnd="32dp" android:text="@string/developer" - app:layout_constraintBaseline_toBaselineOf="@+id/app_developed" + app:layout_constraintBaseline_toBaselineOf="@id/app_developed" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/app_developed" /> + app:layout_constraintStart_toEndOf="@id/app_developed" /> + app:layout_constraintStart_toStartOf="@id/app_name" + app:layout_constraintTop_toBottomOf="@id/app_developed" /> + app:layout_constraintStart_toStartOf="@id/app_description" + app:layout_constraintTop_toBottomOf="@id/app_description" /> + app:layout_constraintStart_toStartOf="@id/app_name" + app:layout_constraintTop_toBottomOf="@id/app_name" /> \ No newline at end of file diff --git a/app/src/main/res/layout/support_message.xml b/app/src/main/res/layout/support_message.xml index 7420b70..9c99d3e 100644 --- a/app/src/main/res/layout/support_message.xml +++ b/app/src/main/res/layout/support_message.xml @@ -13,7 +13,7 @@ android:layout_marginEnd="8dp" android:text="@string/message_to_support" android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5" - app:layout_constraintBottom_toTopOf="@+id/title_layout" + app:layout_constraintBottom_toTopOf="@id/title_layout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -28,10 +28,10 @@ android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="1dp" - app:layout_constraintBottom_toTopOf="@+id/message_text_layout" + app:layout_constraintBottom_toTopOf="@id/message_text_layout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/dialog_title"> + app:layout_constraintTop_toBottomOf="@id/dialog_title"> + app:layout_constraintTop_toBottomOf="@id/title_layout"> Profile Old password Work in progress + Loading \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0910b9b..186368e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -100,4 +100,5 @@ Profile Old password Work in progress + Loading From 43e8e26b28b1627797adc8930d8f67c3d1ca5cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Laiz=20G=C3=B3mez?= Date: Thu, 6 Jun 2019 23:18:23 +0200 Subject: [PATCH 5/6] =?UTF-8?q?A=C3=B1adida=20traducci=C3=B3n=20faltante?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../martinlaizg/geofind/data/access/api/RetrofitInstance.java | 4 ++-- app/src/main/res/values-es/strings.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/martinlaizg/geofind/data/access/api/RetrofitInstance.java b/app/src/main/java/com/martinlaizg/geofind/data/access/api/RetrofitInstance.java index 8d6f11c..c1ad6c0 100644 --- a/app/src/main/java/com/martinlaizg/geofind/data/access/api/RetrofitInstance.java +++ b/app/src/main/java/com/martinlaizg/geofind/data/access/api/RetrofitInstance.java @@ -9,8 +9,8 @@ public class RetrofitInstance { - // private static final String BASE_URL = "https://geofind1.herokuapp.com/api/"; - private static final String BASE_URL = "http://192.168.1.44:8000/api/"; + private static final String BASE_URL = "https://geofind1.herokuapp.com/api/"; + // private static final String BASE_URL = "http://192.168.1.44:8000/api/"; private static Retrofit retrofitInstance; public static RestClient getRestClient() { diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 46d2aa5..722f1b1 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -90,4 +90,5 @@ Antigua contraseƱa Perfil En progreso + Cargando \ No newline at end of file From 64b3a9eedab49b95e7e8c5007242d62b12a24d07 Mon Sep 17 00:00:00 2001 From: Martin Laiz Date: Sat, 8 Jun 2019 16:44:03 +0200 Subject: [PATCH 6/6] =?UTF-8?q?Versi=C3=B3n=20v.0.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 40b1bda..d2c1f4c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,7 +18,7 @@ android { minSdkVersion 24 targetSdkVersion 28 versionCode 6 - versionName 'v0.3-SNAPSHOT' + versionName 'v0.2.1' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' }