add proxy suport to TutorialBuddyStatusActivity
This commit is contained in:
parent
4e7ae1bc8f
commit
54e8339b7d
3 changed files with 35 additions and 11 deletions
|
@ -1,18 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
|
||||
<EditText android:layout_height="wrap_content" android:id="@+id/AddressId" android:hint="sip:user@host:port" android:layout_width="fill_parent" android:layout_weight="1" android:text="sip:[user@]host[:port]"></EditText>
|
||||
<Button android:layout_height="wrap_content" android:id="@+id/CallButton" android:text="Call" android:layout_width="wrap_content"></Button>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="fill_parent" android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<EditText android:layout_height="wrap_content" android:id="@+id/AddressId"
|
||||
android:hint="sip:user@host:port" android:layout_width="fill_parent"
|
||||
android:layout_weight="1" android:text="sip:[user@]host[:port]"></EditText>
|
||||
<Button android:layout_height="wrap_content" android:id="@+id/CallButton"
|
||||
android:text="Call" android:layout_width="wrap_content"></Button>
|
||||
|
||||
</LinearLayout><EditText android:hint="password" android:id="@+id/Password" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone"></EditText>
|
||||
</LinearLayout>
|
||||
<EditText android:layout_height="wrap_content" android:id="@+id/MyAddressId"
|
||||
android:hint="enter my sip identity (sip:[user@]host)" android:layout_width="fill_parent"
|
||||
android:visibility="gone" android:text=""></EditText>
|
||||
<EditText android:hint="my password" android:id="@+id/Password"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
android:visibility="gone"></EditText>
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/OutputText" android:text="Debug"></TextView>
|
||||
<TextView android:layout_weight="1" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" android:id="@+id/OutputText"
|
||||
android:text="Debug"></TextView>
|
||||
|
||||
<Button android:text="STOP" android:id="@+id/ButtonStop" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
|
||||
<Button android:text="STOP" android:id="@+id/ButtonStop"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -38,6 +38,9 @@ public class TutorialBuddyStatusActivity extends Activity {
|
|||
|
||||
private static final String defaultSipAddress = "sip:";
|
||||
private TextView sipAddressWidget;
|
||||
private TextView mySipAddressWidget;
|
||||
private TextView mySipPasswordWidget;
|
||||
|
||||
private TutorialBuddyStatus tutorial;
|
||||
private Handler mHandler = new Handler() ;
|
||||
private Button buttonCall;
|
||||
|
@ -49,6 +52,12 @@ public class TutorialBuddyStatusActivity extends Activity {
|
|||
sipAddressWidget = (TextView) findViewById(R.id.AddressId);
|
||||
sipAddressWidget.setText(defaultSipAddress);
|
||||
|
||||
mySipAddressWidget = (TextView) findViewById(R.id.MyAddressId);
|
||||
mySipAddressWidget.setVisibility(View.VISIBLE);
|
||||
mySipPasswordWidget = (TextView) findViewById(R.id.Password);
|
||||
mySipPasswordWidget.setVisibility(TextView.VISIBLE);
|
||||
|
||||
|
||||
// Output text to the outputText widget
|
||||
final TextView outputText = (TextView) findViewById(R.id.OutputText);
|
||||
final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
|
||||
|
@ -84,7 +93,9 @@ public class TutorialBuddyStatusActivity extends Activity {
|
|||
public void run() {
|
||||
super.run();
|
||||
try {
|
||||
tutorial.launchTutorial(sipAddressWidget.getText().toString());
|
||||
String myIdentity = mySipAddressWidget.getText().length()>0?mySipAddressWidget.getText().toString():null;
|
||||
String myPassword = mySipPasswordWidget.getText().length()>0?mySipPasswordWidget.getText().toString():null;
|
||||
tutorial.launchTutorial(sipAddressWidget.getText().toString(), myIdentity, myPassword);
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
buttonCall.setEnabled(true);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a9db49b15aee38098d23086fd574adb99a1afda3
|
||||
Subproject commit e559cf6defcc5e517f8116b314b399e8cec9a26d
|
Loading…
Reference in a new issue