-Added functional UDP protocol for communication with arduino with a linux-compliant protocol. -Added a settings and main menu pannel -Expanded Controller UI with further support for shoulder buttons -Fixed Scaling Issue on Controller Pannelmain
parent
2ae98c8ab1
commit
f275cc8f0b
@ -0,0 +1,6 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="KotlinJpsPluginSettings"> |
||||||
|
<option name="version" value="1.7.20" /> |
||||||
|
</component> |
||||||
|
</project> |
||||||
@ -0,0 +1,87 @@ |
|||||||
|
package com.example.udptest000; |
||||||
|
|
||||||
|
import android.content.Intent; |
||||||
|
import android.content.SharedPreferences; |
||||||
|
import android.os.Bundle; |
||||||
|
import android.util.Log; |
||||||
|
import android.view.MotionEvent; |
||||||
|
import android.view.View; |
||||||
|
import android.widget.Button; |
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity; |
||||||
|
import androidx.preference.PreferenceManager; |
||||||
|
|
||||||
|
import java.util.Random; |
||||||
|
|
||||||
|
public class MainScreen extends AppCompatActivity { |
||||||
|
@Override protected void onCreate(Bundle savedInstanceState) { |
||||||
|
super.onCreate(savedInstanceState); |
||||||
|
setContentView(R.layout.activity_mainscreen); |
||||||
|
|
||||||
|
|
||||||
|
Button startbutt = findViewById(R.id.startbutt); |
||||||
|
Button settbutt = findViewById(R.id.settbutt); |
||||||
|
Button sendbutt = findViewById(R.id.sendbutt); |
||||||
|
|
||||||
|
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this); |
||||||
|
|
||||||
|
String ip = pref.getString("ip", "192.168.4.1"); |
||||||
|
String port = pref.getString("port", "9696"); |
||||||
|
boolean isHidden = pref.getBoolean("isHidden", false); |
||||||
|
String ssid = pref.getString("ssid", "ggwifi"); |
||||||
|
String pass = pref.getString("pass", "password"); |
||||||
|
int adminToken = Integer.parseInt(pref.getString("admintoken", "1234")); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
startbutt.setOnTouchListener(new View.OnTouchListener() { |
||||||
|
@Override |
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent) { |
||||||
|
Intent switchActivityIntent = new Intent(MainScreen.this, MainActivity.class); |
||||||
|
startActivity(switchActivityIntent); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
}); |
||||||
|
|
||||||
|
settbutt.setOnTouchListener(new View.OnTouchListener() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent) { |
||||||
|
Intent switchActivityIntent = new Intent(MainScreen.this, SettingsActivity.class); |
||||||
|
startActivity(switchActivityIntent); |
||||||
|
return true; |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
sendbutt.setOnTouchListener(new View.OnTouchListener() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent) { |
||||||
|
UDP_Client client = new UDP_Client(); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|LCIP:" + ip + "|;"; |
||||||
|
client.Send(); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|PORT:" + port + "|;"; |
||||||
|
client.Send(); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|HIDD:" + (isHidden?"1":"0") + "|;"; |
||||||
|
client.Send(); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|SSID:" + ssid + "|;"; |
||||||
|
client.Send(); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|PASS:" + pass + "|;"; |
||||||
|
client.Send(); |
||||||
|
|
||||||
|
Random rnd = new Random(System.currentTimeMillis()); |
||||||
|
int newtok = rnd.nextInt(100000); |
||||||
|
client.Message = "GG:1|PREF:" + String.valueOf(adminToken) + "|ATOK:" + String.valueOf(newtok) + "|;"; |
||||||
|
client.Send(); |
||||||
|
pref.edit().putString("admintoken", String.valueOf(newtok)).apply(); |
||||||
|
Log.d("TEST ", String.valueOf(newtok)); |
||||||
|
|
||||||
|
|
||||||
|
return true; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
package com.example.udptest000; |
||||||
|
|
||||||
|
import android.os.Bundle; |
||||||
|
import android.widget.EditText; |
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar; |
||||||
|
import androidx.appcompat.app.AppCompatActivity; |
||||||
|
import androidx.preference.EditTextPreference; |
||||||
|
import androidx.preference.PreferenceFragmentCompat; |
||||||
|
|
||||||
|
|
||||||
|
public class SettingsActivity extends AppCompatActivity { |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void onCreate(Bundle savedInstanceState) { |
||||||
|
super.onCreate(savedInstanceState); |
||||||
|
setContentView(R.layout.settings_activity); |
||||||
|
if (savedInstanceState == null) { |
||||||
|
getSupportFragmentManager() |
||||||
|
.beginTransaction() |
||||||
|
.replace(R.id.settings, new SettingsFragment()) |
||||||
|
.commit(); |
||||||
|
} |
||||||
|
ActionBar actionBar = getSupportActionBar(); |
||||||
|
if (actionBar != null) { |
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public static class SettingsFragment extends PreferenceFragmentCompat { |
||||||
|
@Override |
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { |
||||||
|
setPreferencesFromResource(R.xml.root_preferences, rootKey); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,291 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:context=".MainActivity"> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/r2b" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:text="R2" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline2" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline12" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline11" |
||||||
|
app:layout_constraintTop_toTopOf="parent" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/r1b" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="R1" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline17" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline16" |
||||||
|
app:layout_constraintTop_toBottomOf="@+id/r2b" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/start" |
||||||
|
android:layout_width="50dp" |
||||||
|
android:layout_height="25dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="Start" |
||||||
|
android:textSize="20sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline7" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline10" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline6" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/leftb2" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="←" |
||||||
|
android:textSize="34sp" |
||||||
|
app:cornerRadius="0dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline14" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline4" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline5" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline13" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/downb2" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="↓" |
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small" |
||||||
|
android:textSize="34sp" |
||||||
|
app:cornerRadius="0dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline7" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline3" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline4" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline14" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/upb2" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="↑" |
||||||
|
android:textSize="34sp" |
||||||
|
app:cornerRadius="0dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline13" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline3" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline4" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline6" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/rightb2" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="→" |
||||||
|
android:textSize="34sp" |
||||||
|
app:cornerRadius="0dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline14" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline8" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline3" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline13" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/leftb" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="X" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline14" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline16" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline11" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline13" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/upb" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="Y" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline13" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline17" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline16" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline6" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/select" |
||||||
|
android:layout_width="50dp" |
||||||
|
android:layout_height="25dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="Start" |
||||||
|
android:textSize="20sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline7" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline9" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline6" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/downb" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="A" |
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline7" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline17" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline16" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline14" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/rightb" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:insetTop="0dp" |
||||||
|
android:insetBottom="0dp" |
||||||
|
android:text="B" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline14" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline12" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline17" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline13" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline5" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.045143638" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline6" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.38" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline7" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.93" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline8" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.3515732" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline9" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.4" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline10" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.6" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline11" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.6497948" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline12" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.96" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline2" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.18" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/l2b" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="0dp" |
||||||
|
android:text="L2" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline2" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline8" |
||||||
|
app:layout_constraintHorizontal_bias="0.455" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline5" |
||||||
|
app:layout_constraintTop_toTopOf="parent" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/l1b" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="L1" |
||||||
|
android:textSize="24sp" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline3" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline4" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline2" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline3" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.25" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline4" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.15" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline13" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.56" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline14" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.75" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline16" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.75" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline17" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.85499316" /> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,65 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:context=".MainActivity"> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/startbutt" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="Start" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline19" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline18" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline15" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/settbutt" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="settings" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline20" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline18" |
||||||
|
app:layout_constraintHorizontal_bias="0.478" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline15" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline19" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline15" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.35" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline18" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_percent="0.65" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline19" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.65" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guideline20" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.9" /> |
||||||
|
|
||||||
|
<Button |
||||||
|
android:id="@+id/sendbutt" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="Send Config" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline20" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/guideline18" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guideline15" /> |
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent"> |
||||||
|
|
||||||
|
<FrameLayout |
||||||
|
android:id="@+id/settings" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" > |
||||||
|
|
||||||
|
<ScrollView |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent"> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" /> |
||||||
|
</ScrollView> |
||||||
|
</FrameLayout> |
||||||
|
</LinearLayout> |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
<resources> |
||||||
|
<!-- Reply Preference --> |
||||||
|
<string-array name="reply_entries"> |
||||||
|
<item>Reply</item> |
||||||
|
<item>Reply to all</item> |
||||||
|
</string-array> |
||||||
|
|
||||||
|
<string-array name="reply_values"> |
||||||
|
<item>reply</item> |
||||||
|
<item>reply_all</item> |
||||||
|
</string-array> |
||||||
|
</resources> |
||||||
@ -1,3 +1,7 @@ |
|||||||
<resources> |
<resources> |
||||||
<string name="app_name">UDPtest000</string> |
<string name="app_name">UDPtest000</string> |
||||||
|
<string name="title_activity_settings">SettingsActivity</string> |
||||||
|
<string name="title_activity_main">MainActivity</string> |
||||||
|
<string name="title_activity_main_screen">MainScreen</string> |
||||||
|
<string name="title_activity_main2">MainActivity2</string> |
||||||
</resources> |
</resources> |
||||||
@ -0,0 +1,53 @@ |
|||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"> |
||||||
|
|
||||||
|
<PreferenceCategory app:title="Network"> |
||||||
|
|
||||||
|
<EditTextPreference |
||||||
|
app:defaultValue="192.168.4.1" |
||||||
|
app:key="ip" |
||||||
|
app:title="IP address of microcontroller" |
||||||
|
app:useSimpleSummaryProvider="true" /> |
||||||
|
|
||||||
|
</PreferenceCategory> |
||||||
|
<EditTextPreference |
||||||
|
android:defaultValue="9696" |
||||||
|
android:key="port" |
||||||
|
android:selectAllOnFocus="true" |
||||||
|
android:singleLine="true" |
||||||
|
android:title="Port number" |
||||||
|
app:summary="Port" |
||||||
|
app:useSimpleSummaryProvider="true" /> |
||||||
|
<SwitchPreference |
||||||
|
android:defaultValue="false" |
||||||
|
android:key="isHidden" |
||||||
|
android:title="Hidden SSID?" /> |
||||||
|
<PreferenceCategory android:title="WIFI setup"> |
||||||
|
|
||||||
|
</PreferenceCategory> |
||||||
|
<EditTextPreference |
||||||
|
android:defaultValue="ggwifi" |
||||||
|
android:key="ssid" |
||||||
|
android:selectAllOnFocus="true" |
||||||
|
android:singleLine="true" |
||||||
|
android:title="Set SSID" |
||||||
|
app:useSimpleSummaryProvider="false" /> |
||||||
|
<EditTextPreference |
||||||
|
android:defaultValue="password" |
||||||
|
android:key="pass" |
||||||
|
android:selectAllOnFocus="true" |
||||||
|
android:singleLine="true" |
||||||
|
android:title="Set password" |
||||||
|
app:useSimpleSummaryProvider="false" /> |
||||||
|
<PreferenceCategory android:title="Advanced"> |
||||||
|
|
||||||
|
</PreferenceCategory> |
||||||
|
<EditTextPreference |
||||||
|
android:defaultValue="1234" |
||||||
|
android:key="admintoken" |
||||||
|
android:selectAllOnFocus="true" |
||||||
|
android:singleLine="true" |
||||||
|
android:title="Admin token" |
||||||
|
app:summary="HIDDEN" /> |
||||||
|
|
||||||
|
</PreferenceScreen> |
||||||
Loading…
Reference in new issue