// Path: src/com/spokenpic/net/JsonData.java
// public static class ChangePassData extends JsonData {
// 	public String old_password;
// 	public String password;
// }
// 
// Path: src/com/spokenpic/net/JsonData.java
// public static class LoginResult extends JsonData {
// 	public String email;
// 	public String key;
// 	public String username;
// 	public String password;
// 	public Integer pk = null; // An integer key
// 
// }
// 
// Path: src/com/spokenpic/net/JsonData.java
// public static class RestResult {
// 	public int httpCode = 0;
// 	public String payload = null;
// 	public Boolean ok = false;
// }
// 
// Path: src/com/spokenpic/net/RestClient.java
// public static interface RestClientListener {
// 	void onRestFinished(RestResult result);
// }
// 
// Path: src/com/spokenpic/net/RestClientPut.java
// public class RestClientPut extends RestClient {
// 
// 	public RestClientPut(String uri, String data) {
// 		super(uri, data);
// 	}
// 
// 	@Override
// 	protected RestResult doPost() {
// 		HttpPut httpPut = new HttpPut(getSchemeServer()+this.uri);
// 		setupHttp(httpPut);
// 		try {
// 			StringEntity data = new StringEntity(this.data, "UTF-8");
// 			data.setChunked(false);
// 			httpPut.setEntity(data);
// 			httpPut.setHeader("Content-type", "application/json");
// 			HttpResponse httpResponse = HttpManager.execute(httpPut);
// 			return returnResponse(httpResponse);
// 		} catch (Exception e) {
// 			Log.d("RestClientFilePUT", "Error doPost: " + e.toString());
// 			return errorResponse("Fatal error during PUT");
// 		}
// 	}
// 
// }
// 
// Path: src/com/spokenpic/utils/LazyProgressDialog.java
// public class LazyProgressDialog extends ProgressDialog {
// 	Activity mActivity;
// 	public LazyProgressDialog(Activity activity) {
// 		super(activity);
// 		mActivity = activity;
// 	}
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate) {
// 		return show(context, title, message, indeterminate, false, null);
// 	}
// 
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable) {
// 		return show(context, title, message, indeterminate, cancelable, null);
// 	}
// 
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable, DialogInterface.OnCancelListener cancelListener) {
// 		LazyProgressDialog d = new LazyProgressDialog(context);
// 		d.setTitle(title);
// 		d.setMessage(message);
// 		d.setIndeterminate(indeterminate);
// 		d.setCancelable(cancelable);
// 		if (cancelListener != null) d.setOnCancelListener(cancelListener);
// 		d.show();
// 		return d;
// 	}
// 	
// 	
// 	public void onStart() {
// 		int orientation = App.getInstance().getResources().getConfiguration().orientation;
// 		if(orientation == Configuration.ORIENTATION_LANDSCAPE) {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// 		} else if(orientation == Configuration.ORIENTATION_PORTRAIT) {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// 		} else {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
// 		}
// 	}
// 
// 	protected void onStop() {
// 		mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
// 	}
// 	
// 	@Override
// 	public void dismiss() {
// 		try {
// 			super.dismiss();
// 		} catch (Exception e) {}
// 	}
// }


import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuItem;
import com.google.gson.Gson;
import com.spokenpic.net.JsonData.ChangePassData;
import com.spokenpic.net.JsonData.LoginResult;
import com.spokenpic.net.JsonData.RestResult;
import com.spokenpic.net.RestClient.RestClientListener;
import com.spokenpic.net.RestClientPut;
import com.spokenpic.utils.LazyProgressDialog;
				}
			}
		};

		newPasswordText.addTextChangedListener(passCheck);
		newPasswordText2.addTextChangedListener(passCheck);

		changeOk.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

				pd = LazyProgressDialog.show(ViewChangePass.this, null, getString(R.string.connecting), true, true);
				ChangePassData data = new ChangePassData();
				data.old_password = passwordText.getText().toString();
				data.password = newPasswordText.getText().toString();

				//Log.d("Changepass", "PUT: " + "/api/v1/changepassword/" + AppPreferences.getPk() + "/"  + " ---> " + data.toString());
				RestClientPut client = new RestClientPut("/api/v1/changepassword/" + App.getInstance().getPk() + "/", data.toString());
				client.useSSL(true);
				client.backgroundConnect(ViewChangePass.this);
			}
		});

	}

	public void onRestFinished(RestResult result) {
		if (pd != null) pd.dismiss();
		if (result != null) {
			if (result.ok) {
				//Log.d("Changepass", result.payload);
				LoginResult data = new Gson().fromJson(result.payload, LoginResult.class);
// Path: src/com/spokenpic/net/JsonData.java
// public static class ChangePassData extends JsonData {
// 	public String old_password;
// 	public String password;
// }
// 
// Path: src/com/spokenpic/net/JsonData.java
// public static class LoginResult extends JsonData {
// 	public String email;
// 	public String key;
// 	public String username;
// 	public String password;
// 	public Integer pk = null; // An integer key
// 
// }
// 
// Path: src/com/spokenpic/net/JsonData.java
// public static class RestResult {
// 	public int httpCode = 0;
// 	public String payload = null;
// 	public Boolean ok = false;
// }
// 
// Path: src/com/spokenpic/net/RestClient.java
// public static interface RestClientListener {
// 	void onRestFinished(RestResult result);
// }
// 
// Path: src/com/spokenpic/net/RestClientPut.java
// public class RestClientPut extends RestClient {
// 
// 	public RestClientPut(String uri, String data) {
// 		super(uri, data);
// 	}
// 
// 	@Override
// 	protected RestResult doPost() {
// 		HttpPut httpPut = new HttpPut(getSchemeServer()+this.uri);
// 		setupHttp(httpPut);
// 		try {
// 			StringEntity data = new StringEntity(this.data, "UTF-8");
// 			data.setChunked(false);
// 			httpPut.setEntity(data);
// 			httpPut.setHeader("Content-type", "application/json");
// 			HttpResponse httpResponse = HttpManager.execute(httpPut);
// 			return returnResponse(httpResponse);
// 		} catch (Exception e) {
// 			Log.d("RestClientFilePUT", "Error doPost: " + e.toString());
// 			return errorResponse("Fatal error during PUT");
// 		}
// 	}
// 
// }
// 
// Path: src/com/spokenpic/utils/LazyProgressDialog.java
// public class LazyProgressDialog extends ProgressDialog {
// 	Activity mActivity;
// 	public LazyProgressDialog(Activity activity) {
// 		super(activity);
// 		mActivity = activity;
// 	}
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate) {
// 		return show(context, title, message, indeterminate, false, null);
// 	}
// 
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable) {
// 		return show(context, title, message, indeterminate, cancelable, null);
// 	}
// 
// 	public static LazyProgressDialog show (Activity context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable, DialogInterface.OnCancelListener cancelListener) {
// 		LazyProgressDialog d = new LazyProgressDialog(context);
// 		d.setTitle(title);
// 		d.setMessage(message);
// 		d.setIndeterminate(indeterminate);
// 		d.setCancelable(cancelable);
// 		if (cancelListener != null) d.setOnCancelListener(cancelListener);
// 		d.show();
// 		return d;
// 	}
// 	
// 	
// 	public void onStart() {
// 		int orientation = App.getInstance().getResources().getConfiguration().orientation;
// 		if(orientation == Configuration.ORIENTATION_LANDSCAPE) {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// 		} else if(orientation == Configuration.ORIENTATION_PORTRAIT) {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// 		} else {
// 			mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
// 		}
// 	}
// 
// 	protected void onStop() {
// 		mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
// 	}
// 	
// 	@Override
// 	public void dismiss() {
// 		try {
// 			super.dismiss();
// 		} catch (Exception e) {}
// 	}
// }


// Path: src/com/spokenpic/ViewChangePass.java
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuItem;
import com.google.gson.Gson;
import com.spokenpic.net.JsonData.ChangePassData;
import com.spokenpic.net.JsonData.LoginResult;
import com.spokenpic.net.JsonData.RestResult;
import com.spokenpic.net.RestClient.RestClientListener;
import com.spokenpic.net.RestClientPut;
import com.spokenpic.utils.LazyProgressDialog;

				}
			}
		};

		newPasswordText.addTextChangedListener(passCheck);
		newPasswordText2.addTextChangedListener(passCheck);

		changeOk.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

				pd = LazyProgressDialog.show(ViewChangePass.this, null, getString(R.string.connecting), true, true);
				ChangePassData data = new ChangePassData();
				data.old_password = passwordText.getText().toString();
				data.password = newPasswordText.getText().toString();

				//Log.d("Changepass", "PUT: " + "/api/v1/changepassword/" + AppPreferences.getPk() + "/"  + " ---> " + data.toString());
				RestClientPut client = new RestClientPut("/api/v1/changepassword/" + App.getInstance().getPk() + "/", data.toString());
				client.useSSL(true);
				client.backgroundConnect(ViewChangePass.this);
			}
		});

	}

	public void onRestFinished(RestResult result) {
		if (pd != null) pd.dismiss();
		if (result != null) {
			if (result.ok) {
				//Log.d("Changepass", result.payload);
				LoginResult data = new Gson().fromJson(result.payload, LoginResult.class);
				App.getInstance().setKey(data.key);