mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
With pause and resume for uploads (#3858)
* With pause and resume for uploads * Dispose current upload * Make pause and resume work * Check stash validity * With java docs * minor
This commit is contained in:
parent
e40e9690dd
commit
6f4c60b5ff
27 changed files with 483 additions and 155 deletions
|
|
@ -10,7 +10,7 @@ import fr.free.nrw.commons.contributions.ContributionDao
|
|||
* The database for accessing the respective DAOs
|
||||
*
|
||||
*/
|
||||
@Database(entities = [Contribution::class], version = 4, exportSchema = false)
|
||||
@Database(entities = [Contribution::class], version = 5, exportSchema = false)
|
||||
@TypeConverters(Converters::class)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun contributionDao(): ContributionDao
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import androidx.room.TypeConverter;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
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.upload.WikidataPlace;
|
||||
|
|
@ -82,6 +83,16 @@ public class Converters {
|
|||
return readObjectFromString(wikidataPlace, WikidataPlace.class);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static String chunkInfoToString(ChunkInfo chunkInfo) {
|
||||
return writeObjectToString(chunkInfo);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static ChunkInfo stringToChunkInfo(String chunkInfo) {
|
||||
return readObjectFromString(chunkInfo, ChunkInfo.class);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static String depictionListToString(List<DepictedItem> depictedItems) {
|
||||
return writeObjectToString(depictedItems);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue