Commit ac19dc42 authored by Giacomo Lavermicocca's avatar Giacomo Lavermicocca

Add new function button

parent b09f413a
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
......@@ -5,22 +5,32 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="5">
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
......
......@@ -6,7 +6,7 @@ android {
compileSdkVersion 27
defaultConfig {
applicationId "it.lavermicocca.giacomo.beautifulnotification"
minSdkVersion 16
minSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
......@@ -38,6 +38,8 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.github.kotlin-graphics:kotlin-unsigned:v2.1'
}
repositories {
mavenCentral()
......
package it.lavermicocca.giacomo.beautifulnotification
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.os.CountDownTimer
import android.provider.FontRequest
import android.support.annotation.RequiresApi
import android.support.v7.app.AppCompatActivity
......@@ -54,9 +56,71 @@ class MainActivity : AppCompatActivity() {
}
startActivity(intent)
})
btn_check_garage.setOnClickListener(View.OnClickListener {
Helper.StartForegroundServiceNotification(baseContext, "VERIFICA SE GARAGE è APERTO", Helper.FULL_OFF)
Sender(baseContext).SendRead(37)
btn_check_garage.isEnabled = false
btn_cancello.isEnabled = false
btn_garage.isEnabled = false
btn_luce.isEnabled = false
CountD("Check garage...")
})
btn_cancello.setOnClickListener(View.OnClickListener {
Sender(baseContext).SendPin(17)
btn_check_garage.isEnabled = false
btn_cancello.isEnabled = false
btn_garage.isEnabled = false
btn_luce.isEnabled = false
CountD("Cancello in apertura...")
})
btn_garage.setOnClickListener(View.OnClickListener {
Sender(baseContext).SendPin(21)
btn_check_garage.isEnabled = false
btn_cancello.isEnabled = false
btn_garage.isEnabled = false
btn_luce.isEnabled = false
CountD("Garage in apertura...")
})
btn_luce.setOnClickListener(View.OnClickListener {
Sender(baseContext).SendPin(13)
btn_check_garage.isEnabled = false
btn_cancello.isEnabled = false
btn_garage.isEnabled = false
btn_luce.isEnabled = false
CountD("Luce accesa!")
})
btn_garage_cancello.setOnClickListener(View.OnClickListener {
Sender(baseContext).SendPin(0)
btn_check_garage.isEnabled = false
btn_cancello.isEnabled = false
btn_garage.isEnabled = false
btn_luce.isEnabled = false
CountD("Garage & Cancello in apertura...")
})
btn_portone.setOnClickListener(View.OnClickListener {
Sender(baseContext).SendPinPortone()
})
}
//-------------------- HTTP WAY -------------------------
//---------------------------------------------
private fun CountD(testo: String) {
object : CountDownTimer(3000, 1000) {
override fun onTick(millisUntilFinished: Long) {
var t = "${testo} ${millisUntilFinished/1000}"
textView_result.text = t
}
override fun onFinish() {
btn_check_garage.isEnabled = true
btn_cancello.isEnabled = true
btn_garage.isEnabled = true
btn_luce.isEnabled = true
}
}.start()
}
}
\ No newline at end of file
......@@ -10,12 +10,13 @@ import it.lavermicocca.giacomo.beautifulnotification.mappers.Arguments
import it.lavermicocca.giacomo.beautifulnotification.services.Helper
import okhttp3.*
import java.io.IOException
import java.util.concurrent.TimeUnit
class Sender(val context: Context) {
//NULL
fun SendRead(pin: Int) {
Helper.StartForegroundServiceNotification(context, "...", Helper.FULL_ON)
Helper.StartForegroundServiceNotification(context, "...ASPETTA...", Helper.FULL_ON)
val prf = context.getSharedPreferences("myPref", Context.MODE_PRIVATE)
val ipServer = prf.getString("ip_server", "192.168.43.176")
......@@ -27,7 +28,11 @@ class Sender(val context: Context) {
//.addHeader("Content-Type", "application/json")
.build()
val client = OkHttpClient()
val client = OkHttpClient().newBuilder()
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.connectTimeout(30, TimeUnit.SECONDS)
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
......@@ -45,7 +50,7 @@ class Sender(val context: Context) {
//TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
Toast.makeText(context, networkResp, Toast.LENGTH_LONG).show()
//Helper.StartForegroundServiceNotification(context, networkResp, Helper.FULL_OFF)
SendCheck(true)
SendCheck()
}
})
......@@ -67,52 +72,12 @@ class Sender(val context: Context) {
//.addHeader("Content-Type", "application/json")
.build()
val client = OkHttpClient()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
e.printStackTrace()
Helper.StartForegroundServiceNotification(context, e.localizedMessage, Helper.FULL_ON)
}
@Throws(IOException::class)
override fun onResponse(call: Call, response: Response) {
val networkResp = response.body()!!.string()
var looper = Looper.getMainLooper()
Handler(looper).post(object :Runnable{
override fun run() {
//TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
Toast.makeText(context, networkResp, Toast.LENGTH_LONG).show()
if(networkResp.contains(Arguments.PIN, true))
{
Log.e("TTAG", "RICHIESTA PIN")
SendCheck(false)
}
}
})
}
})
}
//UNO
fun SendBrightness(brightness: Int) {
Helper.StartForegroundServiceNotification(context, "ACCENDO LUCE con INTENSITA : $brightness", Helper.FULL_ON)
val prf = context.getSharedPreferences("myPref", Context.MODE_PRIVATE)
val ipServer = prf.getString("ip_server", "192.168.43.176")
val url = "http://$ipServer/brightness/$brightness"
val request = okhttp3.Request.Builder()
.url(url)
.get()
//.addHeader("Content-Type", "application/json")
val client = OkHttpClient().newBuilder()
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.connectTimeout(30, TimeUnit.SECONDS)
.build()
val client = OkHttpClient()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
e.printStackTrace()
......@@ -128,13 +93,10 @@ class Sender(val context: Context) {
override fun run() {
//TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
Toast.makeText(context, networkResp, Toast.LENGTH_LONG).show()
//Helper.StartForegroundServiceNotification(context, networkResp, Helper.FULL_ON)
if(networkResp.contains(Arguments.BRIGHTNESS, true))
if(networkResp.contains(Arguments.PIN, true))
{
Log.e("TTAG", "RICHIESTA PIN")
//SendCheck(false)
SendCheck()
}
}
})
......@@ -158,7 +120,11 @@ class Sender(val context: Context) {
//.addHeader("Content-Type", "application/json")
.build()
val client = OkHttpClient()
val client = OkHttpClient().newBuilder()
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.connectTimeout(30, TimeUnit.SECONDS)
.build()
Helper.StartForegroundServiceNotification(context, "PORTONE", Helper.FULL_ON)
......@@ -171,24 +137,13 @@ class Sender(val context: Context) {
@Throws(IOException::class)
override fun onResponse(call: Call, response: Response) {
Helper.StartForegroundServiceNotification(context, "PORTONE APERTO", Helper.FULL_ON)
// val networkResp = response.body()!!.string()
// var looper = Looper.getMainLooper()
//
// Handler(looper).post(object :Runnable{
// override fun run() {
// //TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
// //Toast.makeText(context, networkResp, Toast.LENGTH_LONG).show()
//
// }
// })
}
})
}
//DUE
fun SendCheck(oneShot:Boolean) {
Thread.sleep(3000);
fun SendCheck() {
Thread.sleep(10);
val prf = context.getSharedPreferences("myPref", Context.MODE_PRIVATE)
val ipServer = prf.getString("ip_server", "192.168.43.176")
......@@ -200,7 +155,11 @@ class Sender(val context: Context) {
//.addHeader("Content-Type", "application/json")
.build()
val client = OkHttpClient()
val client = OkHttpClient().newBuilder()
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.connectTimeout(30, TimeUnit.SECONDS)
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
......@@ -229,17 +188,6 @@ class Sender(val context: Context) {
else {
Helper.StartForegroundServiceNotification(context, networkResp, Helper.FULL_ON_STOP_PROGRESS)
}
// if(!oneShot)
// {
// var looper = Looper.getMainLooper()
//
// Handler(looper).post(object :Runnable{
// override fun run() {
// CountD(networkResp)
// }
// })
// }
}
})
}
......@@ -248,7 +196,7 @@ class Sender(val context: Context) {
private fun CountD(testo: String) {
val prf = context.getSharedPreferences("myPref", Context.MODE_PRIVATE)
val timeout:Long = prf.getString("timeout", "10000").toLong()
val timeout:Long = prf.getString("timeout", "30").toLong()
object : CountDownTimer(timeout, 1000) {
override fun onTick(millisUntilFinished: Long) {
......
......@@ -18,7 +18,7 @@ class GenericNotificationClass(val service: Service, val text : String, val stat
private val notification:Notification
private val CHANNEL_ID = "my_channel"
enum class STATUS {none, garage, cancello, all, portone, brightness, led, lastCommand}
enum class STATUS {none, garage, cancello, all, portone, brightness, led, garageCancello, lastCommand}
init {
val ns = Context.NOTIFICATION_SERVICE
......@@ -125,11 +125,15 @@ class GenericNotificationClass(val service: Service, val text : String, val stat
prepareData(switchIntent, STATUS.led)
val brightness = PendingIntent.getBroadcast(service, STATUS.led.ordinal, switchIntent, PendingIntent.FLAG_UPDATE_CURRENT)
prepareData(switchIntent, STATUS.garageCancello)
val garageCancello = PendingIntent.getBroadcast(service, STATUS.garageCancello.ordinal, switchIntent, PendingIntent.FLAG_UPDATE_CURRENT)
notificationView.setOnClickPendingIntent(R.id.last_command, lastCommand)
notificationView.setOnClickPendingIntent(R.id.open_close_garage, openCloseGarage)
notificationView.setOnClickPendingIntent(R.id.open_close_cancello, openCloseCancello)
notificationView.setOnClickPendingIntent(R.id.open_close_portone, openClosePortone)
notificationView.setOnClickPendingIntent(R.id.brightness, brightness)
notificationView.setOnClickPendingIntent(R.id.garage_cancello, garageCancello)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(CHANNEL_ID, "Channel beauty notification", NotificationManager.IMPORTANCE_HIGH)
......
......@@ -4,11 +4,8 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import it.lavermicocca.giacomo.beautifulnotification.mappers.Arguments
import it.lavermicocca.giacomo.beautifulnotification.notifications.GenericNotificationClass
import it.lavermicocca.giacomo.beautifulnotification.services.Helper
import unsigned.Ubyte
import unsigned.toUbyte
class SwitchButtonListener : BroadcastReceiver() {
......@@ -34,18 +31,21 @@ class SwitchButtonListener : BroadcastReceiver() {
}
GenericNotificationClass.STATUS.portone -> sender.SendPinPortone() //17 GPIO pin locale
GenericNotificationClass.STATUS.cancello -> {
Helper.StartForegroundServiceNotification(context, "CANCELLO IN APERTURA...", Helper.FULL_OFF)
Helper.StartForegroundServiceNotification(context, "CANCELLO in APERTURA...", Helper.FULL_OFF)
sender.SendPin(17)
}
GenericNotificationClass.STATUS.garage -> {
Helper.StartForegroundServiceNotification(context, "GARAGE IN APERTURA...", Helper.FULL_OFF)
Helper.StartForegroundServiceNotification(context, "GARAGE in APERTURA...", Helper.FULL_OFF)
sender.SendPin(21)
}
GenericNotificationClass.STATUS.led -> {
Helper.StartForegroundServiceNotification(context, "LUCE ACCESA...", Helper.FULL_OFF)
sender.SendPin(13)
}
GenericNotificationClass.STATUS.brightness -> sender.SendBrightness(previousBrightness)
GenericNotificationClass.STATUS.garageCancello -> {
Helper.StartForegroundServiceNotification(context, "GARAGE & CANCELLO in APERTURA...", Helper.FULL_OFF)
sender.SendPin(0)
}
}
previousBrightness += 25
......
......@@ -11,28 +11,120 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Start notification"
android:textSize="36sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/start_settings"
android:textSize="80sp" />
app:layout_constraintTop_toBottomOf="@+id/start_settings" />
<android.support.text.emoji.widget.EmojiAppCompatButton
android:id="@+id/start_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Start settings"
android:textSize="36sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="80sp" />
app:layout_constraintTop_toBottomOf="@+id/btn_portone" />
<Button
android:id="@+id/btn_luce"
android:layout_width="80dp"
android:layout_height="80dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="LUCE"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_cancello"
app:layout_constraintTop_toTopOf="@+id/btn_cancello" />
<Button
android:id="@+id/btn_garage_cancello"
android:layout_width="80dp"
android:layout_height="80dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="GAR. PORT"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_cancello"
app:layout_constraintTop_toTopOf="@+id/btn_portone" />
<Button
android:id="@+id/btn_cancello"
android:layout_width="80dp"
android:layout_height="80dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="CANCELLO"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_luce"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_garage"
app:layout_constraintTop_toTopOf="@+id/btn_garage" />
<Button
android:id="@+id/btn_garage"
android:layout_width="80dp"
android:layout_height="80dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="GARAGE"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_cancello"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView_result" />
<Button
android:id="@+id/btn_portone"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="PORTONE"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_cancello" />
<Button
android:id="@+id/btn_check_garage"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginTop="8dp"
android:autoSizeMaxTextSize="36dp"
android:autoSizeMinTextSize="36dp"
android:text="\?\?\?"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@+id/btn_garage"
app:layout_constraintHorizontal_bias="0.123"
app:layout_constraintStart_toStartOf="@+id/btn_garage"
app:layout_constraintTop_toBottomOf="@+id/btn_cancello" />
<TextView
android:id="@+id/textView_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="---"
android:textSize="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:gravity="center"
android:orientation="vertical"
android:weightSum="100">
<TextView
android:id="@+id/text_response"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="ABCDEFGHILMNOPQRTU"
android:textAppearance="?android:attr/textAppearanceLargeInverse" />
<ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:indeterminateOnly="true" />
<RelativeLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/garage_cancello"
android:layout_width="60dp"
android:layout_height="40dp"
android:text="GA-PO" />
<Button
android:id="@+id/last_command"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/garage_cancello"
android:layout_toRightOf="@id/garage_cancello"
android:text="\???" />
<Button
android:id="@+id/open_close_portone"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:text="PORTONE"
android:layout_toRightOf="@id/last_command"/>
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/last_command"
android:layout_toRightOf="@id/last_command"
android:text="PORTONE" />
<Button
android:id="@+id/open_close_garage"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:text="GARAGE"
android:layout_toRightOf="@id/open_close_portone"/>
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/open_close_portone"
android:layout_toRightOf="@id/open_close_portone"
android:text="GARAGE" />
<Button
android:id="@+id/open_close_cancello"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:text="CANCELLO"
android:layout_toRightOf="@id/open_close_garage"/>
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/open_close_garage"
android:layout_toRightOf="@id/open_close_garage"
android:text="CANCELLO" />
</RelativeLayout>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/progress_bar"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminateOnly="true" />
<TextView
android:id="@+id/text_response"
<Button
android:id="@+id/brightness"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/open_close_cancello"
android:layout_toRightOf="@id/open_close_cancello"
android:text="LUCE" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="ABCDEFGHILMNOPQRTU"
android:textAppearance="?android:attr/textAppearanceLargeInverse" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:gravity="center"
android:orientation="vertical"
android:weightSum="100">
<TextView
android:id="@+id/text_response"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="ABCDEFGHILMNOPQRTU"
android:textAppearance="?android:attr/textAppearanceLargeInverse" />
<RelativeLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/garage_cancello"
android:layout_width="60dp"
android:layout_height="40dp"
android:text="GA-PO" />
<Button
android:id="@+id/last_command"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/garage_cancello"
android:layout_toRightOf="@id/garage_cancello"
android:text="\???" />
<Button