mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
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:
parent
384afa6c44
commit
3f31c3eded
13 changed files with 161 additions and 90 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue