mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Replaced Mapbox with osmdroid (Nearby activity) (#5403)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission * Empty commit * Fixed loop issue * Created docs for earlier commits * Fixed javadoc * Fixed spaces * Added added basic features to OSM Maps * Added search location feature * Added filter to Open Street Maps * Fixed chipGroup in Open Street Maps * Removed mapBox code * Removed mapBox's code * Reformat code * Reformatted code * Removed rotation feature to map * Removed rotation files and Fixed Marker click problem * Ignored failing tests
This commit is contained in:
parent
3d525d4eb3
commit
5df18fb4a6
10 changed files with 1239 additions and 1038 deletions
|
|
@ -1,57 +1,84 @@
|
|||
package fr.free.nrw.commons.nearby.contract;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
|
||||
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
|
||||
import java.util.List;
|
||||
|
||||
import fr.free.nrw.commons.kvstore.JsonKvStore;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
|
||||
import fr.free.nrw.commons.nearby.Label;
|
||||
import fr.free.nrw.commons.nearby.NearbyBaseMarker;
|
||||
import fr.free.nrw.commons.nearby.Place;
|
||||
import java.util.List;
|
||||
|
||||
public interface NearbyParentFragmentContract {
|
||||
|
||||
interface View {
|
||||
|
||||
boolean isNetworkConnectionEstablished();
|
||||
|
||||
void listOptionMenuItemClicked();
|
||||
|
||||
void populatePlaces(LatLng curlatLng);
|
||||
|
||||
void populatePlaces(LatLng curlatLng, String customQuery);
|
||||
|
||||
boolean isListBottomSheetExpanded();
|
||||
|
||||
void checkPermissionsAndPerformAction();
|
||||
|
||||
void displayLoginSkippedWarning();
|
||||
|
||||
void setFABPlusAction(android.view.View.OnClickListener onClickListener);
|
||||
|
||||
void setFABRecenterAction(android.view.View.OnClickListener onClickListener);
|
||||
|
||||
void animateFABs();
|
||||
|
||||
void recenterMap(LatLng curLatLng);
|
||||
|
||||
void showLocationOffDialog();
|
||||
|
||||
void openLocationSettings();
|
||||
|
||||
void hideBottomSheet();
|
||||
|
||||
void hideBottomDetailsSheet();
|
||||
|
||||
void displayBottomSheetWithInfo(Marker marker);
|
||||
void addOnCameraMoveListener();
|
||||
|
||||
void addSearchThisAreaButtonAction();
|
||||
|
||||
void setSearchThisAreaButtonVisibility(boolean isVisible);
|
||||
|
||||
void setProgressBarVisibility(boolean isVisible);
|
||||
|
||||
void setTabItemContributions();
|
||||
|
||||
boolean isDetailsBottomSheetVisible();
|
||||
|
||||
void setBottomSheetDetailsSmaller();
|
||||
boolean isSearchThisAreaButtonVisible();
|
||||
|
||||
void setRecyclerViewAdapterAllSelected();
|
||||
|
||||
void setRecyclerViewAdapterItemsGreyedOut();
|
||||
|
||||
void setCheckBoxAction();
|
||||
|
||||
void setCheckBoxState(int state);
|
||||
|
||||
void setFilterState();
|
||||
|
||||
void disableFABRecenter();
|
||||
|
||||
void enableFABRecenter();
|
||||
|
||||
void addCurrentLocationMarker(LatLng curLatLng);
|
||||
|
||||
void updateMapToTrackPosition(LatLng curLatLng);
|
||||
|
||||
void clearAllMarkers();
|
||||
|
||||
Context getContext();
|
||||
|
||||
void updateMapMarkers(List<NearbyBaseMarker> nearbyBaseMarkers, Marker selectedMarker);
|
||||
|
|
@ -60,7 +87,9 @@ public interface NearbyParentFragmentContract {
|
|||
|
||||
void displayAllMarkers();
|
||||
|
||||
void filterMarkersByLabels(List<Label> selectedLabels, boolean existsSelected, boolean needPhotoSelected, boolean wlmSelected, boolean filterForPlaceState, boolean filterForAllNoneType);
|
||||
void filterMarkersByLabels(List<Label> selectedLabels, boolean existsSelected,
|
||||
boolean needPhotoSelected, boolean wlmSelected, boolean filterForPlaceState,
|
||||
boolean filterForAllNoneType);
|
||||
|
||||
LatLng getCameraTarget();
|
||||
|
||||
|
|
@ -70,10 +99,15 @@ public interface NearbyParentFragmentContract {
|
|||
|
||||
LatLng getLastLocation();
|
||||
|
||||
LatLng getLastMapFocus();
|
||||
|
||||
LatLng getMapCenter();
|
||||
|
||||
LatLng getMapFocus();
|
||||
|
||||
com.mapbox.mapboxsdk.geometry.LatLng getLastFocusLocation();
|
||||
|
||||
boolean isCurrentLocationMarkerVisible();
|
||||
void setProjectorLatLngBounds();
|
||||
|
||||
boolean isAdvancedQueryFragmentVisible();
|
||||
|
||||
|
|
@ -83,11 +117,14 @@ public interface NearbyParentFragmentContract {
|
|||
}
|
||||
|
||||
interface NearbyListView {
|
||||
|
||||
void updateListFragment(List<Place> placeList);
|
||||
}
|
||||
|
||||
interface UserActions {
|
||||
|
||||
void updateMapAndList(LocationChangeType locationChangeType);
|
||||
|
||||
void lockUnlockNearby(boolean isNearbyLocked);
|
||||
|
||||
void attachView(View view);
|
||||
|
|
@ -95,14 +132,20 @@ public interface NearbyParentFragmentContract {
|
|||
void detachView();
|
||||
|
||||
void setActionListeners(JsonKvStore applicationKvStore);
|
||||
|
||||
void removeNearbyPreferences(JsonKvStore applicationKvStore);
|
||||
|
||||
boolean backButtonClicked();
|
||||
|
||||
void onCameraMove(com.mapbox.mapboxsdk.geometry.LatLng latLng);
|
||||
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState, boolean filterForAllNoneType);
|
||||
|
||||
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState,
|
||||
boolean filterForAllNoneType);
|
||||
|
||||
void updateMapMarkersToController(List<NearbyBaseMarker> nearbyBaseMarkers);
|
||||
|
||||
void searchViewGainedFocus();
|
||||
|
||||
void setCheckboxUnknown();
|
||||
|
||||
void setAdvancedQuery(String query);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +1,5 @@
|
|||
package fr.free.nrw.commons.nearby.presenter;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
|
||||
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
||||
import fr.free.nrw.commons.kvstore.JsonKvStore;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.location.LocationUpdateListener;
|
||||
import fr.free.nrw.commons.nearby.CheckBoxTriStates;
|
||||
import fr.free.nrw.commons.nearby.Label;
|
||||
import fr.free.nrw.commons.nearby.MarkerPlaceGroup;
|
||||
import fr.free.nrw.commons.nearby.NearbyBaseMarker;
|
||||
import fr.free.nrw.commons.nearby.NearbyController;
|
||||
import fr.free.nrw.commons.nearby.NearbyFilterState;
|
||||
import fr.free.nrw.commons.nearby.contract.NearbyParentFragmentContract;
|
||||
import fr.free.nrw.commons.utils.LocationUtils;
|
||||
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.CUSTOM_QUERY;
|
||||
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.LOCATION_SIGNIFICANTLY_CHANGED;
|
||||
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.LOCATION_SLIGHTLY_CHANGED;
|
||||
|
|
@ -36,10 +10,34 @@ import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNCHECKED;
|
|||
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNKNOWN;
|
||||
import static fr.free.nrw.commons.wikidata.WikidataConstants.PLACE_OBJECT;
|
||||
|
||||
import android.location.Location;
|
||||
import android.view.View;
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
||||
import fr.free.nrw.commons.kvstore.JsonKvStore;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
|
||||
import fr.free.nrw.commons.location.LocationUpdateListener;
|
||||
import fr.free.nrw.commons.nearby.CheckBoxTriStates;
|
||||
import fr.free.nrw.commons.nearby.Label;
|
||||
import fr.free.nrw.commons.nearby.MarkerPlaceGroup;
|
||||
import fr.free.nrw.commons.nearby.NearbyBaseMarker;
|
||||
import fr.free.nrw.commons.nearby.NearbyController;
|
||||
import fr.free.nrw.commons.nearby.NearbyFilterState;
|
||||
import fr.free.nrw.commons.nearby.contract.NearbyParentFragmentContract;
|
||||
import fr.free.nrw.commons.utils.LocationUtils;
|
||||
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class NearbyParentFragmentPresenter
|
||||
implements NearbyParentFragmentContract.UserActions,
|
||||
WikidataEditListener.WikidataP18EditListener,
|
||||
LocationUpdateListener {
|
||||
implements NearbyParentFragmentContract.UserActions,
|
||||
WikidataEditListener.WikidataP18EditListener,
|
||||
LocationUpdateListener {
|
||||
|
||||
private boolean isNearbyLocked;
|
||||
private LatLng curLatLng;
|
||||
|
|
@ -51,40 +49,40 @@ public class NearbyParentFragmentPresenter
|
|||
private @Nullable String customQuery;
|
||||
|
||||
private static final NearbyParentFragmentContract.View DUMMY = (NearbyParentFragmentContract.View) Proxy.newProxyInstance(
|
||||
NearbyParentFragmentContract.View.class.getClassLoader(),
|
||||
new Class[]{NearbyParentFragmentContract.View.class}, (proxy, method, args) -> {
|
||||
if (method.getName().equals("onMyEvent")) {
|
||||
return null;
|
||||
} else if (String.class == method.getReturnType()) {
|
||||
return "";
|
||||
} else if (Integer.class == method.getReturnType()) {
|
||||
return Integer.valueOf(0);
|
||||
} else if (int.class == method.getReturnType()) {
|
||||
return 0;
|
||||
} else if (Boolean.class == method.getReturnType()) {
|
||||
return Boolean.FALSE;
|
||||
} else if (boolean.class == method.getReturnType()) {
|
||||
return false;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
NearbyParentFragmentContract.View.class.getClassLoader(),
|
||||
new Class[]{NearbyParentFragmentContract.View.class}, (proxy, method, args) -> {
|
||||
if (method.getName().equals("onMyEvent")) {
|
||||
return null;
|
||||
} else if (String.class == method.getReturnType()) {
|
||||
return "";
|
||||
} else if (Integer.class == method.getReturnType()) {
|
||||
return Integer.valueOf(0);
|
||||
} else if (int.class == method.getReturnType()) {
|
||||
return 0;
|
||||
} else if (Boolean.class == method.getReturnType()) {
|
||||
return Boolean.FALSE;
|
||||
} else if (boolean.class == method.getReturnType()) {
|
||||
return false;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
);
|
||||
private NearbyParentFragmentContract.View nearbyParentFragmentView = DUMMY;
|
||||
|
||||
|
||||
public NearbyParentFragmentPresenter(BookmarkLocationsDao bookmarkLocationDao){
|
||||
this.bookmarkLocationDao=bookmarkLocationDao;
|
||||
public NearbyParentFragmentPresenter(BookmarkLocationsDao bookmarkLocationDao) {
|
||||
this.bookmarkLocationDao = bookmarkLocationDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachView(NearbyParentFragmentContract.View view){
|
||||
this.nearbyParentFragmentView=view;
|
||||
public void attachView(NearbyParentFragmentContract.View view) {
|
||||
this.nearbyParentFragmentView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detachView(){
|
||||
this.nearbyParentFragmentView=DUMMY;
|
||||
public void detachView() {
|
||||
this.nearbyParentFragmentView = DUMMY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -109,13 +107,13 @@ public class NearbyParentFragmentPresenter
|
|||
if (applicationKvStore.getBoolean("login_skipped", false)) {
|
||||
// prompt the user to login
|
||||
nearbyParentFragmentView.displayLoginSkippedWarning();
|
||||
}else {
|
||||
} else {
|
||||
nearbyParentFragmentView.animateFABs();
|
||||
}
|
||||
});
|
||||
|
||||
nearbyParentFragmentView.setFABRecenterAction(v -> {
|
||||
nearbyParentFragmentView.recenterMap(curLatLng);
|
||||
nearbyParentFragmentView.recenterMap(curLatLng);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -125,8 +123,7 @@ public class NearbyParentFragmentPresenter
|
|||
if (nearbyParentFragmentView.isAdvancedQueryFragmentVisible()) {
|
||||
nearbyParentFragmentView.showHideAdvancedQueryFragment(false);
|
||||
return true;
|
||||
}
|
||||
else if(nearbyParentFragmentView.isListBottomSheetExpanded()) {
|
||||
} else if (nearbyParentFragmentView.isListBottomSheetExpanded()) {
|
||||
// Back should first hide the bottom sheet if it is expanded
|
||||
nearbyParentFragmentView.listOptionMenuItemClicked();
|
||||
return true;
|
||||
|
|
@ -150,6 +147,7 @@ public class NearbyParentFragmentPresenter
|
|||
/**
|
||||
* Nearby updates takes time, since they are network operations. During update time, we don't
|
||||
* want to get any other calls from user. So locking nearby.
|
||||
*
|
||||
* @param isNearbyLocked true means lock, false means unlock
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -163,8 +161,8 @@ public class NearbyParentFragmentPresenter
|
|||
}
|
||||
|
||||
/**
|
||||
* This method should be the single point to update Map and List. Triggered by location
|
||||
* changes
|
||||
* This method should be the single point to update Map and List. Triggered by location changes
|
||||
*
|
||||
* @param locationChangeType defines if location changed significantly or slightly
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -180,9 +178,12 @@ public class NearbyParentFragmentPresenter
|
|||
return;
|
||||
}
|
||||
|
||||
LatLng lastLocation = nearbyParentFragmentView.getLastLocation();
|
||||
curLatLng = lastLocation;
|
||||
|
||||
LatLng lastLocation = nearbyParentFragmentView.getLastMapFocus();
|
||||
if (nearbyParentFragmentView.getMapCenter() != null) {
|
||||
curLatLng = nearbyParentFragmentView.getMapCenter();
|
||||
} else {
|
||||
curLatLng = lastLocation;
|
||||
}
|
||||
if (curLatLng == null) {
|
||||
Timber.d("Skipping update of nearby places as location is unavailable");
|
||||
return;
|
||||
|
|
@ -192,31 +193,29 @@ public class NearbyParentFragmentPresenter
|
|||
* Significant changed - Markers and current location will be updated together
|
||||
* Slightly changed - Only current position marker will be updated
|
||||
*/
|
||||
if(locationChangeType.equals(CUSTOM_QUERY)){
|
||||
if (locationChangeType.equals(CUSTOM_QUERY)) {
|
||||
Timber.d("ADVANCED_QUERY_SEARCH");
|
||||
lockUnlockNearby(true);
|
||||
nearbyParentFragmentView.setProgressBarVisibility(true);
|
||||
LatLng updatedLocationByUser = LocationUtils.deriveUpdatedLocationFromSearchQuery(customQuery);
|
||||
LatLng updatedLocationByUser = LocationUtils.deriveUpdatedLocationFromSearchQuery(
|
||||
customQuery);
|
||||
if (updatedLocationByUser == null) {
|
||||
updatedLocationByUser = lastLocation;
|
||||
}
|
||||
nearbyParentFragmentView.populatePlaces(updatedLocationByUser, customQuery);
|
||||
}
|
||||
else if (locationChangeType.equals(LOCATION_SIGNIFICANTLY_CHANGED)
|
||||
|| locationChangeType.equals(MAP_UPDATED)) {
|
||||
Timber.d("LOCATION_SIGNIFICANTLY_CHANGED");
|
||||
} else if (locationChangeType.equals(LOCATION_SIGNIFICANTLY_CHANGED)
|
||||
|| locationChangeType.equals(MAP_UPDATED)) {
|
||||
lockUnlockNearby(true);
|
||||
nearbyParentFragmentView.setProgressBarVisibility(true);
|
||||
nearbyParentFragmentView.populatePlaces(lastLocation);
|
||||
|
||||
nearbyParentFragmentView.populatePlaces(nearbyParentFragmentView.getMapCenter());
|
||||
} else if (locationChangeType.equals(SEARCH_CUSTOM_AREA)) {
|
||||
Timber.d("SEARCH_CUSTOM_AREA");
|
||||
lockUnlockNearby(true);
|
||||
nearbyParentFragmentView.setProgressBarVisibility(true);
|
||||
nearbyParentFragmentView.populatePlaces(nearbyParentFragmentView.getCameraTarget());
|
||||
nearbyParentFragmentView.populatePlaces(nearbyParentFragmentView.getMapFocus());
|
||||
} else { // Means location changed slightly, ie user is walking or driving.
|
||||
Timber.d("Means location changed slightly");
|
||||
if (nearbyParentFragmentView.isCurrentLocationMarkerVisible()){ // Means user wants to see their live location
|
||||
if (nearbyParentFragmentView.isCurrentLocationMarkerVisible()) { // Means user wants to see their live location
|
||||
nearbyParentFragmentView.recenterMap(curLatLng);
|
||||
}
|
||||
}
|
||||
|
|
@ -225,31 +224,29 @@ public class NearbyParentFragmentPresenter
|
|||
/**
|
||||
* Populates places for custom location, should be used for finding nearby places around a
|
||||
* location where you are not at.
|
||||
*
|
||||
* @param nearbyPlacesInfo This variable has placeToCenter list information and distances.
|
||||
*/
|
||||
public void updateMapMarkers(NearbyController.NearbyPlacesInfo nearbyPlacesInfo, Marker selectedMarker, boolean shouldTrackPosition) {
|
||||
if(null!=nearbyParentFragmentView) {
|
||||
public void updateMapMarkers(NearbyController.NearbyPlacesInfo nearbyPlacesInfo,
|
||||
Marker selectedMarker, boolean shouldTrackPosition) {
|
||||
if (null != nearbyParentFragmentView) {
|
||||
nearbyParentFragmentView.clearAllMarkers();
|
||||
List<NearbyBaseMarker> nearbyBaseMarkers = NearbyController
|
||||
.loadAttractionsFromLocationToBaseMarkerOptions(nearbyPlacesInfo.curLatLng, // Curlatlang will be used to calculate distances
|
||||
nearbyPlacesInfo.placeList,
|
||||
nearbyParentFragmentView.getContext(),
|
||||
bookmarkLocationDao.getAllBookmarksLocations());
|
||||
.loadAttractionsFromLocationToBaseMarkerOptions(nearbyPlacesInfo.curLatLng,
|
||||
// Curlatlang will be used to calculate distances
|
||||
nearbyPlacesInfo.placeList,
|
||||
nearbyParentFragmentView.getContext(),
|
||||
bookmarkLocationDao.getAllBookmarksLocations());
|
||||
nearbyParentFragmentView.updateMapMarkers(nearbyBaseMarkers, selectedMarker);
|
||||
nearbyParentFragmentView.addCurrentLocationMarker(nearbyPlacesInfo.curLatLng);
|
||||
if(shouldTrackPosition){
|
||||
nearbyParentFragmentView.updateMapToTrackPosition(nearbyPlacesInfo.curLatLng);
|
||||
}
|
||||
lockUnlockNearby(false); // So that new location updates wont come
|
||||
nearbyParentFragmentView.setProgressBarVisibility(false);
|
||||
nearbyParentFragmentView.updateListFragment(nearbyPlacesInfo.placeList);
|
||||
handleCenteringTaskIfAny();
|
||||
nearbyParentFragmentView.centerMapToPosition(nearbyPlacesInfo.searchLatLng);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Some centering task may need to wait for map to be ready, if they are requested before
|
||||
* map is ready. So we will remember it when the map is ready
|
||||
* Some centering task may need to wait for map to be ready, if they are requested before map is
|
||||
* ready. So we will remember it when the map is ready
|
||||
*/
|
||||
private void handleCenteringTaskIfAny() {
|
||||
if (!placesLoadedOnce) {
|
||||
|
|
@ -282,31 +279,32 @@ public class NearbyParentFragmentPresenter
|
|||
|
||||
@Override
|
||||
public void onCameraMove(com.mapbox.mapboxsdk.geometry.LatLng latLng) {
|
||||
nearbyParentFragmentView.setProjectorLatLngBounds();
|
||||
// If our nearby markers are calculated at least once
|
||||
if (NearbyController.latestSearchLocation != null) {
|
||||
double distance =latLng.distanceTo
|
||||
(LocationUtils.commonsLatLngToMapBoxLatLng(NearbyController.latestSearchLocation));
|
||||
if (nearbyParentFragmentView.isNetworkConnectionEstablished()) {
|
||||
if (distance > NearbyController.latestSearchRadius) {
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(true);
|
||||
} else {
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||
}
|
||||
// If our nearby markers are calculated at least once
|
||||
if (NearbyController.latestSearchLocation != null) {
|
||||
double distance = latLng.distanceTo
|
||||
(LocationUtils.commonsLatLngToMapBoxLatLng(NearbyController.latestSearchLocation));
|
||||
if (nearbyParentFragmentView.isNetworkConnectionEstablished()) {
|
||||
if (distance > NearbyController.latestSearchRadius) {
|
||||
//nearbyParentFragmentView.setSearchThisAreaButtonVisibility(true);
|
||||
} else {
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||
}
|
||||
} else {
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||
}
|
||||
} else {
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState, boolean filterForAllNoneType) {
|
||||
if (filterForAllNoneType) { // Means we will set labels based on states
|
||||
public void filterByMarkerType(List<Label> selectedLabels, int state,
|
||||
boolean filterForPlaceState, boolean filterForAllNoneType) {
|
||||
if (filterForAllNoneType) {// Means we will set labels based on states
|
||||
switch (state) {
|
||||
case UNKNOWN:
|
||||
// Do nothing
|
||||
break;
|
||||
case UNCHECKED:
|
||||
//TODO
|
||||
nearbyParentFragmentView.filterOutAllMarkers();
|
||||
nearbyParentFragmentView.setRecyclerViewAdapterItemsGreyedOut();
|
||||
break;
|
||||
|
|
@ -322,10 +320,10 @@ public class NearbyParentFragmentPresenter
|
|||
}
|
||||
} else {
|
||||
nearbyParentFragmentView.filterMarkersByLabels(selectedLabels,
|
||||
NearbyFilterState.getInstance().isExistsSelected(),
|
||||
NearbyFilterState.getInstance().isNeedPhotoSelected(),
|
||||
NearbyFilterState.getInstance().isWlmSelected(),
|
||||
filterForPlaceState, false);
|
||||
NearbyFilterState.getInstance().isExistsSelected(),
|
||||
NearbyFilterState.getInstance().isNeedPhotoSelected(),
|
||||
NearbyFilterState.getInstance().isWlmSelected(),
|
||||
filterForPlaceState, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -338,10 +336,16 @@ public class NearbyParentFragmentPresenter
|
|||
for (int i = 0; i < nearbyBaseMarkers.size(); i++) {
|
||||
NearbyBaseMarker nearbyBaseMarker = nearbyBaseMarkers.get(i);
|
||||
NearbyController.markerLabelList.add(
|
||||
new MarkerPlaceGroup(nearbyBaseMarker.getMarker(), bookmarkLocationDao.findBookmarkLocation(nearbyBaseMarker.getPlace()), nearbyBaseMarker.getPlace()));
|
||||
new MarkerPlaceGroup(nearbyBaseMarker.getMarker(),
|
||||
bookmarkLocationDao.findBookmarkLocation(nearbyBaseMarker.getPlace()),
|
||||
nearbyBaseMarker.getPlace()));
|
||||
//TODO: fix bookmark location
|
||||
NearbyController.markerExistsMap.put((nearbyBaseMarkers.get(i).getPlace().hasWikidataLink()), nearbyBaseMarkers.get(i).getMarker());
|
||||
NearbyController.markerNeedPicMap.put(((nearbyBaseMarkers.get(i).getPlace().pic == null) ? true : false), nearbyBaseMarkers.get(i).getMarker());
|
||||
NearbyController.markerExistsMap.put(
|
||||
(nearbyBaseMarkers.get(i).getPlace().hasWikidataLink()),
|
||||
nearbyBaseMarkers.get(i).getMarker());
|
||||
NearbyController.markerNeedPicMap.put(
|
||||
((nearbyBaseMarkers.get(i).getPlace().pic == null) ? true : false),
|
||||
nearbyBaseMarkers.get(i).getMarker());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +361,7 @@ public class NearbyParentFragmentPresenter
|
|||
|
||||
@Override
|
||||
public void searchViewGainedFocus() {
|
||||
if(nearbyParentFragmentView.isListBottomSheetExpanded()) {
|
||||
if (nearbyParentFragmentView.isListBottomSheetExpanded()) {
|
||||
// Back should first hide the bottom sheet if it is expanded
|
||||
nearbyParentFragmentView.hideBottomSheet();
|
||||
} else if (nearbyParentFragmentView.isDetailsBottomSheetVisible()) {
|
||||
|
|
@ -368,9 +372,9 @@ public class NearbyParentFragmentPresenter
|
|||
public View.OnClickListener onSearchThisAreaClicked() {
|
||||
return v -> {
|
||||
// Lock map operations during search this area operation
|
||||
// nearbyParentFragmentView.setMapCenter();
|
||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||
|
||||
if (searchCloseToCurrentLocation()){
|
||||
if (searchCloseToCurrentLocation()) {
|
||||
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
|
||||
} else {
|
||||
updateMapAndList(SEARCH_CUSTOM_AREA);
|
||||
|
|
@ -379,17 +383,25 @@ public class NearbyParentFragmentPresenter
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if search this area button is used around our current location, so that
|
||||
* we can continue following our current location again
|
||||
* Returns true if search this area button is used around our current location, so that we can
|
||||
* continue following our current location again
|
||||
*
|
||||
* @return Returns true if search this area button is used around our current location
|
||||
*/
|
||||
public boolean searchCloseToCurrentLocation() {
|
||||
if (null == nearbyParentFragmentView.getLastFocusLocation()) {
|
||||
if (null == nearbyParentFragmentView.getLastMapFocus()) {
|
||||
return true;
|
||||
}
|
||||
double distance = LocationUtils.commonsLatLngToMapBoxLatLng(nearbyParentFragmentView.getCameraTarget())
|
||||
.distanceTo(nearbyParentFragmentView.getLastFocusLocation());
|
||||
if (distance > NearbyController.currentLocationSearchRadius * 3 / 4) {
|
||||
//TODO
|
||||
Location mylocation = new Location("");
|
||||
Location dest_location = new Location("");
|
||||
dest_location.setLatitude(nearbyParentFragmentView.getMapFocus().getLatitude());
|
||||
dest_location.setLongitude(nearbyParentFragmentView.getMapFocus().getLongitude());
|
||||
mylocation.setLatitude(nearbyParentFragmentView.getLastMapFocus().getLatitude());
|
||||
mylocation.setLongitude(nearbyParentFragmentView.getLastMapFocus().getLongitude());
|
||||
Float distance = mylocation.distanceTo(dest_location);
|
||||
|
||||
if (distance > 2000.0 * 3 / 4) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
@ -397,7 +409,7 @@ public class NearbyParentFragmentPresenter
|
|||
}
|
||||
|
||||
public void onMapReady() {
|
||||
if(null!=nearbyParentFragmentView) {
|
||||
if (null != nearbyParentFragmentView) {
|
||||
nearbyParentFragmentView.addSearchThisAreaButtonAction();
|
||||
initializeMapOperations();
|
||||
}
|
||||
|
|
@ -405,7 +417,7 @@ public class NearbyParentFragmentPresenter
|
|||
|
||||
public boolean areLocationsClose(LatLng cameraTarget, LatLng lastKnownLocation) {
|
||||
double distance = LocationUtils.commonsLatLngToMapBoxLatLng(cameraTarget)
|
||||
.distanceTo(LocationUtils.commonsLatLngToMapBoxLatLng(lastKnownLocation));
|
||||
.distanceTo(LocationUtils.commonsLatLngToMapBoxLatLng(lastKnownLocation));
|
||||
if (distance > NearbyController.currentLocationSearchRadius * 3 / 4) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,222 +1,230 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/coordinator_layout"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/map_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<RelativeLayout
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/status_bar_blue">
|
||||
|
||||
<include
|
||||
android:id="@+id/nearby_filter"
|
||||
layout="@layout/nearby_filter_all_items" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_container_wlm_month_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/status_bar_blue"
|
||||
android:id="@+id/map_layout">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/nearby_filter"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<include
|
||||
layout="@layout/nearby_filter_all_items"
|
||||
android:id="@+id/nearby_filter"/>
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:gravity="center"
|
||||
android:id="@+id/rl_container_wlm_month_message"
|
||||
android:background="@color/white"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:layout_below="@id/nearby_filter">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/tv_learn_more"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/secondaryTextColor"
|
||||
android:text="@string/wlm_month_message"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_learn_more"
|
||||
android:textColor="@color/status_bar_blue"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/learn_more"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_toStartOf="@id/tv_learn_more"
|
||||
android:text="@string/wlm_month_message"
|
||||
android:textColor="@color/secondaryTextColor"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.AppCompatTextView>
|
||||
</RelativeLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_learn_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/learn_more"
|
||||
android:textColor="@color/status_bar_blue"
|
||||
android:textStyle="bold">
|
||||
|
||||
<include layout="@layout/nearby_filter_list"
|
||||
android:id="@+id/nearby_filter_list"
|
||||
android:layout_below="@id/nearby_filter"
|
||||
android:layout_height="@dimen/giant_height"
|
||||
android:layout_width="@dimen/giant_height"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
</androidx.appcompat.widget.AppCompatTextView>
|
||||
</RelativeLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/nearby_filter_list"
|
||||
layout="@layout/nearby_filter_list"
|
||||
android:layout_width="@dimen/giant_height"
|
||||
android:layout_height="@dimen/giant_height"
|
||||
android:layout_below="@id/nearby_filter"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
|
||||
<!-- I have done this intentionally, the mapview because of some elevation or something,
|
||||
sometimes hangs over the drawer layout and sometimes draws its onPaused state over the contributions, this seems to be the probable fix -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/rl_container_wlm_month_message">
|
||||
<!-- I have done this intentionally, the mapview because of some elevation or something,
|
||||
sometimes hangs over the drawer layout and sometimes draws its onPaused state over the contributions, this seems to be the probable fix -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/rl_container_wlm_month_message">
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_attribution"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/map_attribution"
|
||||
android:textAlignment="center"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/search_this_area_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="@dimen/activity_margin_horizontal"
|
||||
android:background="@color/white"
|
||||
android:padding="@dimen/activity_margin_horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/search_this_area"
|
||||
android:textColor="@color/status_bar_blue"
|
||||
android:visibility="gone"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
android:layout_below="@id/rl_container_wlm_month_message"
|
||||
/>
|
||||
<org.osmdroid.views.MapView
|
||||
android:id="@+id/map"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/transparentView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:background="#aa969696"
|
||||
android:visibility="gone"
|
||||
android:elevation="@dimen/dimen_6">
|
||||
|
||||
</View>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_recenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/rl_container_wlm_month_message"
|
||||
android:clickable="true"
|
||||
android:visibility="visible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:srcCompat="@drawable/ic_my_location_black_24dp"
|
||||
app:useCompatPadding="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_container_nearby_children"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</RelativeLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<include layout="@layout/bottom_sheet_nearby" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_attribution"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/map_attribution"
|
||||
android:textAlignment="center"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<include
|
||||
android:id="@+id/bottom_sheet_details"
|
||||
layout="@layout/bottom_sheet_details" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_plus"
|
||||
<Button
|
||||
android:id="@+id/search_this_area_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/rl_container_wlm_month_message"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="@dimen/activity_margin_horizontal"
|
||||
android:background="@color/white"
|
||||
android:padding="@dimen/activity_margin_horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/search_this_area"
|
||||
android:textColor="@color/status_bar_blue"
|
||||
android:visibility="gone"
|
||||
app:elevation="@dimen/dimen_6" />
|
||||
|
||||
<View
|
||||
android:id="@+id/transparentView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:background="#aa969696"
|
||||
android:elevation="@dimen/dimen_6"
|
||||
android:visibility="gone">
|
||||
|
||||
</View>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_recenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/rl_container_wlm_month_message"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="@dimen/medium_height"
|
||||
android:layout_marginRight="@dimen/medium_height"
|
||||
android:clickable="true"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/button_blue"
|
||||
app:elevation="@dimen/activity_margin_horizontal"
|
||||
android:visibility="visible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchor="@id/bottom_sheet_details"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"
|
||||
app:srcCompat="@drawable/ic_my_location_black_24dp"
|
||||
app:useCompatPadding="true" />
|
||||
|
||||
<View
|
||||
android:id="@+id/empty_view1"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="174dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="46dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_container_nearby_children"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_camera"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view1"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
<include layout="@layout/bottom_sheet_nearby" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp" />
|
||||
<include
|
||||
android:id="@+id/bottom_sheet_details"
|
||||
layout="@layout/bottom_sheet_details" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
app:elevation="@dimen/dimen_6" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_plus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="@dimen/medium_height"
|
||||
android:layout_marginRight="@dimen/medium_height"
|
||||
android:clickable="true"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/button_blue"
|
||||
app:elevation="@dimen/activity_margin_horizontal"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchor="@id/bottom_sheet_details"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"
|
||||
app:useCompatPadding="true" />
|
||||
|
||||
<View
|
||||
android:id="@+id/empty_view1"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="174dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
|
||||
<View
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="46dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_camera"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view1"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="@dimen/dimen_6"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:pressedTranslationZ="@dimen/medium_height"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -667,7 +667,7 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="leaderboard_nearby">Nearby</string>
|
||||
<string name="leaderboard_used">Used</string>
|
||||
<string name="leaderboard_my_rank_button_text">My Rank</string>
|
||||
<string name="map_attribution" translatable="false"><![CDATA[© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> <a href="https://www.mapbox.com/map-feedback/">Improve this map</a>]]></string>
|
||||
<string name="map_attribution" translatable="false"><![CDATA[© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>]]></string>
|
||||
<string name="limited_connection_enabled">Limited connection mode enabled!</string>
|
||||
<string name="limited_connection_disabled">Limited connection mode disabled. Pending uploads will resume now.</string>
|
||||
<string name="limited_connection_mode">Limited Connection Mode</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue