// Path: MobileOrg/src/main/java/com/matburt/mobileorg/gui/wizard/FolderAdapter.java
// public class FolderAdapter extends ArrayAdapter<String> {
// 	private int currentChecked = -1;
// 	private DirectoryBrowser<?> directory;
// 	private Button doneButton;
// 
// 	public FolderAdapter(Context context, int resource, ArrayList<String> list) {
// 		super(context, resource, list);
// 	}
// 
// 	public void setDirectoryBrowser(DirectoryBrowser<?> d) {
// 		directory = d;
// 	}
// 
// 	public String getCheckedDirectory() {
// 		if (currentChecked == -1)
// 			return "";
// 		// (Toast.makeText(context, directory.getAbsolutePath(currentChecked),
// 		// Toast.LENGTH_LONG)).show();
// 		return directory.getAbsolutePath(currentChecked);
// 	}
// 
// 	public void setDoneButton(Button b) {
// 		doneButton = b;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View row = convertView;
// 		TextView folder = null;
// 		CheckBox check = null;
// 		if (row == null) {
// 			LayoutInflater inflater = LayoutInflater.from(getContext());
// 			row = inflater.inflate(R.layout.folder_adapter_row, parent, false);
// 			folder = (TextView) row.findViewById(R.id.folder);
// 			folder.setOnClickListener(new View.OnClickListener() {
// 
// 				@Override
// 				public void onClick(View folder) {
// 					int position = (Integer) folder.getTag();
// 					// FolderAdapter.this.clear();
// 					directory.browseTo(position);
// 					currentChecked = -1;
// 					FolderAdapter.this.notifyDataSetChanged();
// 					doneButton.setEnabled(false);
// 				}
// 			});
// 			check = (CheckBox) row.findViewById(R.id.checkbox);
// 			check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// 
// 				public void onCheckedChanged(CompoundButton buttonView,
// 						boolean isChecked) {
// 					// update last checked position
// 					int position = (Integer) buttonView.getTag();
// 					if (isChecked)
// 						currentChecked = position;
// 					else if (currentChecked == position)
// 						currentChecked = -1;
// 					FolderAdapter.this.notifyDataSetChanged();
// 					if (isChecked)
// 						doneButton.setEnabled(true);
// 				}
// 			});
// 		}
// 		folder = (TextView) row.findViewById(R.id.folder);
// 		folder.setText(directory.getDirectoryName(position));
// 		folder.setTag(Integer.valueOf(position));
// 		check = (CheckBox) row.findViewById(R.id.checkbox);
// 		// disable the "Up one level" checkbox; otherwise make sure its enabled
// 		if (position == 0 && !directory.isCurrentDirectoryRoot())
// 			check.setEnabled(false);
// 		else
// 			check.setEnabled(true);
// 		check.setTag(Integer.valueOf(position));
// 		// set check state. only one can be checked
// 		boolean status = (currentChecked == position) ? true : false;
// 		check.setChecked(status);
// 		return (row);
// 	}
// }
// 
// Path: MobileOrg/src/main/java/com/matburt/mobileorg/gui/wizard/LocalDirectoryBrowser.java
// public class LocalDirectoryBrowser extends DirectoryBrowser<File> {
// 
// 	public LocalDirectoryBrowser(Context context) {
// 		super(context);
// 		
// 		browseTo(File.separator);
// 	}
// 	
// 	@Override
// 	public boolean isCurrentDirectoryRoot() {
// 		return currentDirectory.getParent() == null;
// 	}
// 
// 	@Override
// 	public void browseTo(int position) {
// 		File newdir = getDir(position);
// 		browseTo(newdir.getAbsolutePath());
// 	}
// 
// 	@Override
// 	public void browseTo(String directory) {
// 		currentDirectory = new File(directory);
// 		directoryNames.clear();
// 		directoryListing.clear();
// 		if (currentDirectory.getParent() != null) {
// 			directoryNames.add(upOneLevel);
// 			directoryListing.add(currentDirectory.getParentFile());
// 		}
// 		File[] tmpListing = currentDirectory.listFiles();
// 		// default list order doesn't seem to be alpha
// 		Arrays.sort(tmpListing);
// 		for (File dir : tmpListing) {
// 			if (dir.isDirectory() && dir.canWrite()) {
// 				directoryNames.add(dir.getName());
// 				directoryListing.add(dir);
// 			}
// 		}
// 	}
// }


import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.ListView;
import com.matburt.mobileorg.gui.wizard.FolderAdapter;
import com.matburt.mobileorg.gui.wizard.LocalDirectoryBrowser;
import com.matburt.mobileorg.R;
package com.matburt.mobileorg.gui.wizard.wizards;



public class SDCardWizard extends AppCompatActivity {
	
	private FolderAdapter directoryAdapter;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.wizard_folder_pick_list);

// Path: MobileOrg/src/main/java/com/matburt/mobileorg/gui/wizard/FolderAdapter.java
// public class FolderAdapter extends ArrayAdapter<String> {
// 	private int currentChecked = -1;
// 	private DirectoryBrowser<?> directory;
// 	private Button doneButton;
// 
// 	public FolderAdapter(Context context, int resource, ArrayList<String> list) {
// 		super(context, resource, list);
// 	}
// 
// 	public void setDirectoryBrowser(DirectoryBrowser<?> d) {
// 		directory = d;
// 	}
// 
// 	public String getCheckedDirectory() {
// 		if (currentChecked == -1)
// 			return "";
// 		// (Toast.makeText(context, directory.getAbsolutePath(currentChecked),
// 		// Toast.LENGTH_LONG)).show();
// 		return directory.getAbsolutePath(currentChecked);
// 	}
// 
// 	public void setDoneButton(Button b) {
// 		doneButton = b;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View row = convertView;
// 		TextView folder = null;
// 		CheckBox check = null;
// 		if (row == null) {
// 			LayoutInflater inflater = LayoutInflater.from(getContext());
// 			row = inflater.inflate(R.layout.folder_adapter_row, parent, false);
// 			folder = (TextView) row.findViewById(R.id.folder);
// 			folder.setOnClickListener(new View.OnClickListener() {
// 
// 				@Override
// 				public void onClick(View folder) {
// 					int position = (Integer) folder.getTag();
// 					// FolderAdapter.this.clear();
// 					directory.browseTo(position);
// 					currentChecked = -1;
// 					FolderAdapter.this.notifyDataSetChanged();
// 					doneButton.setEnabled(false);
// 				}
// 			});
// 			check = (CheckBox) row.findViewById(R.id.checkbox);
// 			check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// 
// 				public void onCheckedChanged(CompoundButton buttonView,
// 						boolean isChecked) {
// 					// update last checked position
// 					int position = (Integer) buttonView.getTag();
// 					if (isChecked)
// 						currentChecked = position;
// 					else if (currentChecked == position)
// 						currentChecked = -1;
// 					FolderAdapter.this.notifyDataSetChanged();
// 					if (isChecked)
// 						doneButton.setEnabled(true);
// 				}
// 			});
// 		}
// 		folder = (TextView) row.findViewById(R.id.folder);
// 		folder.setText(directory.getDirectoryName(position));
// 		folder.setTag(Integer.valueOf(position));
// 		check = (CheckBox) row.findViewById(R.id.checkbox);
// 		// disable the "Up one level" checkbox; otherwise make sure its enabled
// 		if (position == 0 && !directory.isCurrentDirectoryRoot())
// 			check.setEnabled(false);
// 		else
// 			check.setEnabled(true);
// 		check.setTag(Integer.valueOf(position));
// 		// set check state. only one can be checked
// 		boolean status = (currentChecked == position) ? true : false;
// 		check.setChecked(status);
// 		return (row);
// 	}
// }
// 
// Path: MobileOrg/src/main/java/com/matburt/mobileorg/gui/wizard/LocalDirectoryBrowser.java
// public class LocalDirectoryBrowser extends DirectoryBrowser<File> {
// 
// 	public LocalDirectoryBrowser(Context context) {
// 		super(context);
// 		
// 		browseTo(File.separator);
// 	}
// 	
// 	@Override
// 	public boolean isCurrentDirectoryRoot() {
// 		return currentDirectory.getParent() == null;
// 	}
// 
// 	@Override
// 	public void browseTo(int position) {
// 		File newdir = getDir(position);
// 		browseTo(newdir.getAbsolutePath());
// 	}
// 
// 	@Override
// 	public void browseTo(String directory) {
// 		currentDirectory = new File(directory);
// 		directoryNames.clear();
// 		directoryListing.clear();
// 		if (currentDirectory.getParent() != null) {
// 			directoryNames.add(upOneLevel);
// 			directoryListing.add(currentDirectory.getParentFile());
// 		}
// 		File[] tmpListing = currentDirectory.listFiles();
// 		// default list order doesn't seem to be alpha
// 		Arrays.sort(tmpListing);
// 		for (File dir : tmpListing) {
// 			if (dir.isDirectory() && dir.canWrite()) {
// 				directoryNames.add(dir.getName());
// 				directoryListing.add(dir);
// 			}
// 		}
// 	}
// }


// Path: MobileOrg/src/main/java/com/matburt/mobileorg/gui/wizard/wizards/SDCardWizard.java
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.ListView;
import com.matburt.mobileorg.gui.wizard.FolderAdapter;
import com.matburt.mobileorg.gui.wizard.LocalDirectoryBrowser;
import com.matburt.mobileorg.R;

package com.matburt.mobileorg.gui.wizard.wizards;



public class SDCardWizard extends AppCompatActivity {
	
	private FolderAdapter directoryAdapter;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.wizard_folder_pick_list);

		LocalDirectoryBrowser directory = new LocalDirectoryBrowser(this);