// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/presenters/AchievementsPresenter.java
// public interface AchievementsPresenter extends BasePresenter {
// 
//     public void loadAchievements();
// }
// 
// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/presenters/impl/AchievementsPresenterImpl.java
// public class AchievementsPresenterImpl implements AchievementsPresenter {
// 
//     private boolean canceled;
// 
//     private AchievementsView achievementsView;
// 
//     public AchievementsPresenterImpl(AchievementsView achievementsView) {
//         this.achievementsView = achievementsView;
//     }
// 
//     @Override
//     public void loadAchievements() {
//         achievementsView.showProgress();
//         User.getInstance().getUserDonations(findCallback);
//     }
// 
//     private FindCallback<ParseObject> findCallback = new FindCallback<ParseObject>() {
//         @Override
//         public void done(List<ParseObject> parseObjects, ParseException e) {
// 
//             if (canceled) {
//                 return;
//             }
// 
//             achievementsView.hideProgress();
//             if (parseObjects == null) {
//                 parseObjects = new ArrayList<>();
//             }
// 
//             boolean[] achievements = new boolean[6];
//             achievements[0] = parseObjects.size() >= 1;
//             achievements[3] = parseObjects.size() >= 5;
//             achievements[4] = parseObjects.size() >= 10;
//             achievements[5] = parseObjects.size() >= 15;
// 
//             achievementsView.showAchievements(achievements);
//         }
//     };
// 
//     @Override
//     public void cancel() {
//         canceled = true;
//     }
// }
// 
// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/views/AchievementsView.java
// public interface AchievementsView extends BaseView {
// 
//     public void showAchievements(boolean[] achievements);
// }


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.List;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.InjectViews;
import hr.foi.rsc.lifeline.R;
import hr.foi.rsc.lifeline.mvp.presenters.AchievementsPresenter;
import hr.foi.rsc.lifeline.mvp.presenters.impl.AchievementsPresenterImpl;
import hr.foi.rsc.lifeline.mvp.views.AchievementsView;
package hr.foi.rsc.lifeline.fragments;




public class AchievementsFragment extends BaseFragment implements AchievementsView {

    @InjectView(R.id.achievement_1st_time)
    ImageView achievement1stTime;

    @InjectView(R.id.achievement_2_year)
    ImageView achievement2Year;

    @InjectView(R.id.achievement_3_year)
    ImageView achievement3Year;

    @InjectView(R.id.achievement_5_times)
    ImageView achievement5Times;

    @InjectView(R.id.achievement_10_times)
    ImageView achievement10Times;

    @InjectView(R.id.achievement_heart)
    ImageView achievementHeart;

    @InjectViews({R.id.achievement_1st_time, R.id.achievement_2_year, R.id.achievement_3_year,
        R.id.achievement_5_times, R.id.achievement_10_times, R.id.achievement_heart})
    List<ImageView> achievementImages;

    private AchievementsPresenter achievementsPresenter;

    public AchievementsFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_achievements, container, false);
        ButterKnife.inject(this, view);

// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/presenters/AchievementsPresenter.java
// public interface AchievementsPresenter extends BasePresenter {
// 
//     public void loadAchievements();
// }
// 
// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/presenters/impl/AchievementsPresenterImpl.java
// public class AchievementsPresenterImpl implements AchievementsPresenter {
// 
//     private boolean canceled;
// 
//     private AchievementsView achievementsView;
// 
//     public AchievementsPresenterImpl(AchievementsView achievementsView) {
//         this.achievementsView = achievementsView;
//     }
// 
//     @Override
//     public void loadAchievements() {
//         achievementsView.showProgress();
//         User.getInstance().getUserDonations(findCallback);
//     }
// 
//     private FindCallback<ParseObject> findCallback = new FindCallback<ParseObject>() {
//         @Override
//         public void done(List<ParseObject> parseObjects, ParseException e) {
// 
//             if (canceled) {
//                 return;
//             }
// 
//             achievementsView.hideProgress();
//             if (parseObjects == null) {
//                 parseObjects = new ArrayList<>();
//             }
// 
//             boolean[] achievements = new boolean[6];
//             achievements[0] = parseObjects.size() >= 1;
//             achievements[3] = parseObjects.size() >= 5;
//             achievements[4] = parseObjects.size() >= 10;
//             achievements[5] = parseObjects.size() >= 15;
// 
//             achievementsView.showAchievements(achievements);
//         }
//     };
// 
//     @Override
//     public void cancel() {
//         canceled = true;
//     }
// }
// 
// Path: app/src/main/java/hr/foi/rsc/lifeline/mvp/views/AchievementsView.java
// public interface AchievementsView extends BaseView {
// 
//     public void showAchievements(boolean[] achievements);
// }


// Path: app/src/main/java/hr/foi/rsc/lifeline/fragments/AchievementsFragment.java
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.List;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.InjectViews;
import hr.foi.rsc.lifeline.R;
import hr.foi.rsc.lifeline.mvp.presenters.AchievementsPresenter;
import hr.foi.rsc.lifeline.mvp.presenters.impl.AchievementsPresenterImpl;
import hr.foi.rsc.lifeline.mvp.views.AchievementsView;

package hr.foi.rsc.lifeline.fragments;




public class AchievementsFragment extends BaseFragment implements AchievementsView {

    @InjectView(R.id.achievement_1st_time)
    ImageView achievement1stTime;

    @InjectView(R.id.achievement_2_year)
    ImageView achievement2Year;

    @InjectView(R.id.achievement_3_year)
    ImageView achievement3Year;

    @InjectView(R.id.achievement_5_times)
    ImageView achievement5Times;

    @InjectView(R.id.achievement_10_times)
    ImageView achievement10Times;

    @InjectView(R.id.achievement_heart)
    ImageView achievementHeart;

    @InjectViews({R.id.achievement_1st_time, R.id.achievement_2_year, R.id.achievement_3_year,
        R.id.achievement_5_times, R.id.achievement_10_times, R.id.achievement_heart})
    List<ImageView> achievementImages;

    private AchievementsPresenter achievementsPresenter;

    public AchievementsFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_achievements, container, false);
        ButterKnife.inject(this, view);

        achievementsPresenter = new AchievementsPresenterImpl(this);