Add bookmarks to Nearby map (#3728)

* Remove bookmark button from row button set and put to upper level list item

* Fix npe caused by lookinf for parent fragment, we don't have one anymore

* style

* Add new icons for bookmarked places

* Change bookmarked info when bookmarked

* Add pic field to bookmark dao so that we can retrieve them later

* Put bookmarks as the first item of list

* Add bookmark as a label

* Add logic to filter nearby

* remove unneeded changes

* fix word

* Remove logs

* Remove unused part of code

* Fix tests

* Remove logs

* simplify icon picking

* remove redundant margin left

* Remove non needed map and swap

* Add main thread annotation

* Fix tests
This commit is contained in:
neslihanturan 2020-05-21 13:58:27 +03:00 committed by GitHub
parent 384afa6c44
commit 3f31c3eded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 161 additions and 90 deletions

View file

@ -9,6 +9,7 @@ import android.os.RemoteException;
import androidx.annotation.NonNull;
import fr.free.nrw.commons.nearby.NearbyController;
import java.util.ArrayList;
import java.util.List;
@ -74,8 +75,10 @@ public class BookmarkLocationsDao {
boolean bookmarkExists = findBookmarkLocation(bookmarkLocation);
if (bookmarkExists) {
deleteBookmarkLocation(bookmarkLocation);
NearbyController.updateMarkerLabelListBookmark(bookmarkLocation, false);
} else {
addBookmarkLocation(bookmarkLocation);
NearbyController.updateMarkerLabelListBookmark(bookmarkLocation, true);
}
return !bookmarkExists;
}
@ -160,10 +163,9 @@ public class BookmarkLocationsDao {
location,
cursor.getString(cursor.getColumnIndex(Table.COLUMN_CATEGORY)),
builder.build(),
null,
cursor.getString(cursor.getColumnIndex(Table.COLUMN_PIC)),
null
);
// TODO: add pic and destroyed to bookmark location dao
}
private ContentValues toContentValues(Place bookmarkLocation) {