diff --git a/android-studio-settings/settings.zip b/android-studio-settings/settings.zip index 6980d27..96ab15e 100644 Binary files a/android-studio-settings/settings.zip and b/android-studio-settings/settings.zip differ diff --git a/app/build.gradle b/app/build.gradle index 36d3af6..d2c1f4c 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.2.1' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } 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/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); } 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-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 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