adicao de ecra de gestao de conta dentro das definicoes
parent
cd2ec6b97b
commit
ab38d9a023
|
|
@ -11,15 +11,17 @@
|
|||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.VdcScore">
|
||||
<activity
|
||||
android:name=".ui.definicoes.ContaActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/Theme.VdcScore.NoActionBar" />
|
||||
<!-- Activity principal (Launcher) -->
|
||||
android:theme="@style/Theme.VdcScore.NoActionBar" /> <!-- Activity principal (Launcher) -->
|
||||
<activity
|
||||
android:name=".CriarContaActivity"
|
||||
android:exported="false"></activity>
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="true">
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||
FirebaseAuth mAuth;
|
||||
|
||||
private TextView criarContaTextView;
|
||||
// comentário que bnão serve para nada.
|
||||
// masi um comentário
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -58,7 +56,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||
Toast.makeText(this, "Login efetuado!", Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Abre a tua página principal
|
||||
startActivity(new Intent(LoginActivity.this, CriarContaActivity.class));
|
||||
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||
finish();
|
||||
|
||||
} else {
|
||||
|
|
@ -68,4 +66,13 @@ public class LoginActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
if (FirebaseAuth.getInstance().getCurrentUser() != null){
|
||||
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -53,8 +53,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
// getMenuInflater().inflate(R.menu.main, menu);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.example.vdcscore.ui.definicoes;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.example.vdcscore.R;
|
||||
|
||||
public class ContaActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_conta);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -32,10 +32,18 @@ public class DefinicoesFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void setupUi() {
|
||||
binding.cardConta.setOnClickListener(view ->
|
||||
Toast.makeText(requireContext(),
|
||||
"Gestão de conta disponível em breve.",
|
||||
Toast.LENGTH_SHORT).show());
|
||||
binding.cardConta.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Criar Intent para abrir ContaActivity
|
||||
Intent intent = new Intent(getContext(), ContaActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
// Adicionar animação (opcional)
|
||||
requireActivity().overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
binding.switchNotifications.setOnCheckedChangeListener((buttonView, isChecked) ->
|
||||
binding.textNotificationsStatus.setText(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.definicoes.ContaActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Loading…
Reference in New Issue