// Path: app/src/main/java/org/bobstuff/bobball/Settings.java
// public class Settings {
// 
//     public static void setDefaultName (String defaultName){
//         Preferences.saveValue("defaultName",defaultName);
//     }
// 
//     public static String getDefaultName (){
//         Context context = Preferences.getContext();
//         return Preferences.loadValue("defaultName",context.getString(R.string.defaultName));
//     }
// 
//     public static void setNumPlayers (int numPlayers) {
//         Preferences.saveValue("numPlayers", "" + numPlayers);
//     }
// 
//     public static int getNumPlayers (){
//         return Integer.parseInt(Preferences.loadValue("numPlayers","1"));
//     }
// 
// 
//     public static void setLevelSelectionType (int type) {
//         Preferences.saveValue("levelSelectionType", "" + type);
//     }
// 
//     public static int getLevelSelectionType (){
//         return Integer.parseInt(Preferences.loadValue("levelSelectionType", "0"));
//     }
// 
// 
//     public static void setSelectedLevel (int level) {
//         Preferences.saveValue("selectedLevel","" + level);
//     }
// 
//     public static int getSelectLevel (){
//         return Integer.parseInt(Preferences.loadValue("selectedLevel", "1"));
//     }
// 
// 
//     public static void setLastLevelFailed (int lastLevel){
//         Preferences.saveValue("lastLevelFailed","" + lastLevel);
//     }
// 
//     public static int getLastLevelFailed (){
//         return Integer.parseInt(Preferences.loadValue("lastLevelFailed","0"));
//     }
// 
// 
//     public static void setRetryAction (int retryAction){
//         Preferences.saveValue("retryAction","" + retryAction);
//     }
// 
//     public static int getRetryAction (){
//         return Integer.parseInt(Preferences.loadValue("retryAction","0"));
//     }
// }
// 
// Path: app/src/main/java/org/bobstuff/bobball/Utilities.java
// public class Utilities extends Activity {
// 
// 	public static void arrayCopy(int[][] source,int[][] destination) {
// 		for (int a=0; a < source.length; ++a) {
// 			System.arraycopy(source[a], 0, destination[a], 0, source[a].length);
// 		}
// 	}
// 
// 	public static ArrayAdapter createDropdown (Context context, int count) {
// 		List<String> dropdownItems = new ArrayList<>();
// 
// 		for (int i = 1; i <= count; i++) { dropdownItems.add("" + i); }
// 
// 		ArrayAdapter adapter = new ArrayAdapter(context,android.R.layout.simple_spinner_item, dropdownItems);
// 
// 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 
// 		return adapter;
// 	}
// 
// 	public static ArrayAdapter createDropdownFromStrings (Context context, int stringsId){
// 		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(context, stringsId, android.R.layout.simple_spinner_item);
// 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 		return adapter;
// 	}
// }


