// Path: app/src/main/java/nich/work/aequorea/common/utils/NetworkUtils.java
// public class NetworkUtils {
// 
//     public static boolean isNetworkAvailable() {
//         Context context = Aequorea.getApp();
//         ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//     
//         NetworkInfo info = null;
//         if (connectivityManager != null) {
//             info = connectivityManager.getActiveNetworkInfo();
//         }
//         return info != null && info.isAvailable();
//     }
//     
//     public static boolean isWiFiNetwork() {
//         Context context = Aequorea.getApp();
//         ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//     
//         NetworkInfo info = null;
//         if (connectivityManager != null) {
//             info = connectivityManager.getActiveNetworkInfo();
//         }
//     
//         return info != null && info.getType() == ConnectivityManager.TYPE_WIFI && info.isAvailable();
//     }
// }
// 
// Path: app/src/main/java/nich/work/aequorea/model/entity/Data.java
// public class Data {
// 
//     @SerializedName("data")
//     private List<Datum> mData;
//     @SerializedName("meta")
//     private Meta mMeta;
// 
//     public List<Datum> getData() {
//         return mData;
//     }
// 
//     public void setData(List<Datum> data) {
//         mData = data;
//     }
//     
//     public Meta getMeta() {
//         return mMeta;
//     }
//     
//     public void setMeta(Meta meta) {
//         mMeta = meta;
//     }
// }


import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import nich.work.aequorea.R;
import nich.work.aequorea.common.utils.NetworkUtils;
import nich.work.aequorea.model.entity.Data;
package nich.work.aequorea.presenter;


public class TagPresenter extends SimpleArticleListPresenter {
    @Override
    public void load() {
        if (!NetworkUtils.isNetworkAvailable()) {
            onError(new Throwable(getString(R.string.please_connect_to_the_internet)));
            return;
        }
    
        if (mPage > mTotalPage || mBaseView.getModel().isLoading()) {
            return;
        }
        mBaseView.getModel().setLoading(true);
    
        mComposite.add(mService.getTagsList(mBaseView.getModel().getId(), mPage, mPer)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
// Path: app/src/main/java/nich/work/aequorea/common/utils/NetworkUtils.java
// public class NetworkUtils {
// 
//     public static boolean isNetworkAvailable() {
//         Context context = Aequorea.getApp();
//         ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//     
//         NetworkInfo info = null;
//         if (connectivityManager != null) {
//             info = connectivityManager.getActiveNetworkInfo();
//         }
//         return info != null && info.isAvailable();
//     }
//     
//     public static boolean isWiFiNetwork() {
//         Context context = Aequorea.getApp();
//         ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//     
//         NetworkInfo info = null;
//         if (connectivityManager != null) {
//             info = connectivityManager.getActiveNetworkInfo();
//         }
//     
//         return info != null && info.getType() == ConnectivityManager.TYPE_WIFI && info.isAvailable();
//     }
// }
// 
// Path: app/src/main/java/nich/work/aequorea/model/entity/Data.java
// public class Data {
// 
//     @SerializedName("data")
//     private List<Datum> mData;
//     @SerializedName("meta")
//     private Meta mMeta;
// 
//     public List<Datum> getData() {
//         return mData;
//     }
// 
//     public void setData(List<Datum> data) {
//         mData = data;
//     }
//     
//     public Meta getMeta() {
//         return mMeta;
//     }
//     
//     public void setMeta(Meta meta) {
//         mMeta = meta;
//     }
// }


// Path: app/src/main/java/nich/work/aequorea/presenter/TagPresenter.java
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import nich.work.aequorea.R;
import nich.work.aequorea.common.utils.NetworkUtils;
import nich.work.aequorea.model.entity.Data;

package nich.work.aequorea.presenter;


public class TagPresenter extends SimpleArticleListPresenter {
    @Override
    public void load() {
        if (!NetworkUtils.isNetworkAvailable()) {
            onError(new Throwable(getString(R.string.please_connect_to_the_internet)));
            return;
        }
    
        if (mPage > mTotalPage || mBaseView.getModel().isLoading()) {
            return;
        }
        mBaseView.getModel().setLoading(true);
    
        mComposite.add(mService.getTagsList(mBaseView.getModel().getId(), mPage, mPer)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Consumer<Data>() {