alert string update
This commit is contained in:
parent
c5d2d762b4
commit
e01c0c1145
@ -4,6 +4,7 @@ import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
import android.widget.EditText
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.example.flightgearcontrollerapp.R
|
||||
@ -27,11 +28,19 @@ class MainActivity : AppCompatActivity() {
|
||||
if (!isConnected) {
|
||||
val editTextIP = findViewById<EditText>(ip_address)
|
||||
val editTextPort = findViewById<EditText>(port_address)
|
||||
if (editTextIP.text.toString() ==""){
|
||||
Toast.makeText(applicationContext, "Please write IP address", Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
if (editTextPort.text.toString()==""){
|
||||
Toast.makeText(applicationContext, "Please write port address", Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
val builder = AlertDialog.Builder(this)
|
||||
builder.setTitle(getString(R.string.alert_dialog_flightgear_connection))
|
||||
builder.setMessage(getString(R.string.alert_instruction))
|
||||
builder.setPositiveButton(getString(R.string.ok_btn)){ dialog, _ ->
|
||||
if ((editTextIP.text.toString() !="")&&(editTextPort.text.toString()!="")&&(vmConnection.connectToFG(editTextIP.text.toString(),editTextPort.text.toString()))) {
|
||||
if (vmConnection.connectToFG(editTextIP.text.toString(),editTextPort.text.toString())) {
|
||||
btnConnection.setText(R.string.disconnect)
|
||||
isConnected = true
|
||||
} else {
|
||||
|
@ -138,13 +138,13 @@
|
||||
|
||||
<com.jackandphantom.joystickview.JoyStickView
|
||||
android:id="@+id/widget_joystick"
|
||||
android:layout_width="360sp"
|
||||
android:layout_height="360sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginBottom="-3dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
app:innerCircleColor="#f6FFFFFF"
|
||||
app:innerCircleImage="@drawable/ic_baseline_airplanemode_active_24"
|
||||
app:outerCircleBorderColor="#fff"
|
||||
@ -155,6 +155,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<GridLayout
|
||||
|
||||
android:layout_width="100sp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_40">
|
||||
@ -210,10 +211,13 @@
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.slider.Slider
|
||||
android:layout_width="390sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="30sp"
|
||||
android:layout_marginRight="30sp"
|
||||
android:layout_height="0sp"
|
||||
android:layout_weight="0"
|
||||
app:trackColorActive="@color/navy_blue_40"
|
||||
app:trackColorInactive="@color/navy_blue_40"
|
||||
android:value="0"
|
||||
android:valueFrom="-1"
|
||||
android:valueTo="1" />
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="txt_rudder">Rudder</string>
|
||||
<string name="disconnect">disconnect</string>
|
||||
<string name="alert_dialog_flightgear_connection">FlightGear Connection</string>
|
||||
<string name="alert_instruction">For connecting to FlightGear App,\nFirst open the app.\nThen, copy these lines to Setting-> Additional Setting:\n\n --generic=socket,in,10,\'ip\',\'port\',tcp,playback_small \n --fdm=null\n\n and now just press fly!</string>
|
||||
<string name="alert_instruction">For connecting to FlightGear App,\nFirst open the app.\nThen, copy these lines to Setting-> Additional Setting:\n\n --telnet=socket,in,10,\'ip\',\'port\',tcp,playback_small \n\n and now just press fly!</string>
|
||||
<string name="ok_btn">continue</string>
|
||||
<string name="alert_title">FlightGear Connection</string>
|
||||
<string name="connection_failed">Connection failed!</string>
|
||||
|
Loading…
Reference in New Issue
Block a user