diff --git a/app/src/main/java/im/ricochet/androidod/ConnectActivity.java b/app/src/main/java/im/ricochet/androidod/ConnectActivity.java
index 6aeb106..b56f22d 100644
--- a/app/src/main/java/im/ricochet/androidod/ConnectActivity.java
+++ b/app/src/main/java/im/ricochet/androidod/ConnectActivity.java
@@ -2,7 +2,6 @@ package im.ricochet.androidod;
import android.content.SharedPreferences;
import android.os.AsyncTask;
-import android.os.StrictMode;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
@@ -11,11 +10,6 @@ import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.Socket;
-
import goRicochetMobile.GoRicochetMobile;
public class ConnectActivity extends AppCompatActivity {
@@ -26,8 +20,10 @@ public class ConnectActivity extends AppCompatActivity {
Button regenButton;
Button connectButton;
- ProgressBar spinner;
- TextView progressText;
+ ProgressBar connectSpinner;
+ ProgressBar regenIdentSpinner;
+ TextView connectStatusText;
+ TextView regenIdentStatusText;
TextView idetityText;
@@ -40,11 +36,13 @@ public class ConnectActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(im.ricochet.androidod.R.layout.activity_connect);
- progressText = (TextView)findViewById(R.id.progressTextView);
+ connectStatusText = (TextView)findViewById(R.id.connectStatusTextView);
+ regenIdentStatusText = (TextView)findViewById(R.id.regenIdentStatusText);
idetityText = (TextView)findViewById(R.id.identityTextView);
regenButton = (Button)findViewById(R.id.regenIdentButton);
connectButton = (Button)findViewById(R.id.connectButton);
- spinner = (ProgressBar)findViewById(R.id.progressBar);
+ connectSpinner = (ProgressBar)findViewById(R.id.connectProgressBar);
+ regenIdentSpinner = (ProgressBar)findViewById(R.id.regenIdentProgressBar);
regenButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -68,7 +66,7 @@ public class ConnectActivity extends AppCompatActivity {
}
/*Log.i(TAG, "Ready!");
- progressText.setText("Ready!");
+ connectStatusText.setText("Ready!");
ProgressBar progressBar = (ProgressBar)findViewById(im.ricochet.androidod.R.id.progressBar);
progressBar.setVisibility(View.GONE);
@@ -95,8 +93,8 @@ public class ConnectActivity extends AppCompatActivity {
Log.i(TAG, "RegenIdentTask.onPreExecute()");
regenButton.setEnabled(false);
connectButton.setEnabled(false);
- progressText.setText("Generating new identity...");
- spinner.setVisibility(View.VISIBLE);
+ regenIdentStatusText.setText("Generating new identity...");
+ regenIdentSpinner.setVisibility(View.VISIBLE);
}
@Override
@@ -120,13 +118,13 @@ public class ConnectActivity extends AppCompatActivity {
@Override
protected void onPostExecute(String privateKey) {
Log.i(TAG, "RegenIdentTask.onPostExecute(): " + privateKey);
- spinner.setVisibility(View.INVISIBLE);
+ regenIdentSpinner.setVisibility(View.INVISIBLE);
regenButton.setEnabled(true);
connectButton.setEnabled(true);
if (privateKey == null) {
- progressText.setText("ERROR: unable to generate new identity");
+ regenIdentStatusText.setText("ERROR: unable to generate new identity");
} else {
- progressText.setText("");
+ regenIdentStatusText.setText("");
setIdentity(privateKey);
}
}
diff --git a/app/src/main/res/layout/activity_connect.xml b/app/src/main/res/layout/activity_connect.xml
index 1bf525c..1f427e4 100644
--- a/app/src/main/res/layout/activity_connect.xml
+++ b/app/src/main/res/layout/activity_connect.xml
@@ -7,15 +7,16 @@
tools:context="im.ricochet.androidod.im.ricochet.androidod.ConnectActivity">
+ app:layout_constraintTop_toBottomOf="@+id/addressText"
+ android:layout_marginStart="8dp" />
+ app:layout_constraintTop_toBottomOf="@+id/textView"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
+ app:layout_constraintTop_toBottomOf="@+id/addressText"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
+ app:layout_constraintRight_toRightOf="parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
+ app:layout_constraintTop_toBottomOf="@+id/connectStatusTextView"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
+ app:layout_constraintLeft_toLeftOf="parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
@@ -118,7 +126,6 @@
android:layout_marginTop="32dp"
android:text="Identity:"
app:layout_constraintTop_toBottomOf="@+id/textView5"
- android:layout_marginLeft="0dp"
app:layout_constraintLeft_toLeftOf="@+id/regenIdentButton" />
+ android:layout_marginStart="8dp" />
+ app:layout_constraintTop_toBottomOf="@+id/textView6"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp" />
+
+
+
+
+