src/com/beem/project/beem/ui/ContactListSettings.java
changeset 185 16373c4cd733
parent 170 e892a47de086
child 186 7aec70b9ca79
equal deleted inserted replaced
184:e9d73490be9b 185:16373c4cd733
    63 	    String value = parent.getSelectedItem().toString();
    63 	    String value = parent.getSelectedItem().toString();
    64 	    LinearLayout ll = (LinearLayout) findViewById(R.id.proxy_layout);
    64 	    LinearLayout ll = (LinearLayout) findViewById(R.id.proxy_layout);
    65 	    SharedPreferences.Editor editor = mSettings.edit();
    65 	    SharedPreferences.Editor editor = mSettings.edit();
    66 	    LayoutParams lp = (LayoutParams) ll.getLayoutParams();
    66 	    LayoutParams lp = (LayoutParams) ll.getLayoutParams();
    67 	    if (value.equals(getString(R.string.PreferenceProxyTypeNone))) {
    67 	    if (value.equals(getString(R.string.PreferenceProxyTypeNone))) {
    68 		ll.setVisibility(LinearLayout.INVISIBLE);		
    68 		ll.setVisibility(LinearLayout.INVISIBLE);
    69 		lp.height = 0;
    69 		lp.height = 0;
    70 		ll.setLayoutParams(lp);
    70 		ll.setLayoutParams(lp);
    71 		editor.putBoolean(getString(R.string.PreferenceUseProxy), false);
    71 		editor.putBoolean(getString(R.string.PreferenceUseProxy), false);
    72 	    } else {
    72 	    } else {
    73 		ll.setVisibility(LinearLayout.VISIBLE);
    73 		ll.setVisibility(LinearLayout.VISIBLE);
    94 
    94 
    95 	    if (isChanged(R.id.host, R.string.PreferenceHostKey)) {
    95 	    if (isChanged(R.id.host, R.string.PreferenceHostKey)) {
    96 		editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host));
    96 		editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host));
    97 		mIsChanged = true;
    97 		mIsChanged = true;
    98 	    }
    98 	    }
    99 	    if (Integer.parseInt(getWidgetText(R.id.port)) != mSettings.getInt(getString(R.string.PreferencePortKey), 5222) ) {
    99 	    if (Integer.parseInt(getWidgetText(R.id.port)) != mSettings.getInt(getString(R.string.PreferencePortKey),
       
   100 		5222)) {
   100 		editor.putInt(getString(R.string.PreferencePortKey), Integer.parseInt(getWidgetText(R.id.port)));
   101 		editor.putInt(getString(R.string.PreferencePortKey), Integer.parseInt(getWidgetText(R.id.port)));
   101 		mIsChanged = true;
   102 		mIsChanged = true;
   102 	    }
   103 	    }
   103 	    if (isChanged(R.id.userid, R.string.PreferenceLoginKey)) {
   104 	    if (isChanged(R.id.userid, R.string.PreferenceLoginKey)) {
   104 		editor.putString(getString(R.string.PreferenceLoginKey), getWidgetText(R.id.userid));
   105 		editor.putString(getString(R.string.PreferenceLoginKey), getWidgetText(R.id.userid));
   129 	    }
   130 	    }
   130 	    if (isChanged(R.id.proxy_pwd, R.string.PreferenceProxyPassword)) {
   131 	    if (isChanged(R.id.proxy_pwd, R.string.PreferenceProxyPassword)) {
   131 		editor.putString(getString(R.string.PreferenceProxyPassword), getWidgetText(R.id.proxy_pwd));
   132 		editor.putString(getString(R.string.PreferenceProxyPassword), getWidgetText(R.id.proxy_pwd));
   132 		mIsChanged = true;
   133 		mIsChanged = true;
   133 	    }
   134 	    }
   134 
       
   135 	    if (mIsChanged == true) {
   135 	    if (mIsChanged == true) {
   136 		editor.commit();
   136 		editor.commit();
   137 		setResult(RESULT_OK);
   137 		setResult(RESULT_OK);
   138 	    } else
   138 	    } else
   139 		setResult(RESULT_CANCELED);
   139 		setResult(RESULT_CANCELED);