update
This commit is contained in:
parent
50518c5035
commit
86d63d4460
@ -3,17 +3,15 @@ package com.rookiedev.hexapod
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.content.DialogInterface
|
import android.content.DialogInterface
|
||||||
import android.content.Intent
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.view.*
|
import android.view.*
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import com.rookiedev.hexapod.network.TCPClient
|
import com.rookiedev.hexapod.network.TCPClient
|
||||||
import com.rookiedev.hexapod.network.TCPClient.OnConnectEstablished
|
import com.rookiedev.hexapod.network.TCPClient.*
|
||||||
import com.rookiedev.hexapod.network.TCPClient.OnMessageReceived
|
|
||||||
import com.rookiedev.hexapod.network.TCPClient.OnDisconnected
|
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
import kotlin.math.atan2
|
import kotlin.math.atan2
|
||||||
@ -75,12 +73,13 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
private var radius = 0f
|
private var radius = 0f
|
||||||
|
|
||||||
private var tcpClient: TCPClient? = null
|
private var tcpClient: TCPClient? = null
|
||||||
private var ip:String = ""
|
private var ip: String = ""
|
||||||
private var port = 0
|
private var port = 0
|
||||||
|
|
||||||
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
private val scope = CoroutineScope(Job() + Dispatchers.IO)
|
||||||
|
|
||||||
private var currentState: String = "standby"
|
private var currentState: String = "standby"
|
||||||
|
private lateinit var progressBar: ConstraintLayout
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@ -96,6 +95,7 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
controlWindowInsets(true)
|
controlWindowInsets(true)
|
||||||
|
|
||||||
val controlCircle = findViewById<ImageView>(R.id.control_image)
|
val controlCircle = findViewById<ImageView>(R.id.control_image)
|
||||||
|
progressBar = findViewById<ConstraintLayout>(R.id.progressBar)
|
||||||
|
|
||||||
val vto: ViewTreeObserver = controlCircle.viewTreeObserver
|
val vto: ViewTreeObserver = controlCircle.viewTreeObserver
|
||||||
vto.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
|
vto.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
|
||||||
@ -190,7 +190,40 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this.tcpClient = TCPClient(this, ip, port, object : OnMessageReceived {
|
// this.tcpClient = TCPClient(this, ip, port, object : OnMessageReceived {
|
||||||
|
// override fun messageReceived(message: String?) {
|
||||||
|
// if (message == null) {
|
||||||
|
//// alertDialog(DISCONNECTED)
|
||||||
|
// println("no message")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }, object : OnConnectEstablished {
|
||||||
|
// override fun onConnected() {
|
||||||
|
//// udpClient.start()
|
||||||
|
// println("connected")
|
||||||
|
// Handler(Looper.getMainLooper()).post {
|
||||||
|
// progressBar.visibility = View.GONE
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }, object : OnDisconnected{
|
||||||
|
// override fun onDisconnected() {
|
||||||
|
// Handler(Looper.getMainLooper()).post {
|
||||||
|
// progressBar.visibility = View.GONE
|
||||||
|
// alertDialog(0)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// this.tcpClient!!.start()
|
||||||
|
|
||||||
|
// alertDialog(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
progressBar.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
this.tcpClient = TCPClient(ip, port, object : OnMessageReceived {
|
||||||
override fun messageReceived(message: String?) {
|
override fun messageReceived(message: String?) {
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
// alertDialog(DISCONNECTED)
|
// alertDialog(DISCONNECTED)
|
||||||
@ -201,10 +234,14 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
override fun onConnected() {
|
override fun onConnected() {
|
||||||
// udpClient.start()
|
// udpClient.start()
|
||||||
println("connected")
|
println("connected")
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
progressBar.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, object : OnDisconnected{
|
}, object : OnDisconnected {
|
||||||
override fun onDisconnected() {
|
override fun onDisconnected() {
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
progressBar.visibility = View.GONE
|
||||||
alertDialog(0)
|
alertDialog(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,7 +249,16 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
)
|
)
|
||||||
this.tcpClient!!.start()
|
this.tcpClient!!.start()
|
||||||
|
|
||||||
// alertDialog(0)
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
println("on Pause")
|
||||||
|
|
||||||
|
// saveSharedPref()
|
||||||
|
tcpClient!!.stopClient()
|
||||||
|
tcpClient!!.interrupt()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -246,7 +292,8 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
when (type) {
|
when (type) {
|
||||||
0 -> {
|
0 -> {
|
||||||
alert.setTitle("Failed to connect")
|
alert.setTitle("Failed to connect")
|
||||||
alert.setMessage("Failed to connect to the Hexapod"
|
alert.setMessage(
|
||||||
|
"Failed to connect to the Hexapod"
|
||||||
)
|
)
|
||||||
alert.setOnCancelListener(DialogInterface.OnCancelListener { finish() })
|
alert.setOnCancelListener(DialogInterface.OnCancelListener { finish() })
|
||||||
alert.setButton(AlertDialog.BUTTON_POSITIVE,
|
alert.setButton(AlertDialog.BUTTON_POSITIVE,
|
||||||
@ -256,7 +303,6 @@ class ControlActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
alert.show()
|
alert.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
package com.rookiedev.hexapod.network
|
package com.rookiedev.hexapod.network
|
||||||
|
|
||||||
import com.rookiedev.hexapod.ControlActivity
|
import com.rookiedev.hexapod.ControlActivity
|
||||||
import android.util.Log
|
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.net.InetAddress
|
import java.net.*
|
||||||
import java.net.InetSocketAddress
|
|
||||||
import java.net.Socket
|
|
||||||
import java.net.UnknownHostException
|
|
||||||
import java.util.concurrent.locks.ReentrantLock
|
|
||||||
|
|
||||||
|
|
||||||
class TCPClient(
|
class TCPClient(
|
||||||
c: ControlActivity,
|
|
||||||
ip: String?,
|
ip: String?,
|
||||||
port: Int,
|
port: Int,
|
||||||
messagelistener: OnMessageReceived?,
|
messagelistener: OnMessageReceived?,
|
||||||
@ -19,21 +13,17 @@ class TCPClient(
|
|||||||
ondisconnect: OnDisconnected?
|
ondisconnect: OnDisconnected?
|
||||||
) :
|
) :
|
||||||
Thread() {
|
Thread() {
|
||||||
private val controller: ControlActivity = c
|
private var TCPSocket: Socket? = null
|
||||||
private var TCPSocket:Socket? = null
|
|
||||||
private var SERVERIP: InetAddress? = null
|
private var SERVERIP: InetAddress? = null
|
||||||
private val SERVERPORT: Int
|
private val SERVERPORT: Int
|
||||||
private var serverAddr: InetSocketAddress? = null
|
private var serverAddr: InetSocketAddress? = null
|
||||||
private var TCPOut: PrintWriter? = null
|
private var TCPOut: PrintWriter? = null
|
||||||
private var TCPIn: BufferedReader? = null
|
private var TCPIn: BufferedReader? = null
|
||||||
private var TCPMessage: String? = null
|
|
||||||
private var mMessageListener: OnMessageReceived? = null
|
private var mMessageListener: OnMessageReceived? = null
|
||||||
private var onConnected: OnConnectEstablished? = null
|
private var onConnected: OnConnectEstablished? = null
|
||||||
private var onDisconnected: OnDisconnected?=null
|
private var onDisconnected: OnDisconnected? = null
|
||||||
private var isConnected = false
|
private var isConnected = false
|
||||||
private var pause = false // if the thread is paused by system
|
private var pause = false // if the thread is paused by system
|
||||||
private var isNewData = false
|
|
||||||
private var newMessage:String? = null
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
try {
|
try {
|
||||||
this.TCPSocket = Socket()
|
this.TCPSocket = Socket()
|
||||||
@ -41,43 +31,26 @@ class TCPClient(
|
|||||||
this.TCPSocket!!.connect(serverAddr, 3000) // connecting socket and set timeout in 3s
|
this.TCPSocket!!.connect(serverAddr, 3000) // connecting socket and set timeout in 3s
|
||||||
onConnected!!.onConnected()
|
onConnected!!.onConnected()
|
||||||
TCPOut = PrintWriter(
|
TCPOut = PrintWriter(
|
||||||
BufferedWriter(OutputStreamWriter(this.TCPSocket!!.getOutputStream())),
|
BufferedWriter(OutputStreamWriter(this.TCPSocket!!.getOutputStream())),
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
TCPIn = BufferedReader(InputStreamReader(this.TCPSocket!!.getInputStream()))
|
||||||
// sendMessage("test")
|
// sendMessage("test")
|
||||||
isConnected = true
|
isConnected = true
|
||||||
while(isConnected)
|
while (isConnected) {
|
||||||
{
|
|
||||||
// if (isNewData)
|
|
||||||
// {
|
|
||||||
// if (TCPOut != null && !TCPOut!!.checkError()) {
|
|
||||||
// TCPOut!!.println(newMessage)
|
|
||||||
// TCPOut!!.flush()
|
|
||||||
// }
|
|
||||||
// isNewData = false
|
|
||||||
// }else{
|
|
||||||
// sleep(100)
|
|
||||||
// }
|
|
||||||
sleep(1000)
|
sleep(1000)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: InterruptedException) {
|
||||||
// controller.cancelProgressDialog(java.lang.ModuleLayer.Controller.SERVERALERT)
|
// controller.cancelProgressDialog(java.lang.ModuleLayer.Controller.SERVERALERT)
|
||||||
println("unable to connect")
|
println(e)
|
||||||
// controller.alertDialog(0)
|
// controller.alertDialog(0)
|
||||||
|
// onDisconnected!!.onDisconnected()
|
||||||
|
} catch (e: SocketTimeoutException) {
|
||||||
|
println(e)
|
||||||
onDisconnected!!.onDisconnected()
|
onDisconnected!!.onDisconnected()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private fun keepAlive() {
|
|
||||||
// sendMessage(Constants.requestMessage(Constants.REQUEST_ISALIVE))
|
|
||||||
// try {
|
|
||||||
// TCPMessage = TCPIn!!.readLine()
|
|
||||||
// mMessageListener!!.messageReceived(TCPMessage)
|
|
||||||
// } catch (e: IOException) {
|
|
||||||
// controller.alertDialog(java.lang.ModuleLayer.Controller.DISCONNECTED)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the message entered by client to the server
|
* Sends the message entered by client to the server
|
||||||
*
|
*
|
||||||
@ -86,17 +59,20 @@ class TCPClient(
|
|||||||
fun sendMessage(message: String?) {
|
fun sendMessage(message: String?) {
|
||||||
// newMessage = message
|
// newMessage = message
|
||||||
// isNewData = true
|
// isNewData = true
|
||||||
if (TCPOut != null && !TCPOut!!.checkError()) {
|
|
||||||
TCPOut!!.println(message)
|
if (this.TCPOut != null && !this.TCPOut!!.checkError()) {
|
||||||
TCPOut!!.flush()
|
println("send message")
|
||||||
|
this.TCPOut!!.println(message)
|
||||||
|
this.TCPOut!!.flush()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fun stopClient() {
|
fun stopClient() {
|
||||||
// sendMessage(Constants.requestMessage(Constants.REQUEST_DISCONNECT))
|
// sendMessage(Constants.requestMessage(Constants.REQUEST_DISCONNECT))
|
||||||
// pause = true
|
pause = true
|
||||||
// isConnected = false
|
isConnected = false
|
||||||
// }
|
this.TCPSocket!!.close()
|
||||||
|
}
|
||||||
|
|
||||||
interface OnMessageReceived {
|
interface OnMessageReceived {
|
||||||
fun messageReceived(message: String?)
|
fun messageReceived(message: String?)
|
||||||
@ -124,4 +100,5 @@ class TCPClient(
|
|||||||
}
|
}
|
||||||
pause = false
|
pause = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,121 +1,177 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ControlActivity">
|
tools:context=".ControlActivity">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<Button
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/button_rotatex"
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Rotate X"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/button_rotatey"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/button_climb"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_climb"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Climb"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/button_twist"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/button_rotatex"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed" />
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_rotatey"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Rotate Y"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/button_rotatez"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/button_twist"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/button_rotatex" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_twist"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Twist"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/button6"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/button_rotatey"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/button_climb" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_rotatez"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Rotate Z"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/button6"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/button_rotatey" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button6"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="24dp"
|
|
||||||
android:text="Button"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/button_rotatez"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/button_twist" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/control_image"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_weight="1">
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="32dp"
|
<TableLayout
|
||||||
android:layout_marginBottom="32dp"
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_marginRight="32dp"
|
||||||
|
android:layout_marginLeft="32dp">
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_rotatex"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Rotate X"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/button_rotatey"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/button_climb"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_climb"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Climb"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/button_twist"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/button_rotatex"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_rotatey"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Rotate Y"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/button_rotatez"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/button_twist"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/button_rotatex" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_twist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Twist"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/button6"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/button_rotatey"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/button_climb" />
|
||||||
|
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_rotatez"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Rotate Z"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/button6"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/button_rotatey" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button6"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:text="Button"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/button_rotatez"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/button_twist" />
|
||||||
|
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
</TableLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/control_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
android:layout_marginBottom="32dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@drawable/ic_control_circle" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
tools:visibility="gone">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar3"
|
||||||
|
style="?android:attr/progressBarStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:srcCompat="@drawable/ic_control_circle" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</FrameLayout>
|
Loading…
x
Reference in New Issue
Block a user