// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/preferences/InfoPreferences.java
// public class InfoPreferences {
//     private static final String INFO_PREFERENCES = "InfoPreferences";
//     private static final String ALREADY_SEEN = INFO_PREFERENCES + ".AlreadySeen";
//     public static final String FROM_MENU = INFO_PREFERENCES + ".FromMenu";
//     private final SharedPreferences sharedPreferences;
// 
//     protected InfoPreferences(SharedPreferences sharedPreferences) {
//         this.sharedPreferences = sharedPreferences;
//     }
// 
//     public static InfoPreferences newInstance() {
//         Context context = ContextRetriever.INSTANCE.getApplicationContext();
//         SharedPreferences sharedPreferences = context.getSharedPreferences(INFO_PREFERENCES,
//                 Context.MODE_PRIVATE);
// 
//         return new InfoPreferences(sharedPreferences);
//     }
// 
//     public boolean shouldShowInfo() {
//         return !sharedPreferences.getBoolean(ALREADY_SEEN, false);
//     }
// 
//     public void markInfoAsSeen() {
//         sharedPreferences.edit().putBoolean(ALREADY_SEEN, true).apply();
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/LifeCreationSlide.java
// public class LifeCreationSlide extends SlideFragmentWithWorld {
// 
//     @Override
//     protected World instantiateWorld() {
//         return EmptyWorld.newInstance();
//     }
// 
//     @Override
//     protected int getSlideLayoutId() {
//         return R.layout.intro_life_creation;
//     }
// 
//     @Override
//     protected int getWorldViewId() {
//         return R.id.life_creation_world;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/PresentationSlide.java
// public class PresentationSlide extends SlideFragmentWithWorld {
// 
//     @Override
//     protected World instantiateWorld() {
//         return World.newInstance();
//     }
// 
//     @Override
//     protected int getSlideLayoutId() {
//         return R.layout.intro_presentation;
//     }
// 
//     @Override
//     protected int getWorldViewId() {
//         return R.id.life_presentation_world;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/RulesSlide.java
// public class RulesSlide extends SlideFragmentWithoutWorld {
//     @Override
//     protected int getLayoutId() {
//         return R.layout.intro_rules;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/WellcomeSlide.java
// public class WellcomeSlide extends SlideFragmentWithoutWorld {
// 
//     @Override
//     protected int getLayoutId() {
//         return R.layout.intro_welcome;
//     }
// }


import android.os.Bundle;
import com.github.paolorotolo.appintro.AppIntro2;
import com.juankysoriano.materiallife.info.preferences.InfoPreferences;
import com.juankysoriano.materiallife.info.slides.LifeCreationSlide;
import com.juankysoriano.materiallife.info.slides.PresentationSlide;
import com.juankysoriano.materiallife.info.slides.RulesSlide;
import com.juankysoriano.materiallife.info.slides.WellcomeSlide;
package com.juankysoriano.materiallife.info;



public class InfoActivity extends AppIntro2 {
    private static final int OFF_SCREEN_PAGE_LIMIT = 3;
    private final InfoPreferences infoPreferences;

    public InfoActivity() {
        super();
        infoPreferences = InfoPreferences.newInstance();
    }

    @Override
    public void init(Bundle savedInstanceState) {
        addSlide(new WellcomeSlide(), getApplicationContext());
        addSlide(new PresentationSlide(), getApplicationContext());
        addSlide(new RulesSlide(), getApplicationContext());
        addSlide(new LifeCreationSlide(), getApplicationContext());
        setOffScreenPageLimit(OFF_SCREEN_PAGE_LIMIT);
    }

    @Override
    public void onDonePressed() {
        done();
    }

    private void done() {
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/preferences/InfoPreferences.java
// public class InfoPreferences {
//     private static final String INFO_PREFERENCES = "InfoPreferences";
//     private static final String ALREADY_SEEN = INFO_PREFERENCES + ".AlreadySeen";
//     public static final String FROM_MENU = INFO_PREFERENCES + ".FromMenu";
//     private final SharedPreferences sharedPreferences;
// 
//     protected InfoPreferences(SharedPreferences sharedPreferences) {
//         this.sharedPreferences = sharedPreferences;
//     }
// 
//     public static InfoPreferences newInstance() {
//         Context context = ContextRetriever.INSTANCE.getApplicationContext();
//         SharedPreferences sharedPreferences = context.getSharedPreferences(INFO_PREFERENCES,
//                 Context.MODE_PRIVATE);
// 
//         return new InfoPreferences(sharedPreferences);
//     }
// 
//     public boolean shouldShowInfo() {
//         return !sharedPreferences.getBoolean(ALREADY_SEEN, false);
//     }
// 
//     public void markInfoAsSeen() {
//         sharedPreferences.edit().putBoolean(ALREADY_SEEN, true).apply();
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/LifeCreationSlide.java
// public class LifeCreationSlide extends SlideFragmentWithWorld {
// 
//     @Override
//     protected World instantiateWorld() {
//         return EmptyWorld.newInstance();
//     }
// 
//     @Override
//     protected int getSlideLayoutId() {
//         return R.layout.intro_life_creation;
//     }
// 
//     @Override
//     protected int getWorldViewId() {
//         return R.id.life_creation_world;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/PresentationSlide.java
// public class PresentationSlide extends SlideFragmentWithWorld {
// 
//     @Override
//     protected World instantiateWorld() {
//         return World.newInstance();
//     }
// 
//     @Override
//     protected int getSlideLayoutId() {
//         return R.layout.intro_presentation;
//     }
// 
//     @Override
//     protected int getWorldViewId() {
//         return R.id.life_presentation_world;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/RulesSlide.java
// public class RulesSlide extends SlideFragmentWithoutWorld {
//     @Override
//     protected int getLayoutId() {
//         return R.layout.intro_rules;
//     }
// }
// 
// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/slides/WellcomeSlide.java
// public class WellcomeSlide extends SlideFragmentWithoutWorld {
// 
//     @Override
//     protected int getLayoutId() {
//         return R.layout.intro_welcome;
//     }
// }


// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/info/InfoActivity.java
import android.os.Bundle;
import com.github.paolorotolo.appintro.AppIntro2;
import com.juankysoriano.materiallife.info.preferences.InfoPreferences;
import com.juankysoriano.materiallife.info.slides.LifeCreationSlide;
import com.juankysoriano.materiallife.info.slides.PresentationSlide;
import com.juankysoriano.materiallife.info.slides.RulesSlide;
import com.juankysoriano.materiallife.info.slides.WellcomeSlide;

package com.juankysoriano.materiallife.info;



public class InfoActivity extends AppIntro2 {
    private static final int OFF_SCREEN_PAGE_LIMIT = 3;
    private final InfoPreferences infoPreferences;

    public InfoActivity() {
        super();
        infoPreferences = InfoPreferences.newInstance();
    }

    @Override
    public void init(Bundle savedInstanceState) {
        addSlide(new WellcomeSlide(), getApplicationContext());
        addSlide(new PresentationSlide(), getApplicationContext());
        addSlide(new RulesSlide(), getApplicationContext());
        addSlide(new LifeCreationSlide(), getApplicationContext());
        setOffScreenPageLimit(OFF_SCREEN_PAGE_LIMIT);
    }

    @Override
    public void onDonePressed() {
        done();
    }

    private void done() {
        infoPreferences.markInfoAsSeen();