diff --git a/app/src/main/java/com/santiparra/yomitrack/model/AnimeItem.java b/app/src/main/java/com/santiparra/yomitrack/model/AnimeItem.java new file mode 100644 index 0000000..e4cf6f1 --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/AnimeItem.java @@ -0,0 +1,49 @@ +package com.santiparra.yomitrack.model; + +public class AnimeItem { + private String title; + private String imageUrl; + private int watchedEpisodes; + private int totalEpisodes; + private double score; + private String type; + private String status; // Nuevo atributo + + public AnimeItem(String title, String imageUrl, int watchedEpisodes, int totalEpisodes, double score, String type, String status) { + this.title = title; + this.imageUrl = imageUrl; + this.watchedEpisodes = watchedEpisodes; + this.totalEpisodes = totalEpisodes; + this.score = score; + this.type = type; + this.status = status; + } + + public String getTitle() { + return title; + } + + public String getImageUrl() { + return imageUrl; + } + + public int getWatchedEpisodes() { + return watchedEpisodes; + } + + public int getTotalEpisodes() { + return totalEpisodes; + } + + public double getScore() { + return score; + } + + public String getType() { + return type; + } + + public String getStatus() { + return status; + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/ItemModel.java b/app/src/main/java/com/santiparra/yomitrack/model/ItemModel.java new file mode 100644 index 0000000..4b36859 --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/ItemModel.java @@ -0,0 +1,56 @@ +package com.santiparra.yomitrack.model; // Ajusta el paquete si necesitas + +public class ItemModel { + + private String title; + private String progress; + private String imageUrl; + private ContentType contentType; // Anime o Manga + + public enum ContentType { + ANIME, + MANGA + } + + // Constructor completo + public ItemModel(String title, String progress, String imageUrl, ContentType contentType) { + this.title = title; + this.progress = progress; + this.imageUrl = imageUrl; + this.contentType = contentType; + } + + // Getters + public String getTitle() { + return title; + } + + public String getProgress() { + return progress; + } + + public String getImageUrl() { + return imageUrl; + } + + public ContentType getContentType() { + return contentType; + } + + // Setters (opcional si quieres mutar los datos después) + public void setTitle(String title) { + this.title = title; + } + + public void setProgress(String progress) { + this.progress = progress; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public void setContentType(ContentType contentType) { + this.contentType = contentType; + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/RecentActivityModel.java b/app/src/main/java/com/santiparra/yomitrack/model/RecentActivityModel.java new file mode 100644 index 0000000..4ff5036 --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/RecentActivityModel.java @@ -0,0 +1,13 @@ +package com.santiparra.yomitrack.model; + +public class RecentActivityModel { + public String user, action, title, time, imageUrl; + + public RecentActivityModel(String user, String action, String title, String time, String imageUrl) { + this.user = user; + this.action = action; + this.title = title; + this.time = time; + this.imageUrl = imageUrl; + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/UserStats.java b/app/src/main/java/com/santiparra/yomitrack/model/UserStats.java new file mode 100644 index 0000000..4a930bb --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/UserStats.java @@ -0,0 +1,25 @@ +package com.santiparra.yomitrack.model; + +public class UserStats { + private String category; + private int count; + private int percentage; + + public UserStats(String category, int count, int percentage) { + this.category = category; + this.count = count; + this.percentage = percentage; + } + + public String getCategory() { + return category; + } + + public int getCount() { + return count; + } + + public int getPercentage() { + return percentage; + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AiringViewHolder.java b/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AiringViewHolder.java new file mode 100644 index 0000000..827e45e --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AiringViewHolder.java @@ -0,0 +1,41 @@ +package com.santiparra.yomitrack.model.adapters.airing; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.santiparra.yomitrack.R; +import com.santiparra.yomitrack.model.ItemModel; + +public class AiringViewHolder extends RecyclerView.ViewHolder { + + public ImageView imageView; + public TextView titleTextView; + public TextView progressTextView; + + public AiringViewHolder(@NonNull View itemView) { + super(itemView); + imageView = itemView.findViewById(R.id.mediaImage); + titleTextView = itemView.findViewById(R.id.titleTextView); + progressTextView = itemView.findViewById(R.id.progressTextView); + } + + public void bind(ItemModel item) { + titleTextView.setText(item.getTitle()); + progressTextView.setText("Progress: " + item.getProgress()); + + if (item.getImageUrl() != null && !item.getImageUrl().isEmpty()) { + Glide.with(itemView.getContext()) + .load(item.getImageUrl()) + .placeholder(R.drawable.placeholder_image) + .error(R.drawable.error_image) + .into(imageView); + } else { + imageView.setImageResource(R.drawable.placeholder_image); + } + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AnimeViewHolder.java b/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AnimeViewHolder.java new file mode 100644 index 0000000..e630cbc --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/adapters/airing/AnimeViewHolder.java @@ -0,0 +1,41 @@ +package com.santiparra.yomitrack.model.adapters.airing; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.santiparra.yomitrack.R; +import com.santiparra.yomitrack.model.ItemModel; + +public class AnimeViewHolder extends RecyclerView.ViewHolder { + + public ImageView imageView; + public TextView titleTextView; + public TextView progressTextView; + + public AnimeViewHolder(@NonNull View itemView) { + super(itemView); + imageView = itemView.findViewById(R.id.mediaImage); + titleTextView = itemView.findViewById(R.id.titleTextView); + progressTextView = itemView.findViewById(R.id.progressTextView); + } + + public void bind(ItemModel item) { + titleTextView.setText(item.getTitle()); + progressTextView.setText("Progress: " + item.getProgress()); + + if (item.getImageUrl() != null && !item.getImageUrl().isEmpty()) { + Glide.with(itemView.getContext()) + .load(item.getImageUrl()) + .placeholder(R.drawable.placeholder_image) + .error(R.drawable.error_image) + .into(imageView); + } else { + imageView.setImageResource(R.drawable.placeholder_image); + } + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/adapters/anime_adapter/AnimeAdapter.java b/app/src/main/java/com/santiparra/yomitrack/model/adapters/anime_adapter/AnimeAdapter.java new file mode 100644 index 0000000..99d56ee --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/adapters/anime_adapter/AnimeAdapter.java @@ -0,0 +1,135 @@ +package com.santiparra.yomitrack.model.adapters.anime_adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.PopupMenu; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.santiparra.yomitrack.R; +import com.santiparra.yomitrack.model.AnimeItem; + +import java.util.List; + +public class AnimeAdapter extends RecyclerView.Adapter { + + private final List animeList; + private final Context context; + private int viewMode = 0; + + public interface OnAnimeRemoveListener { + void onAnimeRemoved(AnimeItem anime); + } + + private OnAnimeRemoveListener removeListener; + + public void setOnAnimeRemoveListener(OnAnimeRemoveListener listener) { + this.removeListener = listener; + } + + public void setViewMode(int mode) { + this.viewMode = mode; + } + + public AnimeAdapter(Context context, List animeList) { + this.context = context; + this.animeList = animeList; + } + + @NonNull + @Override + public AnimeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + int layoutId; + switch (viewMode) { + case 1: + layoutId = R.layout.item_anime_large; // solo imagen con score y episodios + break; + case 2: + layoutId = R.layout.item_anime_compact; // solo texto + break; + default: + layoutId = R.layout.item_anime; // imagen + texto + break; + } + View view = LayoutInflater.from(context).inflate(layoutId, parent, false); + return new AnimeViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull AnimeViewHolder holder, int position) { + AnimeItem anime = animeList.get(position); + + if (holder.title != null) + holder.title.setText(anime.getTitle()); + + if (holder.progress != null) + holder.progress.setText("Progress: " + anime.getWatchedEpisodes() + "/" + anime.getTotalEpisodes()); + + if (holder.score != null) + holder.score.setText(String.valueOf(anime.getScore())); + + if (holder.type != null) + holder.type.setText(anime.getType()); + + if (holder.cover != null) { + Glide.with(context) + .load(anime.getImageUrl()) + .placeholder(R.drawable.sample_anime_cover) + .into(holder.cover); + } + + if (holder.buttonOptions != null) { + holder.buttonOptions.setOnClickListener(v -> { + PopupMenu popup = new PopupMenu(context, holder.buttonOptions); + popup.inflate(R.menu.anime_item_menu); + popup.setOnMenuItemClickListener(item -> { + int id = item.getItemId(); + if (id == R.id.action_edit) { + Toast.makeText(context, "Edit: " + anime.getTitle(), Toast.LENGTH_SHORT).show(); + return true; + } else if (id == R.id.action_remove) { + int pos = holder.getAdapterPosition(); + if (pos != RecyclerView.NO_POSITION) { + AnimeItem removed = animeList.remove(pos); + notifyItemRemoved(pos); + if (removeListener != null) { + removeListener.onAnimeRemoved(removed); + } + Toast.makeText(context, "Removed: " + removed.getTitle(), Toast.LENGTH_SHORT).show(); + } + return true; + } + return false; + }); + popup.show(); + }); + } + } + + @Override + public int getItemCount() { + return animeList.size(); + } + + static class AnimeViewHolder extends RecyclerView.ViewHolder { + TextView title, progress, score, type; + ImageView cover, buttonOptions; + + AnimeViewHolder(View itemView) { + super(itemView); + title = itemView.findViewById(R.id.textViewTitle); + progress = itemView.findViewById(R.id.textViewProgress); + score = itemView.findViewById(R.id.textViewScore); + type = itemView.findViewById(R.id.textViewType); + cover = itemView.findViewById(R.id.imageViewCover); + buttonOptions = itemView.findViewById(R.id.buttonOptions); + } + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/model/adapters/recentactivity_adapter/RecentActivityAdapter.java b/app/src/main/java/com/santiparra/yomitrack/model/adapters/recentactivity_adapter/RecentActivityAdapter.java new file mode 100644 index 0000000..0548603 --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/model/adapters/recentactivity_adapter/RecentActivityAdapter.java @@ -0,0 +1,64 @@ +package com.santiparra.yomitrack.model.adapters.recentactivity_adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; +import com.santiparra.yomitrack.R; +import com.santiparra.yomitrack.model.RecentActivityModel; + +import java.util.List; + +public class RecentActivityAdapter extends RecyclerView.Adapter { + private final List activityList; + + public RecentActivityAdapter(List activityList) { + this.activityList = activityList; + } + + @NonNull + @Override + public ActivityViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_activity_card, parent, false); + return new ActivityViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ActivityViewHolder holder, int position) { + RecentActivityModel activity = activityList.get(position); + holder.user.setText(activity.user); + holder.action.setText(activity.action); + holder.title.setText(activity.title); + holder.time.setText(activity.time); + + Glide.with(holder.image.getContext()) + .load(activity.imageUrl) + .placeholder(R.drawable.placeholder_image) + .into(holder.image); + } + + @Override + public int getItemCount() { + return activityList.size(); + } + + static class ActivityViewHolder extends RecyclerView.ViewHolder { + TextView user, action, title, time; + ImageView image; + + public ActivityViewHolder(@NonNull View itemView) { + super(itemView); + user = itemView.findViewById(R.id.activityUser); + action = itemView.findViewById(R.id.activityAction); + title = itemView.findViewById(R.id.activityTitle); + time = itemView.findViewById(R.id.activityTime); + image = itemView.findViewById(R.id.activityCover); + } + } +} diff --git a/app/src/main/java/com/santiparra/yomitrack/utils/StatsHelper.java b/app/src/main/java/com/santiparra/yomitrack/utils/StatsHelper.java new file mode 100644 index 0000000..151c6fa --- /dev/null +++ b/app/src/main/java/com/santiparra/yomitrack/utils/StatsHelper.java @@ -0,0 +1,29 @@ +package com.santiparra.yomitrack.utils; + +import com.santiparra.yomitrack.model.UserStats; + +import java.util.ArrayList; +import java.util.List; + +public class StatsHelper { + + public static List getAnimeStats() { + List stats = new ArrayList<>(); + stats.add(new UserStats("Watching", 42, 8)); + stats.add(new UserStats("Completed", 265, 51)); + stats.add(new UserStats("On Hold", 10, 2)); + stats.add(new UserStats("Dropped", 5, 1)); + stats.add(new UserStats("Plan to Watch", 198, 38)); + return stats; + } + + public static List getMangaStats() { + List stats = new ArrayList<>(); + stats.add(new UserStats("Reading", 31, 10)); + stats.add(new UserStats("Completed", 121, 55)); + stats.add(new UserStats("On Hold", 5, 3)); + stats.add(new UserStats("Dropped", 4, 2)); + stats.add(new UserStats("Plan to Read", 28, 30)); + return stats; + } +} diff --git a/app/src/main/res/drawable/edit_text_background.xml b/app/src/main/res/drawable/edit_text_background.xml new file mode 100644 index 0000000..6c1a3d7 --- /dev/null +++ b/app/src/main/res/drawable/edit_text_background.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/edittext_background.xml b/app/src/main/res/drawable/edittext_background.xml new file mode 100644 index 0000000..3f8bf5a --- /dev/null +++ b/app/src/main/res/drawable/edittext_background.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/app/src/main/res/drawable/rectangle_placeholder.xml b/app/src/main/res/drawable/error_image.xml similarity index 100% rename from app/src/main/res/drawable/rectangle_placeholder.xml rename to app/src/main/res/drawable/error_image.xml diff --git a/app/src/main/res/drawable/ic_arrow_down.png b/app/src/main/res/drawable/ic_arrow_down.png new file mode 100644 index 0000000..3f5a751 Binary files /dev/null and b/app/src/main/res/drawable/ic_arrow_down.png differ diff --git a/app/src/main/res/drawable/ic_comment.png b/app/src/main/res/drawable/ic_comment.png new file mode 100644 index 0000000..0eca958 Binary files /dev/null and b/app/src/main/res/drawable/ic_comment.png differ diff --git a/app/src/main/res/drawable/ic_heart.png b/app/src/main/res/drawable/ic_heart.png new file mode 100644 index 0000000..bac47f9 Binary files /dev/null and b/app/src/main/res/drawable/ic_heart.png differ diff --git a/app/src/main/res/drawable/ic_more_vert.xml b/app/src/main/res/drawable/ic_more_vert.xml new file mode 100644 index 0000000..0cf8e7f --- /dev/null +++ b/app/src/main/res/drawable/ic_more_vert.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_view_comfy.png b/app/src/main/res/drawable/ic_view_comfy.png new file mode 100644 index 0000000..9f66738 Binary files /dev/null and b/app/src/main/res/drawable/ic_view_comfy.png differ diff --git a/app/src/main/res/drawable/ic_view_list.png b/app/src/main/res/drawable/ic_view_list.png new file mode 100644 index 0000000..8c920d9 Binary files /dev/null and b/app/src/main/res/drawable/ic_view_list.png differ diff --git a/app/src/main/res/drawable/ic_view_module.png b/app/src/main/res/drawable/ic_view_module.png new file mode 100644 index 0000000..59e8c2c Binary files /dev/null and b/app/src/main/res/drawable/ic_view_module.png differ diff --git a/app/src/main/res/drawable/progress_bar.xml b/app/src/main/res/drawable/progress_bar.xml new file mode 100644 index 0000000..ca9bc83 --- /dev/null +++ b/app/src/main/res/drawable/progress_bar.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/rounded_mask.xml b/app/src/main/res/drawable/rounded_mask.xml new file mode 100644 index 0000000..371c87e --- /dev/null +++ b/app/src/main/res/drawable/rounded_mask.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/drawable/sample_anime_cover.xml b/app/src/main/res/drawable/sample_anime_cover.xml new file mode 100644 index 0000000..f36258e --- /dev/null +++ b/app/src/main/res/drawable/sample_anime_cover.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/drawable/sample_cover.png b/app/src/main/res/drawable/sample_cover.png new file mode 100644 index 0000000..e550d24 Binary files /dev/null and b/app/src/main/res/drawable/sample_cover.png differ diff --git a/app/src/main/res/layout/item_activity.xml b/app/src/main/res/layout/item_activity.xml new file mode 100644 index 0000000..6c64308 --- /dev/null +++ b/app/src/main/res/layout/item_activity.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_activity_card.xml b/app/src/main/res/layout/item_activity_card.xml new file mode 100644 index 0000000..abe24e5 --- /dev/null +++ b/app/src/main/res/layout/item_activity_card.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_anime.xml b/app/src/main/res/layout/item_anime.xml new file mode 100644 index 0000000..9190a3c --- /dev/null +++ b/app/src/main/res/layout/item_anime.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_anime_compact.xml b/app/src/main/res/layout/item_anime_compact.xml new file mode 100644 index 0000000..bbc720e --- /dev/null +++ b/app/src/main/res/layout/item_anime_compact.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/app/src/main/res/layout/item_anime_large.xml b/app/src/main/res/layout/item_anime_large.xml new file mode 100644 index 0000000..1338f62 --- /dev/null +++ b/app/src/main/res/layout/item_anime_large.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_manga.xml b/app/src/main/res/layout/item_manga.xml new file mode 100644 index 0000000..af10bc2 --- /dev/null +++ b/app/src/main/res/layout/item_manga.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_manga_compact.xml b/app/src/main/res/layout/item_manga_compact.xml new file mode 100644 index 0000000..12851aa --- /dev/null +++ b/app/src/main/res/layout/item_manga_compact.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/app/src/main/res/layout/item_manga_large.xml b/app/src/main/res/layout/item_manga_large.xml new file mode 100644 index 0000000..0c27f16 --- /dev/null +++ b/app/src/main/res/layout/item_manga_large.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_media_card.xml b/app/src/main/res/layout/item_media_card.xml new file mode 100644 index 0000000..9128f97 --- /dev/null +++ b/app/src/main/res/layout/item_media_card.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_stat_bar.xml b/app/src/main/res/layout/item_stat_bar.xml new file mode 100644 index 0000000..41506be --- /dev/null +++ b/app/src/main/res/layout/item_stat_bar.xml @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/app/src/main/res/menu/anime_item_menu.xml b/app/src/main/res/menu/anime_item_menu.xml new file mode 100644 index 0000000..ada2db9 --- /dev/null +++ b/app/src/main/res/menu/anime_item_menu.xml @@ -0,0 +1,4 @@ + + + + diff --git a/app/src/main/res/menu/filter_list_menu.xml b/app/src/main/res/menu/filter_list_menu.xml new file mode 100644 index 0000000..d4468ab --- /dev/null +++ b/app/src/main/res/menu/filter_list_menu.xml @@ -0,0 +1,8 @@ + + + + + + + +