mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Made Split to Nearby Query into a fast query for coordinates + a details query for each pin (#5731)
* Splitted the query * Made changes to the query * Improvised query * Improvised query by dividing in the batches * Fixed failing tests * Improved batches * Improved sorting * Fixes issue caused by search this area button * Fixed failing tests * Fixed unnecessary reloads on onResume * Fixed few pins not loading on changing apps * Improved zoom level and fixed the pins not loading from the center * Removed toggle chips and changed pin's color * Fixed wikidata url * Fixed unit tests * Implemented retry with delay of 5000ms * Fixed exception issue and pins issue * Added change color icon to pin * Improved pin clicking * Removed search this area button * Implemented caching of places * Fixed unit test * Factorized methods * Changed primary key from location to entity id * Fixed tests * Fixed conflicts * Fixed unit test * Fixed unit test * Fixed the bug * Fixed issue with pin loading on the first launch * Updated javadocs * Temporary commit - only for testing * Replaced Temporary commit * Temporary commit - Added jcenter * Made minor changes * Fixed unit tests * Fixed unit tests * Fixed minor bug
This commit is contained in:
parent
ba6c8fe8d0
commit
2d63f351ed
39 changed files with 1147 additions and 814 deletions
|
|
@ -6,6 +6,8 @@ import androidx.room.TypeConverters
|
|||
import fr.free.nrw.commons.contributions.Contribution
|
||||
import fr.free.nrw.commons.contributions.ContributionDao
|
||||
import fr.free.nrw.commons.customselector.database.*
|
||||
import fr.free.nrw.commons.nearby.Place
|
||||
import fr.free.nrw.commons.nearby.PlaceDao
|
||||
import fr.free.nrw.commons.review.ReviewDao
|
||||
import fr.free.nrw.commons.review.ReviewEntity
|
||||
import fr.free.nrw.commons.upload.depicts.Depicts
|
||||
|
|
@ -15,10 +17,11 @@ import fr.free.nrw.commons.upload.depicts.DepictsDao
|
|||
* The database for accessing the respective DAOs
|
||||
*
|
||||
*/
|
||||
@Database(entities = [Contribution::class, Depicts::class, UploadedStatus::class, NotForUploadStatus::class, ReviewEntity::class], version = 16, exportSchema = false)
|
||||
@Database(entities = [Contribution::class, Depicts::class, UploadedStatus::class, NotForUploadStatus::class, ReviewEntity::class, Place::class], version = 18, exportSchema = false)
|
||||
@TypeConverters(Converters::class)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun contributionDao(): ContributionDao
|
||||
abstract fun PlaceDao(): PlaceDao
|
||||
abstract fun DepictsDao(): DepictsDao;
|
||||
abstract fun UploadedStatusDao(): UploadedStatusDao;
|
||||
abstract fun NotForUploadStatusDao(): NotForUploadStatusDao
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ import fr.free.nrw.commons.CommonsApplication;
|
|||
import fr.free.nrw.commons.contributions.ChunkInfo;
|
||||
import fr.free.nrw.commons.di.ApplicationlessInjection;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.nearby.Sitelinks;
|
||||
import fr.free.nrw.commons.upload.WikidataPlace;
|
||||
import fr.free.nrw.commons.upload.structure.depictions.DepictedItem;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -134,6 +136,18 @@ public class Converters {
|
|||
return readObjectWithTypeToken(depictedItems, new TypeToken<List<DepictedItem>>() {});
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Sitelinks sitelinksFromString(String value) {
|
||||
Type type = new TypeToken<Sitelinks>() {}.getType();
|
||||
return new Gson().fromJson(value, type);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static String fromSitelinks(Sitelinks sitelinks) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(sitelinks);
|
||||
}
|
||||
|
||||
private static String writeObjectToString(Object object) {
|
||||
return object == null ? null : getGson().toJson(object);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue