// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String ACTIVE_CODE_NUMBER = "ACTIVE_CODE_NUMBER";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String EPCODING = "EPCODING";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int MODIFIER_REQUEST_CODE = 1;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String SAVE_TEMP_ADDED_MODIFIERS = "SAVE_TEMP_ADDED_MODIFIERS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int SEDATION_REQUEST_CODE = 2;


import android.app.AlertDialog;
import androidx.fragment.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static org.epstudios.epcoding.Constants.ACTIVE_CODE_NUMBER;
import static org.epstudios.epcoding.Constants.EPCODING;
import static org.epstudios.epcoding.Constants.MODIFIER_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SAVE_TEMP_ADDED_MODIFIERS;
import static org.epstudios.epcoding.Constants.SEDATION_REQUEST_CODE;
package org.epstudios.epcoding;




class Utilities {

    public static Map<String, CodeCheckBox> createCheckBoxLayoutAndCodeMap(
            Code[] codes, LinearLayout layout, Context context,
            final ScreenSlidePageFragment fragment) {
        Map<String, CodeCheckBox> map = new LinkedHashMap<>();
        for (Code code : codes) {
            final CodeCheckBox codeCheckBox = new CodeCheckBox(context);
            final Context theContext = context;
            codeCheckBox.setCodeFirst(true);
            codeCheckBox.setCode(code);
            map.put(code.getCodeNumber(), codeCheckBox);
            codeCheckBox.setOnLongClickListener(view -> {
                Intent intent = new Intent(theContext, ModifierActivity.class);
                intent.putExtra(ACTIVE_CODE_NUMBER, codeCheckBox.getCodeNumber());
                intent.putExtra(SAVE_TEMP_ADDED_MODIFIERS, true);
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String ACTIVE_CODE_NUMBER = "ACTIVE_CODE_NUMBER";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String EPCODING = "EPCODING";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int MODIFIER_REQUEST_CODE = 1;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String SAVE_TEMP_ADDED_MODIFIERS = "SAVE_TEMP_ADDED_MODIFIERS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int SEDATION_REQUEST_CODE = 2;


// Path: app/src/main/java/org/epstudios/epcoding/Utilities.java
import android.app.AlertDialog;
import androidx.fragment.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static org.epstudios.epcoding.Constants.ACTIVE_CODE_NUMBER;
import static org.epstudios.epcoding.Constants.EPCODING;
import static org.epstudios.epcoding.Constants.MODIFIER_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SAVE_TEMP_ADDED_MODIFIERS;
import static org.epstudios.epcoding.Constants.SEDATION_REQUEST_CODE;

package org.epstudios.epcoding;




class Utilities {

    public static Map<String, CodeCheckBox> createCheckBoxLayoutAndCodeMap(
            Code[] codes, LinearLayout layout, Context context,
            final ScreenSlidePageFragment fragment) {
        Map<String, CodeCheckBox> map = new LinkedHashMap<>();
        for (Code code : codes) {
            final CodeCheckBox codeCheckBox = new CodeCheckBox(context);
            final Context theContext = context;
            codeCheckBox.setCodeFirst(true);
            codeCheckBox.setCode(code);
            map.put(code.getCodeNumber(), codeCheckBox);
            codeCheckBox.setOnLongClickListener(view -> {
                Intent intent = new Intent(theContext, ModifierActivity.class);
                intent.putExtra(ACTIVE_CODE_NUMBER, codeCheckBox.getCodeNumber());
                intent.putExtra(SAVE_TEMP_ADDED_MODIFIERS, true);
                fragment.startActivityForResult(intent, MODIFIER_REQUEST_CODE);