Prova Mobile
Prova Mobile
ALUNOS:
LUAN DE OLIVEIRA LEAL
THIAGO QUEIROZ
THIAGO XAVIER
MARCOS FERREIRA
LUCAS AMORIM
ARTHUR HENRIQUE
activity_main.xml (1):
<EditText
android:id="@+id/editTextLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Login"
android:inputType="text"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,VisualLintTextFieldSize" />
<EditText
android:id="@+id/editTextPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/editTextLogin"
android:layout_marginTop="16dp"
android:hint="Senha"
android:inputType="textPassword"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,VisualLintTextFieldSize" />
<Button
android:id="@+id/buttonLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/editTextPassword"
android:layout_marginTop="24dp"
android:text="Logar"
tools:ignore="HardcodedText,VisualLintButtonSize" />
</RelativeLayout>
MainActivity.java (1):
package com.example.provamobile;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
buttonLogin.setOnClickListener(v -> {
// Redirecionar para a tela de cadastro
Intent intent = new Intent(MainActivity.this,
FormularioCadastroPetActivity.class);
startActivity(intent);
});
}
}
activity_main.xml (2):
<EditText
android:id="@+id/editTextCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Código"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,TextFields,VisualLintTextFieldSize" />
<EditText
android:id="@+id/editTextName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="Nome"
android:minHeight="48dp"
tools:ignore="HardcodedText,TextFields,VisualLintTextFieldSize"
android:importantForAutofill="no" />
<EditText
android:id="@+id/editTextAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="Endereço"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,TextFields,VisualLintTextFieldSize" />
<EditText
android:id="@+id/editTextPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="Telefone"
android:inputType="phone"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,VisualLintTextFieldSize" />
<EditText
android:id="@+id/editTextNickname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="Apelido"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,TextFields,VisualLintTextFieldSize" />
<EditText
android:id="@+id/editTextZIP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="CEP"
android:inputType="number"
android:minHeight="48dp"
tools:ignore="Autofill,HardcodedText,VisualLintTextFieldSize" />
<Button
android:id="@+id/buttonSubmit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Cadastrar"
tools:ignore="HardcodedText,VisualLintButtonSize" />
</LinearLayout>
MainActivity.java (2):
package com.example.provamobile;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editTextCode = findViewById(R.id.editTextCode);
editTextName = findViewById(R.id.editTextName);
editTextAddress = findViewById(R.id.editTextAddress);
editTextPhone = findViewById(R.id.editTextPhone);
editTextNickname = findViewById(R.id.editTextNickname);
editTextZIP = findViewById(R.id.editTextZIP);
Button buttonSubmit = findViewById(R.id.buttonSubmit);
buttonSubmit.setOnClickListener(v -> {
clearFields();
}
});
}