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:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.VdcScore">
|
android:theme="@style/Theme.VdcScore">
|
||||||
|
<activity
|
||||||
|
android:name=".ui.definicoes.ContaActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/title_activity_main"
|
android:label="@string/title_activity_main"
|
||||||
android:theme="@style/Theme.VdcScore.NoActionBar" />
|
android:theme="@style/Theme.VdcScore.NoActionBar" /> <!-- Activity principal (Launcher) -->
|
||||||
<!-- Activity principal (Launcher) -->
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".CriarContaActivity"
|
android:name=".CriarContaActivity"
|
||||||
android:exported="false"></activity>
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
FirebaseAuth mAuth;
|
FirebaseAuth mAuth;
|
||||||
|
|
||||||
private TextView criarContaTextView;
|
private TextView criarContaTextView;
|
||||||
// comentário que bnão serve para nada.
|
|
||||||
// masi um comentário
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -58,7 +56,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
Toast.makeText(this, "Login efetuado!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Login efetuado!", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
// Abre a tua página principal
|
// Abre a tua página principal
|
||||||
startActivity(new Intent(LoginActivity.this, CriarContaActivity.class));
|
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
} else {
|
} 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
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
// getMenuInflater().inflate(R.menu.main, menu);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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() {
|
private void setupUi() {
|
||||||
binding.cardConta.setOnClickListener(view ->
|
binding.cardConta.setOnClickListener(new View.OnClickListener() {
|
||||||
Toast.makeText(requireContext(),
|
@Override
|
||||||
"Gestão de conta disponível em breve.",
|
public void onClick(View v) {
|
||||||
Toast.LENGTH_SHORT).show());
|
// 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.switchNotifications.setOnCheckedChangeListener((buttonView, isChecked) ->
|
||||||
binding.textNotificationsStatus.setText(
|
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