erased main activity

This commit is contained in:
root 2018-06-15 20:29:15 +02:00
parent 78145f1cba
commit b46f007305
2 changed files with 14 additions and 64 deletions

View File

@ -17,13 +17,15 @@ public class MainActivity extends AppCompatActivity {
/** Called when the user taps the Send button */ /** Called when the user taps the Send button */
public void sendMessage(View view) { public void sendMessage(View view) {
EditText editText1 = (EditText) findViewById(R.id.ipAddress); //EditText editText1 = (EditText) findViewById(R.id.ipAddress);
// String ipAddress = editText1.getText().toString(); //String ipAddress = editText1.getText().toString();
String ipAddress = "172.16.202.14"; //String ipAddress = "172.16.202.14";
String ipAddress = "10.0.0.60";
int port = 502; int port = 502;
EditText editText2 = (EditText) findViewById(R.id.port); //EditText editText2 = (EditText) findViewById(R.id.port);
// int port = Integer.parseInt(editText2.getText().toString()); //int port = Integer.parseInt(editText2.getText().toString());
GlobalState state = (GlobalState) getApplicationContext(); GlobalState state = (GlobalState) getApplicationContext();
state.setIpAddress(ipAddress); state.setIpAddress(ipAddress);

View File

@ -6,69 +6,17 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity">
<EditText
android:id="@+id/ipAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="@+id/count"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/ip_address" />
<Button <Button
android:id="@+id/button" android:id="@+id/button"
android:layout_width="0dp" android:layout_width="91dp"
android:layout_height="wrap_content" android:layout_height="51dp"
android:layout_marginEnd="16dp" android:layout_marginBottom="16dp"
android:layout_marginStart="16dp" android:layout_marginEnd="8dp"
android:layout_marginTop="16dp" android:layout_marginStart="8dp"
android:onClick="sendMessage" android:onClick="sendMessage"
android:text="@string/button_send" android:text="@string/button_send"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toEndOf="@+id/ipAddress"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/port"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ipAddress"
tools:text="@string/ip_port" />
<EditText
android:id="@+id/ref"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/port"
tools:text="@string/ip_ref" />
<EditText
android:id="@+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ref"
tools:text="@string/ip_count" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>