// Path: app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/helpers/PrefManager.java
// public class PrefManager {
//     public static final String PREF_SAVE_REAL_IMAGE_TO_HISTORY = "pref_save_real_image_to_history";
// 
//     private final SharedPreferences pref;
//     private final SharedPreferences.Editor editor;
// 
//     // shared pref mode
//     private final int PRIVATE_MODE = 0;
// 
//     // Shared preferences file name
//     private static final String PREF_NAME = "privacy_friendly_apps";
// 
//     private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
// 
//     public PrefManager(Context context) {
//         pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
//         editor = pref.edit();
//     }
// 
//     public void setFirstTimeLaunch(boolean isFirstTime) {
//         editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
//         editor.commit();
//     }
// 
//     public boolean isFirstTimeLaunch() {
//         return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
//     }
// 
// }


import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.secuso.privacyfriendlycodescanner.qrscanner.R;
import com.secuso.privacyfriendlycodescanner.qrscanner.helpers.PrefManager;
            dots[currentPage].setTextColor(colorsActive[currentPage]);
    }

    private int getItem(int i) {
        return viewPager.getCurrentItem() + i;
    }

    private void launchHomeScreen() {
        prefManager.setFirstTimeLaunch(false);
        Intent intent = new Intent(this, ScannerActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    //  viewpager change listener
    ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            addBottomDots(position);

            // changing the next button text 'NEXT' / 'GOT IT'
            if (position == layouts.length - 1) {
                // last page. make button text to GOT IT
                btnNext.setText(R.string.okay);
                btnSkip.setVisibility(View.GONE);
            } else {
                // still pages are left
                btnNext.setText(R.string.next);
// Path: app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/helpers/PrefManager.java
// public class PrefManager {
//     public static final String PREF_SAVE_REAL_IMAGE_TO_HISTORY = "pref_save_real_image_to_history";
// 
//     private final SharedPreferences pref;
//     private final SharedPreferences.Editor editor;
// 
//     // shared pref mode
//     private final int PRIVATE_MODE = 0;
// 
//     // Shared preferences file name
//     private static final String PREF_NAME = "privacy_friendly_apps";
// 
//     private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
// 
//     public PrefManager(Context context) {
//         pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
//         editor = pref.edit();
//     }
// 
//     public void setFirstTimeLaunch(boolean isFirstTime) {
//         editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
//         editor.commit();
//     }
// 
//     public boolean isFirstTimeLaunch() {
//         return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
//     }
// 
// }


// Path: app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/TutorialActivity.java
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.secuso.privacyfriendlycodescanner.qrscanner.R;
import com.secuso.privacyfriendlycodescanner.qrscanner.helpers.PrefManager;

            dots[currentPage].setTextColor(colorsActive[currentPage]);
    }

    private int getItem(int i) {
        return viewPager.getCurrentItem() + i;
    }

    private void launchHomeScreen() {
        prefManager.setFirstTimeLaunch(false);
        Intent intent = new Intent(this, ScannerActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    //  viewpager change listener
    ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            addBottomDots(position);

            // changing the next button text 'NEXT' / 'GOT IT'
            if (position == layouts.length - 1) {
                // last page. make button text to GOT IT
                btnNext.setText(R.string.okay);
                btnSkip.setVisibility(View.GONE);
            } else {
                // still pages are left
                btnNext.setText(R.string.next);
                btnSkip.setVisibility(View.VISIBLE);