<string name="use_ssl">Use Secure Connection</string>
<string name="location_no_provider">ownCloud cannot track your device. Please check your location settings</string>
- <string name="pincode_enter_pin_code">Please, insert your PIN code</string>
- <string name="pincode_enter_new_pin_code">Please, insert your new PIN code</string>
- <string name="pincode_configure_your_pin">Configure your PIN code</string>
- <string name="pincode_confirm_your_pincode">"Confirm your PIN code, please"</string>
+ <string name="pincode_enter_pin_code">Please, insert your App PIN</string>
+ <string name="pincode_enter_new_pin_code">Please, insert your new App PIN</string>
+ <string name="pincode_configure_your_pin">Enter ownCloud App PIN</string>
+ <string name="pincode_reenter_your_pincode">Reenter ownCloud App PIN, please;</string>
+ <string name="pincode_remove_your_pincode">Remove your ownCloud App PIN;</string>
+ <string name="pincode_mismatch">Both ownCloud App PIN are not the same;</string>
+ <string name="pincode_wrong">Incorrect ownCloud App PIN;</string>
+
<string-array name="prefs_trackmydevice_intervall_keys">
<item>15 Minutes</item>
<string name="common_rename">Rename</string>
<string name="common_remove">Remove</string>
- <string name="confirmation_alert_prefix">"Do you really want "</string>
- <string name="confirmation_alert_suffix">"?"</string>
-
- <string name="remove_success_msg">"Successful removal"</string>
- <string name="remove_fail_msg">"Removal could not be completed"</string>
-
+ <string name="confirmation_alert_prefix">Do you really want </string>
+ <string name="confirmation_alert_suffix">"?"</string>
+
+ <string name="remove_success_msg">"Successful removal"</string>
+ <string name="remove_fail_msg">"Removal could not be completed"</string>
+
</resources>
boolean pinCodeChecked = false;
boolean newPasswordEntered = false;
boolean bChange = true; // to control that only one blocks jump
- int tCounter ; // Count the number of attempts an user could introduce de PIN code
+ int tCounter ; // Count the number of attempts an user could introduce the PIN code
protected void onCreate(Bundle savedInstanceState) {
mPinHdr = (TextView) findViewById(R.id.pinHdr);
mText1 = (EditText) findViewById(R.id.txt1);
mText1.requestFocus();
- getWindow().setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+ getWindow().setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
mText2 = (EditText) findViewById(R.id.txt2);
mText3 = (EditText) findViewById(R.id.txt3);
mText4 = (EditText) findViewById(R.id.txt4);
pinCodeChecked = true;
newPasswordEntered = true;
- }else if (appPrefs.getBoolean("set_pincode", false)){
- if (activity.equals("preferences")){
- mPinHdr.setText(R.string.pincode_configure_your_pin);
- setChangePincodeView(true);
- }else{
- bCancel.setVisibility(View.INVISIBLE);
- bCancel.setVisibility(View.GONE);
- mPinHdr.setText(R.string.pincode_enter_pin_code);
- setChangePincodeView(false);
- }
+ }else{
- }else {
- mPinHdr.setText(R.string.pincode_enter_pin_code);
- pinCodeChecked = true;
- setChangePincodeView(true);
- }
+ if (appPrefs.getBoolean("set_pincode", false)){
+ // pincode activated
+ if (activity.equals("preferences")){
+ // PIN has been activated yet
+ mPinHdr.setText(R.string.pincode_configure_your_pin);
+ pinCodeChecked = true ; // No need to check it
+ setChangePincodeView(true);
+ }else{
+ // PIN active
+ bCancel.setVisibility(View.INVISIBLE);
+ bCancel.setVisibility(View.GONE);
+ mPinHdr.setText(R.string.pincode_enter_pin_code);
+ setChangePincodeView(false);
+ }
+
+ }else {
+ // pincode removal
+ mPinHdr.setText(R.string.pincode_enter_pin_code);
+ pinCodeChecked = false;
+ setChangePincodeView(true);
+ }
-
+ }
setTextListeners();
}
-
+
+ protected void setInitVars(){
+ confirmingPinCode = false;
+ pinCodeChecked = false;
+ newPasswordEntered = false;
+
+ }
protected void setInitView(){
bCancel.setVisibility(View.INVISIBLE);
boolean state = appPrefs.getBoolean("set_pincode", false);
appPrefsE.putBoolean("set_pincode",!state);
appPrefsE.commit();
-
+ setInitVars();
finish();
}
});
.getDefaultSharedPreferences(getApplicationContext()).edit();
appPrefs.putBoolean("set_pincode",false);
appPrefs.commit();
+
+ setInitVars();
pinCodeEnd(false);
}else{
if (!confirmingPinCode && !newPasswordEntered){
pinCodeChangeRequest();
} else if (newPasswordEntered && !confirmingPinCode){
- mPinHdr.setText(R.string.pincode_confirm_your_pincode);
+ mPinHdr.setText(R.string.pincode_reenter_your_pincode);
confirmingPinCode = true;
clearBoxes();
} else {
protected void pinCodeChangeRequest(){
clearBoxes();
- mPinHdr.setText(R.string.pincode_confirm_your_pincode);
+ mPinHdr.setText(R.string.pincode_reenter_your_pincode);
confirmingPinCode =true;
}
}else {
AlertDialog aDialog = new AlertDialog.Builder(this).create();
aDialog.setTitle("ERROR");
- aDialog.setMessage("Wrong PIN");
+ CharSequence cseq = getString(R.string.pincode_wrong);
+ aDialog.setMessage(cseq);
aDialog.setButton("OK", new DialogInterface.OnClickListener(){
@Override
});
aDialog.show();
clearBoxes();
- mPinHdr.setText(R.string.pincode_configure_your_pin);
+ mPinHdr.setText(R.string.pincode_enter_pin_code);
newPasswordEntered = true;
confirmingPinCode = false;
AlertDialog aDialog = new AlertDialog.Builder(this).create();
aDialog.setTitle("ERROR");
- aDialog.setMessage("PIN Code Mismatch");
+ CharSequence cseq = getString(R.string.pincode_mismatch);
+ aDialog.setMessage(cseq);
aDialog.setButton("OK", new DialogInterface.OnClickListener(){
@Override
public boolean onKeyDown(int keyCode, KeyEvent event){
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
+ if (activity.equals("preferences")){
+ SharedPreferences.Editor appPrefsE = PreferenceManager
+
+ .getDefaultSharedPreferences(getApplicationContext()).edit();
+
+ SharedPreferences appPrefs = PreferenceManager
+ .getDefaultSharedPreferences(getApplicationContext());
+ boolean state = appPrefs.getBoolean("set_pincode", false);
+ appPrefsE.putBoolean("set_pincode",!state);
+ appPrefsE.commit();
+ setInitVars();
+ finish();
+ }
return true;
}