Delete unused code

This commit is contained in:
Shinokuni 2020-10-21 21:42:22 +02:00
parent 5c88a3f467
commit 6294b5556f
3 changed files with 3 additions and 47 deletions

View File

@ -5,15 +5,10 @@ import androidx.annotation.Nullable;
import com.readrops.api.services.SyncResult;
import com.readrops.api.services.SyncType;
import com.readrops.api.services.freshrss.adapters.FreshRSSFeedsAdapter;
import com.readrops.api.services.freshrss.adapters.FreshRSSFoldersAdapter;
import com.readrops.api.services.freshrss.adapters.FreshRSSItemsAdapter;
import com.readrops.api.services.freshrss.json.FreshRSSUserInfo;
import com.readrops.db.entities.Feed;
import com.readrops.db.entities.Folder;
import com.readrops.db.entities.Item;
import com.squareup.moshi.Moshi;
import com.squareup.moshi.Types;
import java.io.StringReader;
import java.util.List;
@ -38,14 +33,6 @@ public class FreshRSSDataSource {
this.api = api;
}
protected Moshi buildMoshi() {
return new Moshi.Builder()
.add(Types.newParameterizedType(List.class, Item.class), new FreshRSSItemsAdapter())
.add(new FreshRSSFeedsAdapter())
.add(new FreshRSSFoldersAdapter())
.build();
}
/**
* Call token API to generate a new token from account credentials
*

View File

@ -5,20 +5,15 @@ import android.content.res.Resources;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.readrops.db.entities.Feed;
import com.readrops.db.entities.Folder;
import com.readrops.db.entities.Item;
import com.readrops.api.services.SyncResult;
import com.readrops.api.services.SyncType;
import com.readrops.api.services.nextcloudnews.adapters.NextNewsFeedsAdapter;
import com.readrops.api.services.nextcloudnews.adapters.NextNewsFoldersAdapter;
import com.readrops.api.services.nextcloudnews.adapters.NextNewsItemsAdapter;
import com.readrops.api.services.nextcloudnews.json.NextNewsUser;
import com.readrops.api.utils.ConflictException;
import com.readrops.api.utils.LibUtils;
import com.readrops.api.utils.UnknownFormatException;
import com.squareup.moshi.Moshi;
import com.squareup.moshi.Types;
import com.readrops.db.entities.Feed;
import com.readrops.db.entities.Folder;
import com.readrops.db.entities.Item;
import java.io.IOException;
import java.util.ArrayList;
@ -40,14 +35,6 @@ public class NextNewsDataSource {
this.api = api;
}
protected Moshi buildMoshi() {
return new Moshi.Builder()
.add(new NextNewsFeedsAdapter())
.add(new NextNewsFoldersAdapter())
.add(Types.newParameterizedType(List.class, Item.class), new NextNewsItemsAdapter())
.build();
}
@Nullable
public NextNewsUser login() throws IOException {
Response<NextNewsUser> response = api.getUser().execute();

View File

@ -18,7 +18,6 @@ import com.readrops.db.entities.Feed;
import com.readrops.db.entities.Folder;
import com.readrops.db.entities.Item;
import com.readrops.db.entities.account.Account;
import com.readrops.db.entities.account.AccountType;
import org.koin.java.KoinJavaComponent;
@ -176,23 +175,6 @@ public abstract class ARepository {
context.startService(intent);
}
public static ARepository repositoryFactory(Account account, AccountType accountType, Context context) {
switch (accountType) {
case LOCAL:
return new LocalFeedRepository(null, Database.getInstance(context), context, account);
case NEXTCLOUD_NEWS:
return new NextNewsRepository(null, Database.getInstance(context), context, account);
case FRESHRSS:
return new FreshRSSRepository(null, Database.getInstance(context), context, account);
default:
throw new IllegalArgumentException("account type not supported");
}
}
public static ARepository repositoryFactory(Account account, Context context) {
return ARepository.repositoryFactory(account, account.getAccountType(), context);
}
public SyncResult getSyncResult() {
return syncResult;
}