SSH is working again :D
WLAN ON OFF is working New design in progress
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 407 KiB |
@ -41,7 +41,7 @@ private AppBarConfiguration mAppBarConfiguration;
|
||||
Intent m = new Intent(getApplicationContext(),MainActivity.class);
|
||||
startActivity(m);
|
||||
}
|
||||
}, 6000);
|
||||
}, 4000);
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import de.jg_cody.Terraplex.R;
|
||||
import de.jg_cody.Terraplex.SSH_connection;
|
||||
|
||||
public class HomeFragment extends Fragment {
|
||||
|
||||
@ -25,6 +26,9 @@ public class HomeFragment extends Fragment {
|
||||
public static EditText userInput;
|
||||
public static EditText passwordInput;
|
||||
Button loginButton;
|
||||
Button wlan_aus_Button;
|
||||
Button wlan_an_Button;
|
||||
|
||||
|
||||
private HomeViewModel homeViewModel;
|
||||
|
||||
@ -50,10 +54,28 @@ public class HomeFragment extends Fragment {
|
||||
user = userInput.getText().toString();
|
||||
password = passwordInput.getText().toString();
|
||||
ip = ipInput.getText().toString();
|
||||
}
|
||||
});
|
||||
wlan_aus_Button = (Button) root.findViewById(R.id.wlan_aus);
|
||||
wlan_aus_Button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Toast.makeText(root.getContext(),ip,Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(root.getContext(),user,Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(root.getContext(),password,Toast.LENGTH_SHORT).show();
|
||||
try {
|
||||
SSH_connection.executeRemoteCommand(ip, user, password, "service hostapd stop");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
wlan_an_Button = (Button) root.findViewById(R.id.wlan_an);
|
||||
wlan_an_Button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
try {
|
||||
SSH_connection.executeRemoteCommand(ip, user, password, "service hostapd start");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
return root;
|
||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 182 KiB |
15
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108"
|
||||
android:tint="#000000">
|
||||
<group android:scaleX="0.46"
|
||||
android:scaleY="0.46"
|
||||
android:translateX="29.16"
|
||||
android:translateY="29.16">
|
||||
<group android:translateY="82.96875">
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
Before Width: | Height: | Size: 55 KiB |
BIN
app/src/main/res/drawable/teraplex_sidebar.png
Normal file
After Width: | Height: | Size: 34 KiB |
@ -39,7 +39,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="#FFFFFF"
|
||||
android:ems="10"
|
||||
android:hint="ip-address"
|
||||
android:hint="IP-Adresse"
|
||||
android:inputType="text"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
@ -54,7 +54,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="#FFFFFF"
|
||||
android:ems="10"
|
||||
android:hint="user"
|
||||
android:hint="Benutzername"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
@ -70,7 +70,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="#FFFFFF"
|
||||
android:ems="10"
|
||||
android:hint="password"
|
||||
android:hint="Passwort"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
@ -88,5 +88,40 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordInput" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wlan_an"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:text="AN"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.269"
|
||||
app:layout_constraintStart_toEndOf="@+id/wlan_aus"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordInput" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wlan_aus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:text="AUS"
|
||||
app:layout_constraintEnd_toStartOf="@+id/wlan_an"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordInput" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="376dp"
|
||||
android:layout_height="28dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="WLAN"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wlan_aus"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
android:layout_height="75dp"
|
||||
android:contentDescription="@string/nav_header_desc"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
app:srcCompat="@drawable/jg_cody_white" />
|
||||
app:srcCompat="@drawable/teraplex_sidebar" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 265 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 54 KiB |