// Path: app/src/main/java/me/ccrama/rssslide/BaseApplication.java
// public class BaseApplication extends Application {
// 
//     public static RealmConfiguration config;
//     private static ImageLoader defaultImageLoader;
//     public static ImageLoader getImageLoader(Context context) {
//         if (defaultImageLoader == null || !defaultImageLoader.isInited()) {
//             ImageLoaderUtils.initImageLoader(context.getApplicationContext());
//             defaultImageLoader = ImageLoaderUtils.imageLoader;
//         }
// 
//         return defaultImageLoader;
//     }
// 
// 
//     @Override
//     public void onLowMemory() {
//         super.onLowMemory();
//         getImageLoader(this).clearMemoryCache();
//     }
// 
// 
//     public void onCreate() {
//         super.onCreate();
//         Realm.init(this);
// 
//         config = new RealmConfiguration.Builder().name("posts").deleteRealmIfMigrationNeeded().build();
//         Realm.setDefaultConfiguration(config);
//     }
// }
// 
// Path: app/src/main/java/me/ccrama/rssslide/Util/ConversionCallback.java
// public interface ConversionCallback{
//     public void onCompletion(int size);
// }


import android.app.Activity;
import com.rometools.rome.feed.synd.SyndEntry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import io.realm.Realm;
import me.ccrama.rssslide.BaseApplication;
import me.ccrama.rssslide.Util.ConversionCallback;
package me.ccrama.rssslide.Realm;





/**
 * Created by Carlos on 3/16/2017.
 */

public class XMLToRealm {
    public static void convert(final String feed, final List<SyndEntry> items, final ConversionCallback c) {
        Realm.getInstance(BaseApplication.config).executeTransaction(new Realm.Transaction() {
            @Override
            public void execute(Realm realm) {
                Feed f = realm.where(Feed.class).equalTo("name", feed).findFirst();
                ArrayList<Article> toAdd = new ArrayList<>();
// Path: app/src/main/java/me/ccrama/rssslide/BaseApplication.java
// public class BaseApplication extends Application {
// 
//     public static RealmConfiguration config;
//     private static ImageLoader defaultImageLoader;
//     public static ImageLoader getImageLoader(Context context) {
//         if (defaultImageLoader == null || !defaultImageLoader.isInited()) {
//             ImageLoaderUtils.initImageLoader(context.getApplicationContext());
//             defaultImageLoader = ImageLoaderUtils.imageLoader;
//         }
// 
//         return defaultImageLoader;
//     }
// 
// 
//     @Override
//     public void onLowMemory() {
//         super.onLowMemory();
//         getImageLoader(this).clearMemoryCache();
//     }
// 
// 
//     public void onCreate() {
//         super.onCreate();
//         Realm.init(this);
// 
//         config = new RealmConfiguration.Builder().name("posts").deleteRealmIfMigrationNeeded().build();
//         Realm.setDefaultConfiguration(config);
//     }
// }
// 
// Path: app/src/main/java/me/ccrama/rssslide/Util/ConversionCallback.java
// public interface ConversionCallback{
//     public void onCompletion(int size);
// }


// Path: app/src/main/java/me/ccrama/rssslide/Realm/XMLToRealm.java
import android.app.Activity;
import com.rometools.rome.feed.synd.SyndEntry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import io.realm.Realm;
import me.ccrama.rssslide.BaseApplication;
import me.ccrama.rssslide.Util.ConversionCallback;

package me.ccrama.rssslide.Realm;





/**
 * Created by Carlos on 3/16/2017.
 */

public class XMLToRealm {
    public static void convert(final String feed, final List<SyndEntry> items, final ConversionCallback c) {
        Realm.getInstance(BaseApplication.config).executeTransaction(new Realm.Transaction() {
            @Override
            public void execute(Realm realm) {
                Feed f = realm.where(Feed.class).equalTo("name", feed).findFirst();
                ArrayList<Article> toAdd = new ArrayList<>();
                for (SyndEntry i : items) {