diff --git a/app/src/main/java/com/example/vdcscore/CriarContaActivity.java b/app/src/main/java/com/example/vdcscore/CriarContaActivity.java index 92333fb..404e0e4 100644 --- a/app/src/main/java/com/example/vdcscore/CriarContaActivity.java +++ b/app/src/main/java/com/example/vdcscore/CriarContaActivity.java @@ -18,10 +18,6 @@ import com.google.firebase.auth.FirebaseAuth; public class CriarContaActivity extends AppCompatActivity { - // teste de alguma coisa - // mais um teste - // asdasdas - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/app/src/main/java/com/example/vdcscore/MainActivity.java b/app/src/main/java/com/example/vdcscore/MainActivity.java index 63f2809..16dd061 100644 --- a/app/src/main/java/com/example/vdcscore/MainActivity.java +++ b/app/src/main/java/com/example/vdcscore/MainActivity.java @@ -23,11 +23,24 @@ import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import java.io.InputStream; +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; +import android.text.InputType; +import android.widget.EditText; +import android.widget.Toast; +import androidx.activity.result.ActivityResultLauncher; +import androidx.activity.result.contract.ActivityResultContracts; +import com.google.firebase.storage.StorageReference; +import com.google.firebase.storage.UploadTask; +import com.google.firebase.auth.UserProfileChangeRequest; public class MainActivity extends AppCompatActivity { private AppBarConfiguration mAppBarConfiguration; private ActivityMainBinding binding; + private ActivityResultLauncher mGetContent; @Override protected void onCreate(Bundle savedInstanceState) { @@ -56,19 +69,28 @@ public class MainActivity extends AppCompatActivity { NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main); NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration); NavigationUI.setupWithNavController(navigationView, navController); - + + // Initialize Gallery Launcher + mGetContent = registerForActivityResult(new ActivityResultContracts.GetContent(), + uri -> { + if (uri != null) { + uploadImageToStorage(uri); + } + }); + // Carregar dados do utilizador no menu lateral loadUserDataInNavHeader(); } - + private void loadUserDataInNavHeader() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); - if (user == null) return; - + if (user == null) + return; + View headerView = binding.navView.getHeaderView(0); TextView textViewName = headerView.findViewById(R.id.textViewName); ImageView imageView = headerView.findViewById(R.id.imageView); - + // Carregar nome if (textViewName != null) { if (user.getDisplayName() != null && !user.getDisplayName().isEmpty()) { @@ -77,9 +99,10 @@ public class MainActivity extends AppCompatActivity { textViewName.setText("Utilizador"); } } - + // Carregar foto de perfil if (imageView != null) { + imageView.setOnClickListener(v -> showChangeProfilePhotoDialog()); if (user.getPhotoUrl() != null) { loadProfileImageInNavHeader(user.getPhotoUrl().toString(), imageView); } else { @@ -88,7 +111,7 @@ public class MainActivity extends AppCompatActivity { } } } - + private void loadProfileImageInNavHeader(String imageUrl, ImageView imageView) { new Thread(() -> { InputStream input = null; @@ -119,11 +142,12 @@ public class MainActivity extends AppCompatActivity { } }).start(); } - + private void loadProfileImageFromStorage(ImageView imageView) { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); - if (user == null || imageView == null) return; - + if (user == null || imageView == null) + return; + com.google.firebase.storage.FirebaseStorage.getInstance() .getReference() .child("profile_images/" + user.getUid() + ".jpg") @@ -136,10 +160,86 @@ public class MainActivity extends AppCompatActivity { }); } + private void showChangeProfilePhotoDialog() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Alterar Foto de Perfil"); + String[] options = { "Escolher da Galeria", "Inserir URL" }; + builder.setItems(options, (dialog, which) -> { + if (which == 0) { + mGetContent.launch("image/*"); + } else { + showUrlDialog(); + } + }); + builder.show(); + } + + private void showUrlDialog() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("Inserir URL da Imagem"); + + final EditText input = new EditText(this); + input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); + input.setHint("https://exemplo.com/foto.jpg"); + builder.setView(input); + + builder.setPositiveButton("OK", (dialog, which) -> { + String url = input.getText().toString(); + if (!url.isEmpty()) { + updateUserProfile(Uri.parse(url)); + } + }); + builder.setNegativeButton("Cancelar", (dialog, which) -> dialog.cancel()); + + builder.show(); + } + + private void uploadImageToStorage(Uri imageUri) { + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user == null) + return; + + StorageReference storageRef = com.google.firebase.storage.FirebaseStorage.getInstance().getReference(); + StorageReference profileRef = storageRef.child("profile_images/" + user.getUid() + ".jpg"); + + Toast.makeText(this, "A carregar imagem...", Toast.LENGTH_SHORT).show(); + + profileRef.putFile(imageUri) + .addOnSuccessListener(taskSnapshot -> { + profileRef.getDownloadUrl().addOnSuccessListener(uri -> { + updateUserProfile(uri); + }); + }) + .addOnFailureListener(e -> { + Toast.makeText(MainActivity.this, "Erro ao carregar imagem: " + e.getMessage(), Toast.LENGTH_SHORT) + .show(); + }); + } + + private void updateUserProfile(Uri photoUri) { + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user == null) + return; + + UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder() + .setPhotoUri(photoUri) + .build(); + + user.updateProfile(profileUpdates) + .addOnCompleteListener(task -> { + if (task.isSuccessful()) { + Toast.makeText(MainActivity.this, "Foto de perfil atualizada!", Toast.LENGTH_SHORT).show(); + loadUserDataInNavHeader(); // Refresh UI + } else { + Toast.makeText(MainActivity.this, "Erro ao atualizar perfil.", Toast.LENGTH_SHORT).show(); + } + }); + } + @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); + // getMenuInflater().inflate(R.menu.main, menu); return false; } @@ -149,7 +249,7 @@ public class MainActivity extends AppCompatActivity { return NavigationUI.navigateUp(navController, mAppBarConfiguration) || super.onSupportNavigateUp(); } - + @Override protected void onResume() { super.onResume(); diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java b/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java index 2c41436..24a6874 100644 --- a/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java @@ -4,31 +4,82 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import androidx.lifecycle.ViewModelProvider; +import androidx.recyclerview.widget.LinearLayoutManager; import com.example.vdcscore.databinding.FragmentGalleryBinding; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; +import java.util.List; public class GalleryFragment extends Fragment { private FragmentGalleryBinding binding; + private MatchdaysAdapter adapter; + private DatabaseReference mDatabase; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - GalleryViewModel galleryViewModel = new ViewModelProvider(this).get(GalleryViewModel.class); binding = FragmentGalleryBinding.inflate(inflater, container, false); View root = binding.getRoot(); - // final TextView textView = binding.textGallery; - // galleryViewModel.getText().observe(getViewLifecycleOwner(), - // textView::setText); + // Initialize RecyclerView + adapter = new MatchdaysAdapter(); + binding.recyclerMatchdays.setLayoutManager(new LinearLayoutManager(getContext())); + binding.recyclerMatchdays.setAdapter(adapter); + + // Initialize Firebase + mDatabase = FirebaseDatabase.getInstance().getReference("matchdays"); + + // Fetch Data + fetchMatchdays(); + return root; } + private void fetchMatchdays() { + mDatabase.addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + List matchdays = new ArrayList<>(); + for (DataSnapshot postSnapshot : snapshot.getChildren()) { + Matchday matchday = new Matchday(); + matchday.setId(postSnapshot.getKey()); + matchday.setName(postSnapshot.child("name").getValue(String.class)); + + List matches = new ArrayList<>(); + for (DataSnapshot matchSnapshot : postSnapshot.child("matches").getChildren()) { + Match match = matchSnapshot.getValue(Match.class); + if (match != null) { + match.setId(matchSnapshot.getKey()); + matches.add(match); + } + } + matchday.setMatches(matches); + matchdays.add(matchday); + } + adapter.setMatchdays(matchdays); + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + if (getContext() != null) { + Toast.makeText(getContext(), "Erro ao carregar jornadas: " + error.getMessage(), Toast.LENGTH_SHORT) + .show(); + } + } + }); + } + @Override public void onDestroyView() { super.onDestroyView(); diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java b/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java new file mode 100644 index 0000000..97c8460 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java @@ -0,0 +1,88 @@ +package com.example.vdcscore.ui.gallery; + +public class Match { + private String id; + private String homeTeam; + private String awayTeam; + private int homeScore; + private int awayScore; + private String date; + private String time; + private String status; // "Scheduled", "Finished", "Live" + + public Match() { + } + + public Match(String homeTeam, String awayTeam, String date, String time) { + this.homeTeam = homeTeam; + this.awayTeam = awayTeam; + this.date = date; + this.time = time; + this.status = "Scheduled"; + } + + // Getters and Setters + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getHomeTeam() { + return homeTeam; + } + + public void setHomeTeam(String homeTeam) { + this.homeTeam = homeTeam; + } + + public String getAwayTeam() { + return awayTeam; + } + + public void setAwayTeam(String awayTeam) { + this.awayTeam = awayTeam; + } + + public int getHomeScore() { + return homeScore; + } + + public void setHomeScore(int homeScore) { + this.homeScore = homeScore; + } + + public int getAwayScore() { + return awayScore; + } + + public void setAwayScore(int awayScore) { + this.awayScore = awayScore; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/Matchday.java b/app/src/main/java/com/example/vdcscore/ui/gallery/Matchday.java new file mode 100644 index 0000000..afbd216 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/Matchday.java @@ -0,0 +1,41 @@ +package com.example.vdcscore.ui.gallery; + +import java.util.List; + +public class Matchday { + private String id; + private String name; // e.g., "Jornada 1" + private List matches; + + public Matchday() { + } + + public Matchday(String name, List matches) { + this.name = name; + this.matches = matches; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getMatches() { + return matches; + } + + public void setMatches(List matches) { + this.matches = matches; + } +} diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/MatchdaysAdapter.java b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchdaysAdapter.java new file mode 100644 index 0000000..9990130 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchdaysAdapter.java @@ -0,0 +1,68 @@ +package com.example.vdcscore.ui.gallery; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.vdcscore.R; + +import java.util.ArrayList; +import java.util.List; + +public class MatchdaysAdapter extends RecyclerView.Adapter { + + private List matchdays = new ArrayList<>(); + private RecyclerView.RecycledViewPool viewPool = new RecyclerView.RecycledViewPool(); + + public void setMatchdays(List matchdays) { + this.matchdays = matchdays; + notifyDataSetChanged(); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.item_matchday, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + Matchday matchday = matchdays.get(position); + holder.textName.setText(matchday.getName()); + + // Setup nested RecyclerView + LinearLayoutManager layoutManager = new LinearLayoutManager( + holder.recyclerMatches.getContext(), + LinearLayoutManager.VERTICAL, + false); + layoutManager.setInitialPrefetchItemCount(matchday.getMatches().size()); + + MatchesAdapter matchesAdapter = new MatchesAdapter(matchday.getMatches()); + holder.recyclerMatches.setLayoutManager(layoutManager); + holder.recyclerMatches.setAdapter(matchesAdapter); + holder.recyclerMatches.setRecycledViewPool(viewPool); + } + + @Override + public int getItemCount() { + return matchdays.size(); + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + public final TextView textName; + public final RecyclerView recyclerMatches; + + public ViewHolder(View view) { + super(view); + textName = view.findViewById(R.id.text_matchday_name); + recyclerMatches = view.findViewById(R.id.recycler_matches); + } + } +} diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java new file mode 100644 index 0000000..283e2d6 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java @@ -0,0 +1,65 @@ +package com.example.vdcscore.ui.gallery; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.vdcscore.R; + +import java.util.List; + +public class MatchesAdapter extends RecyclerView.Adapter { + + private List matches; + + public MatchesAdapter(List matches) { + this.matches = matches; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.item_match, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + Match match = matches.get(position); + holder.textHomeTeam.setText(match.getHomeTeam()); + holder.textAwayTeam.setText(match.getAwayTeam()); + + if ("Finished".equals(match.getStatus())) { + holder.textScore.setText(match.getHomeScore() + " - " + match.getAwayScore()); + holder.textTime.setText("Final"); + } else { + holder.textScore.setText("Vs"); + holder.textTime.setText(match.getTime()); + } + } + + @Override + public int getItemCount() { + return matches == null ? 0 : matches.size(); + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + public final TextView textHomeTeam; + public final TextView textAwayTeam; + public final TextView textScore; + public final TextView textTime; + + public ViewHolder(View view) { + super(view); + textHomeTeam = view.findViewById(R.id.text_home_team); + textAwayTeam = view.findViewById(R.id.text_away_team); + textScore = view.findViewById(R.id.text_score); + textTime = view.findViewById(R.id.text_time); + } + } +} diff --git a/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java b/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java index a2f7e67..fa55b04 100644 --- a/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java +++ b/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java @@ -4,31 +4,90 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import androidx.lifecycle.ViewModelProvider; +import androidx.recyclerview.widget.LinearLayoutManager; import com.example.vdcscore.databinding.FragmentHomeBinding; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; public class HomeFragment extends Fragment { private FragmentHomeBinding binding; + private StandingsAdapter adapter; + private DatabaseReference mDatabase; public View onCreateView(@NonNull LayoutInflater inflater, - ViewGroup container, Bundle savedInstanceState) { - HomeViewModel homeViewModel = - new ViewModelProvider(this).get(HomeViewModel.class); + ViewGroup container, Bundle savedInstanceState) { binding = FragmentHomeBinding.inflate(inflater, container, false); View root = binding.getRoot(); - final TextView textView = binding.textHome; - homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText); + // Initialize RecyclerView + adapter = new StandingsAdapter(); + binding.recyclerStandings.setLayoutManager(new LinearLayoutManager(getContext())); + binding.recyclerStandings.setAdapter(adapter); + + // Initialize Firebase + mDatabase = FirebaseDatabase.getInstance().getReference("standings"); + + // Fetch Data + fetchStandings(); + return root; } + private void fetchStandings() { + mDatabase.addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + List teams = new ArrayList<>(); + for (DataSnapshot postSnapshot : snapshot.getChildren()) { + Team team = postSnapshot.getValue(Team.class); + if (team != null) { + // If ID is missing, set it from the key + if (team.getId() == null) { + team.setId(postSnapshot.getKey()); + } + teams.add(team); + } + } + + // Sort by Points (Descending), then Goal Difference, then Goals For + Collections.sort(teams, new Comparator() { + @Override + public int compare(Team t1, Team t2) { + if (t1.getPoints() != t2.getPoints()) { + return t2.getPoints() - t1.getPoints(); // Descending points + } + return t2.getGoalDifference() - t1.getGoalDifference(); // Descending GD + } + }); + + adapter.setTeams(teams); + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + if (getContext() != null) { + Toast.makeText(getContext(), "Erro ao carregar classificação: " + error.getMessage(), + Toast.LENGTH_SHORT).show(); + } + } + }); + } + @Override public void onDestroyView() { super.onDestroyView(); diff --git a/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java b/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java new file mode 100644 index 0000000..3015c33 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java @@ -0,0 +1,66 @@ +package com.example.vdcscore.ui.home; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.vdcscore.R; + +import java.util.ArrayList; +import java.util.List; + +public class StandingsAdapter extends RecyclerView.Adapter { + + private List mTeams; + + public StandingsAdapter() { + this.mTeams = new ArrayList<>(); + } + + public void setTeams(List teams) { + this.mTeams = teams; + notifyDataSetChanged(); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.item_standing, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + Team team = mTeams.get(position); + + holder.textPosition.setText(String.valueOf(position + 1)); + holder.textTeamName.setText(team.getName()); + holder.textPlayed.setText(String.valueOf(team.getPlayed())); + holder.textPoints.setText(String.valueOf(team.getPoints())); + } + + @Override + public int getItemCount() { + return mTeams.size(); + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + public final TextView textPosition; + public final TextView textTeamName; + public final TextView textPlayed; + public final TextView textPoints; + + public ViewHolder(View view) { + super(view); + textPosition = view.findViewById(R.id.text_position); + textTeamName = view.findViewById(R.id.text_team_name); + textPlayed = view.findViewById(R.id.text_played); + textPoints = view.findViewById(R.id.text_points); + } + } +} diff --git a/app/src/main/java/com/example/vdcscore/ui/home/Team.java b/app/src/main/java/com/example/vdcscore/ui/home/Team.java new file mode 100644 index 0000000..f4df6a7 --- /dev/null +++ b/app/src/main/java/com/example/vdcscore/ui/home/Team.java @@ -0,0 +1,106 @@ +package com.example.vdcscore.ui.home; + +public class Team { + private String id; + private String name; + private int points; + private int played; + private int won; + private int drawn; + private int lost; + private int goalsFor; + private int goalsAgainst; + private int goalDifference; + + public Team() { + // Required empty constructor for Firebase + } + + public Team(String id, String name, int points, int played) { + this.id = id; + this.name = name; + this.points = points; + this.played = played; + } + + // Getters and Setters + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getPoints() { + return points; + } + + public void setPoints(int points) { + this.points = points; + } + + public int getPlayed() { + return played; + } + + public void setPlayed(int played) { + this.played = played; + } + + public int getWon() { + return won; + } + + public void setWon(int won) { + this.won = won; + } + + public int getDrawn() { + return drawn; + } + + public void setDrawn(int drawn) { + this.drawn = drawn; + } + + public int getLost() { + return lost; + } + + public void setLost(int lost) { + this.lost = lost; + } + + public int getGoalsFor() { + return goalsFor; + } + + public void setGoalsFor(int goalsFor) { + this.goalsFor = goalsFor; + } + + public int getGoalsAgainst() { + return goalsAgainst; + } + + public void setGoalsAgainst(int goalsAgainst) { + this.goalsAgainst = goalsAgainst; + } + + public int getGoalDifference() { + return goalDifference; + } + + public void setGoalDifference(int goalDifference) { + this.goalDifference = goalDifference; + } +} diff --git a/app/src/main/res/drawable/header_background.xml b/app/src/main/res/drawable/header_background.xml new file mode 100644 index 0000000..5f4258f --- /dev/null +++ b/app/src/main/res/drawable/header_background.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_gallery.xml b/app/src/main/res/layout/fragment_gallery.xml index 4f541ca..1718b47 100644 --- a/app/src/main/res/layout/fragment_gallery.xml +++ b/app/src/main/res/layout/fragment_gallery.xml @@ -1,131 +1,27 @@ - - + + + android:clipToPadding="false" + android:paddingBottom="16dp"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index f3d9b08..03b7882 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,22 +1,69 @@ - - \ No newline at end of file + android:text="Classificação" + android:textSize="24sp" + android:textStyle="bold" + android:textColor="@color/primary_color" + android:layout_marginBottom="16dp" /> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_match.xml b/app/src/main/res/layout/item_match.xml new file mode 100644 index 0000000..c67e7a3 --- /dev/null +++ b/app/src/main/res/layout/item_match.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_matchday.xml b/app/src/main/res/layout/item_matchday.xml new file mode 100644 index 0000000..c9e596d --- /dev/null +++ b/app/src/main/res/layout/item_matchday.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_standing.xml b/app/src/main/res/layout/item_standing.xml new file mode 100644 index 0000000..b8f799c --- /dev/null +++ b/app/src/main/res/layout/item_standing.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c8524cd..2f7613e 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -2,4 +2,21 @@ #FF000000 #FFFFFFFF + + + #263238 + #4f5b62 + #000a12 + + #009688 + #52c7b8 + #00675b + + #F5F5F5 + #FFFFFF + + #212121 + #757575 + + #BDBDBD \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 91fb20e..1f0174c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,14 +1,22 @@ VdcScore - MainActivity - Open navigation drawer - Close navigation drawer - Android Studio - android.studio@android.com - Navigation header - Settings + Classificação + Abrir menu + Fechar menu + VdcScore + O teu clube + Cabeçalho de navegação + Definições - Home - Classificação + Classificação + Jornadas Definições + + + Alterar Foto de Perfil + Escolher da Galeria + Inserir URL + Cancelar + OK + https://exemplo.com/foto.jpg \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 9df340f..9542df5 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,8 +1,17 @@ +