author | kejun.gao <kejun.gao@amlogic.com> | 2012-06-05 06:13:12 (GMT) |
---|---|---|
committer | kejun.gao <kejun.gao@amlogic.com> | 2012-06-05 06:13:12 (GMT) |
commit | 0fbcd66cf0ad3bc6fcf0884d5f959fc93f66a5db (patch) | |
tree | cd58c13b655f86764cc8e9113341c14d635ae9dc | |
parent | a2b3b396a8cf28a21c814914d2902d7b9826572d (diff) | |
download | PPPoE-0fbcd66cf0ad3bc6fcf0884d5f959fc93f66a5db.zip PPPoE-0fbcd66cf0ad3bc6fcf0884d5f959fc93f66a5db.tar.gz PPPoE-0fbcd66cf0ad3bc6fcf0884d5f959fc93f66a5db.tar.bz2 |
Add Checkbox for Auto Dial on Reboot
-rwxr-xr-x | res/layout/pppoe_configure.xml | 18 | ||||
-rwxr-xr-x | res/values-zh-rCN/strings.xml | 2 | ||||
-rwxr-xr-x | res/values-zh-rTW/strings.xml | 2 | ||||
-rwxr-xr-x | res/values/strings.xml | 2 | ||||
-rwxr-xr-x | src/com/amlogic/PPPoE/PppoeConfigDialog.java | 19 |
5 files changed, 28 insertions, 15 deletions
diff --git a/res/layout/pppoe_configure.xml b/res/layout/pppoe_configure.xml index b840872..762a6dc 100755 --- a/res/layout/pppoe_configure.xml +++ b/res/layout/pppoe_configure.xml @@ -15,13 +15,20 @@ android:padding="0dip" android:orientation="vertical"> + <CheckBox + android:id="@+id/auto_dial_checkbox" + style="?android:attr/textAppearanceSmallInverse" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pppoe_auto_dial" /> + <TextView android:id="@+id/network_interface_list_text" style="?android:attr/textAppearanceSmallInverse" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="8dip" android:text="@string/network_interface_list" /> - + <!-- The entries will be set programmatically --> <Spinner android:id="@+id/network_inteface_list_spinner" android:layout_width="fill_parent" @@ -49,14 +56,7 @@ android:layout_height="wrap_content" android:layout_marginTop="2dip" android:password="true"/> - <CheckBox - android:id="@+id/auto_dial" - style="?android:attr/textAppearanceSmallInverse" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/pppoe_auto_dial" /> - - </LinearLayout> + </LinearLayout> </LinearLayout> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 4a61036..adf1f29 100755 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -18,5 +18,5 @@ <string name="pppoe_disconnect_failed">宽带拨号断开失败</string> <string name="pppoe_ppp_interface_occupied">ppp接口被占用</string> <string name="amlogic_ok">确定</string> - <string name="pppoe_auto_dial">自动拨号</string> + <string name="pppoe_auto_dial">开机自动拨号</string> </resources> diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index ead88c8..92070f5 100755 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -18,5 +18,5 @@ <string name="pppoe_disconnect_failed">寬帶撥號断开失败</string> <string name="pppoe_ppp_interface_occupied">ppp接口被佔用</string> <string name="amlogic_ok">確定</string> - <string name="pppoe_auto_dial">自动撥號</string> + <string name="pppoe_auto_dial">開機自動撥號</string> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 972d7fb..6c88644 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -18,5 +18,5 @@ <string name="pppoe_disconnect_failed">Disconnect failed!</string> <string name="pppoe_ppp_interface_occupied">ppp interface occupied!</string> <string name="amlogic_ok">OK</string> - <string name="pppoe_auto_dial">automatic dial</string> + <string name="pppoe_auto_dial">Auto Dial on Reboot</string> </resources> diff --git a/src/com/amlogic/PPPoE/PppoeConfigDialog.java b/src/com/amlogic/PPPoE/PppoeConfigDialog.java index 291b04e..551e158 100755 --- a/src/com/amlogic/PPPoE/PppoeConfigDialog.java +++ b/src/com/amlogic/PPPoE/PppoeConfigDialog.java @@ -2,7 +2,6 @@ package com.amlogic.PPPoE; import java.util.Timer;
import java.util.TimerTask;
-import com.amlogic.PPPoE.R;
import android.os.Message;
import android.os.Handler;
import android.os.SystemProperties; @@ -19,6 +18,7 @@ import android.view.KeyEvent; import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
+import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.AdapterView;
@@ -162,10 +162,23 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On this.setView(mView = getLayoutInflater().inflate(R.layout.pppoe_configure, null));
mPppoeName = (EditText)mView.findViewById(R.id.pppoe_name_edit);
mPppoePasswd = (EditText)mView.findViewById(R.id.pppoe_passwd_edit);
- mCbAutoDial = (CheckBox)mView.findViewById(R.id.auto_dial);
+ mCbAutoDial = (CheckBox)mView.findViewById(R.id.auto_dial_checkbox);
+ mCbAutoDial.setVisibility(View.VISIBLE);
+ mCbAutoDial.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView,
+ boolean isChecked) {
+ // TODO Auto-generated method stub
+ if(isChecked){
+ Log.d(TAG, "Selected");
+ }else{
+ Log.d(TAG, "NO Selected");
+ }
+ }
+ });
+
mPppoeName.setEnabled(true);
mPppoePasswd.setEnabled(true);
- mCbAutoDial.setVisibility(View.GONE);
this.setInverseBackgroundForced(true);
network_if_list=new ArrayList<String>();
|