feat: redesign main UI with MaterialCardView selection menu and dark theme styling
This commit is contained in:
1
.idea/deploymentTargetSelector.xml
generated
1
.idea/deploymentTargetSelector.xml
generated
@@ -4,6 +4,7 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -6,6 +6,7 @@ import android.bluetooth.BluetoothDevice;
|
|||||||
import android.bluetooth.BluetoothSocket;
|
import android.bluetooth.BluetoothSocket;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
@@ -43,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private static final UUID BTMODULEUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
|
private static final UUID BTMODULEUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
|
||||||
private final static int REQUEST_ENABLE_BT = 1; // used to identify adding bluetooth names
|
private final static int REQUEST_ENABLE_BT = 1; // used to identify adding bluetooth names
|
||||||
private boolean bluetoothDenied = false;
|
private boolean bluetoothDenied = false;
|
||||||
|
private TextView tvStatus;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,6 +57,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
tvStatus = findViewById(R.id.tvStatus);
|
||||||
|
updateStatus("Desligado", Color.parseColor("#F44336"));
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
||||||
ActivityCompat.requestPermissions(this,
|
ActivityCompat.requestPermissions(this,
|
||||||
new String[]{Manifest.permission.BLUETOOTH_CONNECT, Manifest.permission.BLUETOOTH_SCAN},
|
new String[]{Manifest.permission.BLUETOOTH_CONNECT, Manifest.permission.BLUETOOTH_SCAN},
|
||||||
@@ -70,33 +74,48 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cafeCurto(View view) {
|
private void updateStatus(String status, int color) {
|
||||||
Toast.makeText(this, "Café Curto", Toast.LENGTH_SHORT).show();
|
runOnUiThread(() -> {
|
||||||
|
if (tvStatus != null) {
|
||||||
|
tvStatus.setText("● " + status);
|
||||||
|
tvStatus.setTextColor(color);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cafeCurto(View view) {
|
||||||
if (mConnectedThread != null) {
|
if (mConnectedThread != null) {
|
||||||
|
Toast.makeText(this, "Café Curto", Toast.LENGTH_SHORT).show();
|
||||||
mConnectedThread.enviarComando("1");
|
mConnectedThread.enviarComando("1");
|
||||||
|
} else {
|
||||||
|
ligarBluetooth();
|
||||||
|
Toast.makeText(this, "A tentar ligar à máquina...", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CafeMedio(View view) {
|
public void CafeMedio(View view) {
|
||||||
Toast.makeText(this, "Café Médio", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
if (mConnectedThread != null) {
|
if (mConnectedThread != null) {
|
||||||
|
Toast.makeText(this, "Café Médio", Toast.LENGTH_SHORT).show();
|
||||||
mConnectedThread.enviarComando("2");
|
mConnectedThread.enviarComando("2");
|
||||||
|
} else {
|
||||||
|
ligarBluetooth();
|
||||||
|
Toast.makeText(this, "A tentar ligar à máquina...", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cafeLongo(View view) {
|
public void cafeLongo(View view) {
|
||||||
|
|
||||||
Toast.makeText(this, "Café Longo", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
if (mConnectedThread != null) {
|
if (mConnectedThread != null) {
|
||||||
|
Toast.makeText(this, "Café Longo", Toast.LENGTH_SHORT).show();
|
||||||
mConnectedThread.enviarComando("3");
|
mConnectedThread.enviarComando("3");
|
||||||
|
} else {
|
||||||
|
ligarBluetooth();
|
||||||
|
Toast.makeText(this, "A tentar ligar à máquina...", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ligarBluetooth() {
|
public void ligarBluetooth() {
|
||||||
if (mBTAdapter == null) {
|
if (mBTAdapter == null) {
|
||||||
|
updateStatus("Sem Bluetooth", Color.parseColor("#F44336"));
|
||||||
runOnUiThread(() ->
|
runOnUiThread(() ->
|
||||||
Toast.makeText(MainActivity.this, "Dispositivo não suporta Bluetooth", Toast.LENGTH_LONG).show()
|
Toast.makeText(MainActivity.this, "Dispositivo não suporta Bluetooth", Toast.LENGTH_LONG).show()
|
||||||
);
|
);
|
||||||
@@ -109,6 +128,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
updateStatus("A ligar...", Color.parseColor("#FFC107"));
|
||||||
final String address = "98:D3:21:FC:7F:DF";
|
final String address = "98:D3:21:FC:7F:DF";
|
||||||
new Thread() {
|
new Thread() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -121,6 +141,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
fail = true;
|
fail = true;
|
||||||
Log.d("bluetooth","Socket creation failed");
|
Log.d("bluetooth","Socket creation failed");
|
||||||
|
updateStatus("Falha ao ligar", Color.parseColor("#F44336"));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (ActivityCompat.checkSelfPermission(MainActivity.this, android.Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
if (ActivityCompat.checkSelfPermission(MainActivity.this, android.Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
||||||
@@ -133,13 +154,17 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
fail = true;
|
fail = true;
|
||||||
mBTSocket.close();
|
mBTSocket.close();
|
||||||
|
updateStatus("Desligado", Color.parseColor("#F44336"));
|
||||||
} catch (IOException e2) {
|
} catch (IOException e2) {
|
||||||
Log.d("bluetooth","Socket creation failed");
|
Log.d("bluetooth","Socket creation failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fail == false) {
|
if (fail == false) {
|
||||||
|
updateStatus("Ligado", Color.parseColor("#4CAF50"));
|
||||||
mConnectedThread = new ConnectedThread(mBTSocket);
|
mConnectedThread = new ConnectedThread(mBTSocket);
|
||||||
mConnectedThread.start();
|
mConnectedThread.start();
|
||||||
|
} else {
|
||||||
|
reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
@@ -175,16 +200,34 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
private class ConnectedThread extends Thread {
|
private class ConnectedThread extends Thread {
|
||||||
private final OutputStream mmOutStream;
|
private final OutputStream mmOutStream;
|
||||||
|
private final InputStream mmInStream;
|
||||||
|
|
||||||
public ConnectedThread(BluetoothSocket socket) {
|
public ConnectedThread(BluetoothSocket socket) {
|
||||||
OutputStream tmpOut = null;
|
OutputStream tmpOut = null;
|
||||||
|
InputStream tmpIn = null;
|
||||||
try {
|
try {
|
||||||
tmpOut = socket.getOutputStream();
|
tmpOut = socket.getOutputStream();
|
||||||
|
tmpIn = socket.getInputStream();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("Bluetooth", "Erro ao obter OutputStream", e);
|
Log.e("Bluetooth", "Erro ao obter Streams", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
mmOutStream = tmpOut;
|
mmOutStream = tmpOut;
|
||||||
|
mmInStream = tmpIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
while (!Thread.currentThread().isInterrupted()) {
|
||||||
|
try {
|
||||||
|
int bytes = mmInStream.read(buffer);
|
||||||
|
if (bytes == -1) break;
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e("Bluetooth", "Conexão perdida", e);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enviarComando(String input){
|
public void enviarComando(String input){
|
||||||
@@ -192,19 +235,34 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
mmOutStream.write(bytes);
|
mmOutStream.write(bytes);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("Bluetooth", "Erro ao obter OutputStream", e);
|
Log.e("Bluetooth", "Erro ao enviar", e);
|
||||||
|
reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reconnect() {
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
desligarBluetooth();
|
||||||
|
updateStatus("A tentar reconectar...", Color.parseColor("#FFC107"));
|
||||||
|
new Handler(getMainLooper()).postDelayed(() -> {
|
||||||
|
if (!bluetoothDenied) {
|
||||||
|
ligarBluetooth();
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
}
|
||||||
private void desligarBluetooth() {
|
private void desligarBluetooth() {
|
||||||
try {
|
try {
|
||||||
if (mConnectedThread != null) {
|
if (mConnectedThread != null) {
|
||||||
mConnectedThread.interrupt();
|
mConnectedThread.interrupt();
|
||||||
|
mConnectedThread = null;
|
||||||
}
|
}
|
||||||
if (mBTSocket != null) {
|
if (mBTSocket != null) {
|
||||||
mBTSocket.close();
|
mBTSocket.close();
|
||||||
mBTSocket = null;
|
mBTSocket = null;
|
||||||
}
|
}
|
||||||
|
updateStatus("Desligado", Color.parseColor("#F44336"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("Bluetooth", "Erro ao desligar", e);
|
Log.e("Bluetooth", "Erro ao desligar", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 69 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 163 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 336 KiB |
@@ -1,65 +1,241 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".MainActivity"
|
android:background="#16100c"
|
||||||
android:id="@+id/main">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
|
<!-- Header / Logo Area -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/logo"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="160dp"
|
||||||
android:src="@drawable/cafe"
|
android:layout_height="160dp"
|
||||||
android:scaleType="centerCrop"/>
|
android:layout_marginTop="48dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="130sp"
|
|
||||||
android:src="@drawable/logo"
|
android:src="@drawable/logo"
|
||||||
android:layout_alignParentTop="true"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_margin="16sp"/>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
<LinearLayout
|
android:id="@+id/titleText"
|
||||||
android:id="@+id/botoes"
|
|
||||||
android:layout_marginTop="150dp"
|
|
||||||
android:layout_centerVertical="false"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_centerHorizontal="true">
|
android:fontFamily="sans-serif-light"
|
||||||
<ImageButton
|
android:text="Selecione o seu café"
|
||||||
android:id="@+id/cafeCurto"
|
android:textColor="#F2E6D8"
|
||||||
style="@style/botao"
|
android:textSize="26sp"
|
||||||
android:layout_width="85dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_height="85dp"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:text="@string/cafeCurto"
|
app:layout_constraintTop_toBottomOf="@id/logo" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="A Ligar..."
|
||||||
|
android:textColor="#FFC107"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<!-- Cards Container -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:padding="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleText">
|
||||||
|
|
||||||
|
<!-- Short Coffee Card -->
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
android:onClick="cafeCurto"
|
android:onClick="cafeCurto"
|
||||||
android:src="@drawable/cafecurto"
|
app:cardBackgroundColor="#211812"
|
||||||
android:scaleType="fitXY"
|
app:cardCornerRadius="16dp"
|
||||||
android:layout_gravity="center"/>
|
app:cardElevation="8dp"
|
||||||
<ImageButton
|
app:rippleColor="#D4AF37"
|
||||||
android:id="@+id/cafeMedio"
|
app:strokeColor="#3A2D23"
|
||||||
style="@style/botao"
|
app:strokeWidth="1dp">
|
||||||
android:layout_width="85dp"
|
|
||||||
android:layout_height="85dp"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:text="@string/cafeMedio"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iconCurto"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:src="@drawable/cafecurto"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/titleCurto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="CAFÉ CURTO"
|
||||||
|
android:textColor="#D4AF37"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconCurto"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/descCurto"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/descCurto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:text="Intenso e Encapsulado"
|
||||||
|
android:textColor="#A89F91"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconCurto"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleCurto"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<!-- Medium Coffee Card -->
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
android:onClick="CafeMedio"
|
android:onClick="CafeMedio"
|
||||||
android:src="@drawable/cafemedio"
|
app:cardBackgroundColor="#211812"
|
||||||
android:scaleType="fitXY"
|
app:cardCornerRadius="16dp"
|
||||||
android:layout_gravity="center"/>
|
app:cardElevation="8dp"
|
||||||
<ImageButton
|
app:rippleColor="#D4AF37"
|
||||||
android:id="@+id/cafeLongo"
|
app:strokeColor="#3A2D23"
|
||||||
style="@style/botao"
|
app:strokeWidth="1dp">
|
||||||
android:layout_width="85dp"
|
|
||||||
android:layout_height="85dp"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:text="@string/cafeLongo"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iconMedio"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:src="@drawable/cafemedio"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/titleMedio"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="CAFÉ MÉDIO"
|
||||||
|
android:textColor="#D4AF37"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconMedio"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/descMedio"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/descMedio"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:text="Equilibrado e Suave"
|
||||||
|
android:textColor="#A89F91"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconMedio"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleMedio"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<!-- Long Coffee Card -->
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
android:onClick="cafeLongo"
|
android:onClick="cafeLongo"
|
||||||
android:src="@drawable/cafelongo"
|
app:cardBackgroundColor="#211812"
|
||||||
android:scaleType="fitXY"
|
app:cardCornerRadius="16dp"
|
||||||
android:layout_gravity="center"/>
|
app:cardElevation="8dp"
|
||||||
|
app:rippleColor="#D4AF37"
|
||||||
|
app:strokeColor="#3A2D23"
|
||||||
|
app:strokeWidth="1dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iconLongo"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:src="@drawable/cafelongo"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/titleLongo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="CAFÉ LONGO"
|
||||||
|
android:textColor="#D4AF37"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconLongo"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/descLongo"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/descLongo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:text="Rico e Encorpado"
|
||||||
|
android:textColor="#A89F91"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iconLongo"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/titleLongo"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</RelativeLayout>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user