import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Spinner;
import org.bobstuff.bobball.R;
import org.bobstuff.bobball.Settings;
import org.bobstuff.bobball.Utilities;
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
        setContentView(R.layout.menu_options);

        defaultNameInput = (EditText) findViewById(R.id.defaultName);
        defaultNameInput.setHint(Settings.getDefaultName());

        levelSelectSettings = (Spinner) findViewById(R.id.spinnerLevelSelect);
        retryActionSettings = (Spinner) findViewById(R.id.spinnerRetryAction);

        levelSelectSettings.setAdapter(Utilities.createDropdownFromStrings(this,R.array.levelSelectSettings));
        retryActionSettings.setAdapter(Utilities.createDropdownFromStrings(this,R.array.retryActionSettings));

        levelSelectSettings.setSelection(Settings.getLevelSelectionType());
        retryActionSettings.setSelection(Settings.getRetryAction());
    }

    public void cancel (View view) {
        finish();
    }

    public void confirm (View view){
        Editable value = defaultNameInput.getText();
        String defaultNameNew = value.toString().trim();

        if (! defaultNameNew.isEmpty()) {
            Settings.setDefaultName(defaultNameNew);
        }

        Settings.setLevelSelectionType(levelSelectSettings.getSelectedItemPosition());
// Path: app/src/main/java/org/bobstuff/bobball/Settings.java
// public class Settings {
// 
//     public static void setDefaultName (String defaultName){
//         Preferences.saveValue("defaultName",defaultName);
//     }
// 
//     public static String getDefaultName (){
//         Context context = Preferences.getContext();
//         return Preferences.loadValue("defaultName",context.getString(R.string.defaultName));
//     }
// 
//     public static void setNumPlayers (int numPlayers) {
//         Preferences.saveValue("numPlayers", "" + numPlayers);
//     }
// 
//     public static int getNumPlayers (){
//         return Integer.parseInt(Preferences.loadValue("numPlayers","1"));
//     }
// 
// 
//     public static void setLevelSelectionType (int type) {
//         Preferences.saveValue("levelSelectionType", "" + type);
//     }
// 
//     public static int getLevelSelectionType (){
//         return Integer.parseInt(Preferences.loadValue("levelSelectionType", "0"));
//     }
// 
// 
//     public static void setSelectedLevel (int level) {
//         Preferences.saveValue("selectedLevel","" + level);
//     }
// 
//     public static int getSelectLevel (){
//         return Integer.parseInt(Preferences.loadValue("selectedLevel", "1"));
//     }
// 
// 
//     public static void setLastLevelFailed (int lastLevel){
//         Preferences.saveValue("lastLevelFailed","" + lastLevel);
//     }
// 
//     public static int getLastLevelFailed (){
//         return Integer.parseInt(Preferences.loadValue("lastLevelFailed","0"));
//     }
// 
// 
//     public static void setRetryAction (int retryAction){
//         Preferences.saveValue("retryAction","" + retryAction);
//     }
// 
//     public static int getRetryAction (){
//         return Integer.parseInt(Preferences.loadValue("retryAction","0"));
//     }
// }
// 
// Path: app/src/main/java/org/bobstuff/bobball/Utilities.java
// public class Utilities extends Activity {
// 
// 	public static void arrayCopy(int[][] source,int[][] destination) {
// 		for (int a=0; a < source.length; ++a) {
// 			System.arraycopy(source[a], 0, destination[a], 0, source[a].length);
// 		}
// 	}
// 
// 	public static ArrayAdapter createDropdown (Context context, int count) {
// 		List<String> dropdownItems = new ArrayList<>();
// 
// 		for (int i = 1; i <= count; i++) { dropdownItems.add("" + i); }
// 
// 		ArrayAdapter adapter = new ArrayAdapter(context,android.R.layout.simple_spinner_item, dropdownItems);
// 
// 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 
// 		return adapter;
// 	}
// 
// 	public static ArrayAdapter createDropdownFromStrings (Context context, int stringsId){
// 		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(context, stringsId, android.R.layout.simple_spinner_item);
// 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 		return adapter;
// 	}
// }


// Path: app/src/main/java/org/bobstuff/bobball/Menus/menuOptions.java
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Spinner;
import org.bobstuff.bobball.R;
import org.bobstuff.bobball.Settings;
import org.bobstuff.bobball.Utilities;

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
        setContentView(R.layout.menu_options);

        defaultNameInput = (EditText) findViewById(R.id.defaultName);
        defaultNameInput.setHint(Settings.getDefaultName());

        levelSelectSettings = (Spinner) findViewById(R.id.spinnerLevelSelect);
        retryActionSettings = (Spinner) findViewById(R.id.spinnerRetryAction);

        levelSelectSettings.setAdapter(Utilities.createDropdownFromStrings(this,R.array.levelSelectSettings));
        retryActionSettings.setAdapter(Utilities.createDropdownFromStrings(this,R.array.retryActionSettings));

        levelSelectSettings.setSelection(Settings.getLevelSelectionType());
        retryActionSettings.setSelection(Settings.getRetryAction());
    }

    public void cancel (View view) {
        finish();
    }

    public void confirm (View view){
        Editable value = defaultNameInput.getText();
        String defaultNameNew = value.toString().trim();

        if (! defaultNameNew.isEmpty()) {
            Settings.setDefaultName(defaultNameNew);
        }

        Settings.setLevelSelectionType(levelSelectSettings.getSelectedItemPosition());
        Settings.setRetryAction(retryActionSettings.getSelectedItemPosition());