Updated RadioButtons in ConfigureTransProxy
All the RadioButtons are unchecked by default. The next button is disabled until a RadioButton is checked.
This commit is contained in:
parent
eb3a09ae06
commit
fbdeb71974
|
@ -42,7 +42,7 @@
|
||||||
android:padding="3px">
|
android:padding="3px">
|
||||||
<TextView android:text="@string/wizard_transproxy_msg" android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody1" android:padding="20dip"></TextView>
|
<TextView android:text="@string/wizard_transproxy_msg" android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody1" android:padding="20dip"></TextView>
|
||||||
<RadioGroup android:id="@+id/radioGroup" android:layout_height="wrap_content" android:layout_width="wrap_content" android:paddingLeft="15dip">
|
<RadioGroup android:id="@+id/radioGroup" android:layout_height="wrap_content" android:layout_width="wrap_content" android:paddingLeft="15dip">
|
||||||
<RadioButton android:checked="true" android:text="@string/wizard_configure_all" android:id="@+id/radio0" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
|
<RadioButton android:text="@string/wizard_configure_all" android:id="@+id/radio0" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
|
||||||
<TextView android:layout_height="wrap_content"
|
<TextView android:layout_height="wrap_content"
|
||||||
android:text="@string/wizard_transproxy_hint"
|
android:text="@string/wizard_transproxy_hint"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -57,6 +57,32 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
|
||||||
String title = context.getString(R.string.wizard_transproxy_title);
|
String title = context.getString(R.string.wizard_transproxy_title);
|
||||||
TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
|
TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
|
||||||
txtTitle.setText(title);
|
txtTitle.setText(title);
|
||||||
|
|
||||||
|
Button back = ((Button)findViewById(R.id.btnWizard1));
|
||||||
|
Button next = ((Button)findViewById(R.id.btnWizard2));
|
||||||
|
next.setEnabled(false);
|
||||||
|
|
||||||
|
back.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
next.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
//Dirty flag variable - improve logic
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if( flag == 1 )
|
||||||
|
context.startActivity(new Intent(context, AppManager.class));
|
||||||
|
|
||||||
|
else
|
||||||
|
showWizardFinal();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
RadioGroup mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup);
|
RadioGroup mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup);
|
||||||
mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener (){
|
mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener (){
|
||||||
|
@ -65,6 +91,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(RadioGroup group, int checkedId){
|
public void onCheckedChanged(RadioGroup group, int checkedId){
|
||||||
Button next = ((Button)findViewById(R.id.btnWizard2));
|
Button next = ((Button)findViewById(R.id.btnWizard2));
|
||||||
|
next.setEnabled(true);
|
||||||
next.setOnClickListener(new View.OnClickListener() {
|
next.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,30 +147,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button back = ((Button)findViewById(R.id.btnWizard1));
|
|
||||||
Button next = ((Button)findViewById(R.id.btnWizard2));
|
|
||||||
|
|
||||||
back.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
next.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
|
||||||
//Dirty flag variable - improve logic
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if( flag == 1 )
|
|
||||||
context.startActivity(new Intent(context, AppManager.class));
|
|
||||||
|
|
||||||
else
|
|
||||||
showWizardFinal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showWizardFinal ()
|
private void showWizardFinal ()
|
||||||
|
|
Loading…
Reference in New Issue