Optimizacion de los xml y implemetacion de nuevas clases y optimizacion igualmente de classes antiguas
This commit is contained in:
parent
c497403142
commit
07b617a195
|
|
@ -1,4 +1,4 @@
|
||||||
package com.santiparra.yomitrack.ui.adapters; // Ajusta tu paquete si es necesario
|
package com.santiparra.yomitrack.model.adapters.homeadapter; // Ajusta tu paquete si es necesario
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -39,13 +39,17 @@ public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.item_media_card, parent, false);
|
||||||
|
|
||||||
|
// Ajustamos manualmente el ancho
|
||||||
|
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
|
||||||
|
layoutParams.width = (int) (parent.getMeasuredWidth() * 0.85); // 85% del ancho de pantalla
|
||||||
|
view.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
if (viewType == TYPE_AIRING) {
|
if (viewType == TYPE_AIRING) {
|
||||||
View view = LayoutInflater.from(parent.getContext())
|
|
||||||
.inflate(R.layout.item_anime_horizontal_card, parent, false);
|
|
||||||
return new AiringViewHolder(view);
|
return new AiringViewHolder(view);
|
||||||
} else {
|
} else {
|
||||||
View view = LayoutInflater.from(parent.getContext())
|
|
||||||
.inflate(R.layout.item_anime_card, parent, false);
|
|
||||||
return new AnimeViewHolder(view);
|
return new AnimeViewHolder(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.santiparra.yomitrack.model.ItemModel;
|
import com.santiparra.yomitrack.model.ItemModel;
|
||||||
import com.santiparra.yomitrack.ui.adapters.HomeAdapter;
|
|
||||||
import com.santiparra.yomitrack.R;
|
import com.santiparra.yomitrack.R;
|
||||||
|
import com.santiparra.yomitrack.model.adapters.homeadapter.HomeAdapter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -41,6 +41,7 @@ public class SectionAdapter extends RecyclerView.Adapter<SectionAdapter.SectionV
|
||||||
holder.sectionTitle.setText(title);
|
holder.sectionTitle.setText(title);
|
||||||
|
|
||||||
HomeAdapter homeAdapter = new HomeAdapter(items, title);
|
HomeAdapter homeAdapter = new HomeAdapter(items, title);
|
||||||
|
|
||||||
holder.sectionRecycler.setLayoutManager(
|
holder.sectionRecycler.setLayoutManager(
|
||||||
new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false)
|
new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
/*Implementation of bottomNav*/
|
/*Implementation of bottomNav*/
|
||||||
replaceFragment(new FragmentHome());
|
replaceFragment(new FragmentHome());
|
||||||
//¡
|
|
||||||
|
|
||||||
binding.bottomNavigationView.setOnItemSelectedListener(item -> {
|
binding.bottomNavigationView.setOnItemSelectedListener(item -> {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,18 @@ package com.santiparra.yomitrack.ui.fragments.home;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
import com.santiparra.yomitrack.R;
|
import com.santiparra.yomitrack.R;
|
||||||
import com.santiparra.yomitrack.model.ItemModel;
|
import com.santiparra.yomitrack.model.ItemModel;
|
||||||
import com.santiparra.yomitrack.model.adapters.sectionadapter.SectionAdapter;
|
import com.santiparra.yomitrack.model.adapters.sectionadapter.SectionAdapter;
|
||||||
|
|
@ -29,6 +34,7 @@ public class FragmentHome extends Fragment {
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
// RecyclerView principal
|
||||||
RecyclerView mainRecyclerView = view.findViewById(R.id.mainRecyclerView);
|
RecyclerView mainRecyclerView = view.findViewById(R.id.mainRecyclerView);
|
||||||
|
|
||||||
// Crear las secciones
|
// Crear las secciones
|
||||||
|
|
@ -36,11 +42,10 @@ public class FragmentHome extends Fragment {
|
||||||
"Airing", "Anime in Progress", "Manga in Progress"
|
"Airing", "Anime in Progress", "Manga in Progress"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Crear el contenido de cada sección como List<ItemModel>
|
|
||||||
Map<String, List<ItemModel>> sectionItems = new HashMap<>();
|
Map<String, List<ItemModel>> sectionItems = new HashMap<>();
|
||||||
|
|
||||||
List<ItemModel> airingItems = new ArrayList<>();
|
List<ItemModel> airingItems = new ArrayList<>();
|
||||||
airingItems.add(new ItemModel("Naruto", "5/220", "https://i.imgur.com/N5uCbDu.jpg", ItemModel.ContentType.ANIME));
|
airingItems.add(new ItemModel("Naruto", "5/220", "https://th.bing.com/th/id/OIP.aypxRH6Qq7yXLFCXiYhaKAHaLo?rs=1&pid=ImgDetMain", ItemModel.ContentType.ANIME));
|
||||||
airingItems.add(new ItemModel("One Piece", "900/1100", "https://i.imgur.com/VgVfG6K.jpg", ItemModel.ContentType.ANIME));
|
airingItems.add(new ItemModel("One Piece", "900/1100", "https://i.imgur.com/VgVfG6K.jpg", ItemModel.ContentType.ANIME));
|
||||||
airingItems.add(new ItemModel("Bleach", "100/366", "https://i.imgur.com/I0d1HyA.jpg", ItemModel.ContentType.ANIME));
|
airingItems.add(new ItemModel("Bleach", "100/366", "https://i.imgur.com/I0d1HyA.jpg", ItemModel.ContentType.ANIME));
|
||||||
|
|
||||||
|
|
@ -52,14 +57,43 @@ public class FragmentHome extends Fragment {
|
||||||
mangaInProgressItems.add(new ItemModel("Chainsaw Man", "45/100", "https://i.imgur.com/7tZ0h8R.jpg", ItemModel.ContentType.MANGA));
|
mangaInProgressItems.add(new ItemModel("Chainsaw Man", "45/100", "https://i.imgur.com/7tZ0h8R.jpg", ItemModel.ContentType.MANGA));
|
||||||
mangaInProgressItems.add(new ItemModel("Berserk", "370/380", "https://i.imgur.com/8FJYYHo.jpg", ItemModel.ContentType.MANGA));
|
mangaInProgressItems.add(new ItemModel("Berserk", "370/380", "https://i.imgur.com/8FJYYHo.jpg", ItemModel.ContentType.MANGA));
|
||||||
|
|
||||||
// Asignar los items a las secciones
|
|
||||||
sectionItems.put("Airing", airingItems);
|
sectionItems.put("Airing", airingItems);
|
||||||
sectionItems.put("Anime in Progress", animeInProgressItems);
|
sectionItems.put("Anime in Progress", animeInProgressItems);
|
||||||
sectionItems.put("Manga in Progress", mangaInProgressItems);
|
sectionItems.put("Manga in Progress", mangaInProgressItems);
|
||||||
|
|
||||||
// Configurar RecyclerView
|
|
||||||
SectionAdapter adapter = new SectionAdapter(sectionTitles, sectionItems);
|
SectionAdapter adapter = new SectionAdapter(sectionTitles, sectionItems);
|
||||||
mainRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
mainRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
mainRecyclerView.setAdapter(adapter);
|
mainRecyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
// Sección inferior: campo de estado + nueva card
|
||||||
|
EditText editStatus = view.findViewById(R.id.editStatus);
|
||||||
|
|
||||||
|
View activityCard = view.findViewById(R.id.activityCard);
|
||||||
|
ImageView activityImage = activityCard.findViewById(R.id.activityImage);
|
||||||
|
TextView activityUser = activityCard.findViewById(R.id.activityUser);
|
||||||
|
TextView activityAction = activityCard.findViewById(R.id.activityAction);
|
||||||
|
TextView activityTitle = activityCard.findViewById(R.id.activityTitle);
|
||||||
|
TextView activityTime = activityCard.findViewById(R.id.activityTime);
|
||||||
|
|
||||||
|
// Contenido inicial
|
||||||
|
activityUser.setText("Midca");
|
||||||
|
activityAction.setText("Read chapters 1 - 60 of");
|
||||||
|
activityTitle.setText("Choujun! Choujou Senpai");
|
||||||
|
activityTime.setText("4 minutes ago");
|
||||||
|
|
||||||
|
Glide.with(requireContext())
|
||||||
|
.load("https://i.imgur.com/7tZ0h8R.jpg")
|
||||||
|
.placeholder(R.drawable.placeholder_image)
|
||||||
|
.error(R.drawable.error_image)
|
||||||
|
.into(activityImage);
|
||||||
|
|
||||||
|
// Actualización con el texto del usuario
|
||||||
|
editStatus.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
String status = editStatus.getText().toString().trim();
|
||||||
|
if (!status.isEmpty()) {
|
||||||
|
activityAction.setText(status);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,138 @@ import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.santiparra.yomitrack.R;
|
import com.santiparra.yomitrack.R;
|
||||||
|
import com.santiparra.yomitrack.model.UserStats;
|
||||||
|
import com.santiparra.yomitrack.utils.StatsHelper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FragmentProfile extends Fragment {
|
public class FragmentProfile extends Fragment {
|
||||||
|
|
||||||
|
public FragmentProfile() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle saveInstanceState){
|
Bundle savedInstanceState) {
|
||||||
return layoutInflater.inflate(R.layout.fragment_profile,container,false);
|
return inflater.inflate(R.layout.fragment_profile, container, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
TextView usernameText = view.findViewById(R.id.usernameText);
|
||||||
|
TextView descriptionText = view.findViewById(R.id.descriptionText);
|
||||||
|
LinearLayout statsContainer = view.findViewById(R.id.animeStatsContainer);
|
||||||
|
|
||||||
|
usernameText.setText("BtwIsSanti");
|
||||||
|
descriptionText.setText("Eiko is my waifu right now\nMai and Mikasa is my second wife");
|
||||||
|
|
||||||
|
// Cargar estadísticas simuladas
|
||||||
|
List<UserStats> statsList = StatsHelper.getAnimeStats();
|
||||||
|
|
||||||
|
for (UserStats stat : statsList) {
|
||||||
|
View statView = LayoutInflater.from(getContext())
|
||||||
|
.inflate(R.layout.item_stat_bar, statsContainer, false);
|
||||||
|
|
||||||
|
TextView label = statView.findViewById(R.id.statLabelFull);
|
||||||
|
ProgressBar bar = statView.findViewById(R.id.statProgressBar);
|
||||||
|
|
||||||
|
label.setText(stat.getCategory() + " • " + stat.getCount());
|
||||||
|
bar.setProgress(stat.getPercentage());
|
||||||
|
|
||||||
|
// Aplicar color distinto por categoría
|
||||||
|
int colorRes = R.color.primary; // default
|
||||||
|
switch (stat.getCategory()) {
|
||||||
|
case "Watching":
|
||||||
|
colorRes = R.color.statWatching;
|
||||||
|
break;
|
||||||
|
case "Completed":
|
||||||
|
colorRes = R.color.statCompleted;
|
||||||
|
break;
|
||||||
|
case "On Hold":
|
||||||
|
colorRes = R.color.statOnHold;
|
||||||
|
break;
|
||||||
|
case "Dropped":
|
||||||
|
colorRes = R.color.statDropped;
|
||||||
|
break;
|
||||||
|
case "Plan to Watch":
|
||||||
|
colorRes = R.color.statPlanToWatch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
bar.setProgressTintList(ContextCompat.getColorStateList(requireContext(), colorRes));
|
||||||
|
statsContainer.addView(statView);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Agregar tarjetas de actividad (opcional)
|
||||||
|
LinearLayout activityContainer = view.findViewById(R.id.activityContainer);
|
||||||
|
|
||||||
|
if (activityContainer != null) {
|
||||||
|
// Lista simulada de updates
|
||||||
|
String[] activities = {
|
||||||
|
"Watched episode 5 of Kakushite! Makina-san!!",
|
||||||
|
"Watched episode 5 of Chotto dake Ai ga Omo...",
|
||||||
|
"Watched episode 4 of Go-Toubun no Hanayome",
|
||||||
|
"Watched episode 3 of Kanojo, Okarishimasu",
|
||||||
|
"Watched episode 12 of Jujutsu Kaisen",
|
||||||
|
"Watched episode 8 of Bleach: TYBW",
|
||||||
|
"Watched episode 1 of Chainsaw Man",
|
||||||
|
"Watched episode 10 of Dr. Stone",
|
||||||
|
"Watched episode 9 of Mushoku Tensei",
|
||||||
|
"Watched episode 11 of Ousama Ranking",
|
||||||
|
"Watched episode 7 of HUNTER×HUNTER" // Se ignora si hay más de 10
|
||||||
|
};
|
||||||
|
|
||||||
|
int limit = Math.min(10, activities.length);
|
||||||
|
|
||||||
|
for (int i = 0; i < limit; i++) {
|
||||||
|
View card = LayoutInflater.from(getContext())
|
||||||
|
.inflate(R.layout.item_activity, activityContainer, false);
|
||||||
|
|
||||||
|
TextView text = card.findViewById(R.id.activityText);
|
||||||
|
TextView time = card.findViewById(R.id.activityTime);
|
||||||
|
|
||||||
|
text.setText(activities[i]);
|
||||||
|
time.setText("16 hours ago");
|
||||||
|
|
||||||
|
activityContainer.addView(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Estadísticas de manga
|
||||||
|
LinearLayout mangaStatsContainer = view.findViewById(R.id.mangaStatsContainer);
|
||||||
|
List<UserStats> mangaStats = StatsHelper.getMangaStats();
|
||||||
|
|
||||||
|
for (UserStats stat : mangaStats) {
|
||||||
|
View statView = LayoutInflater.from(getContext())
|
||||||
|
.inflate(R.layout.item_stat_bar, mangaStatsContainer, false);
|
||||||
|
|
||||||
|
TextView label = statView.findViewById(R.id.statLabelFull);
|
||||||
|
ProgressBar bar = statView.findViewById(R.id.statProgressBar);
|
||||||
|
|
||||||
|
label.setText(stat.getCategory() + " • " + stat.getCount());
|
||||||
|
bar.setProgress(stat.getPercentage());
|
||||||
|
|
||||||
|
int colorRes = R.color.primary;
|
||||||
|
switch (stat.getCategory()) {
|
||||||
|
case "Reading": colorRes = R.color.statWatching; break;
|
||||||
|
case "Completed": colorRes = R.color.statCompleted; break;
|
||||||
|
case "On Hold": colorRes = R.color.statOnHold; break;
|
||||||
|
case "Dropped": colorRes = R.color.statDropped; break;
|
||||||
|
case "Plan to Read": colorRes = R.color.statPlanToWatch; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
bar.setProgressTintList(ContextCompat.getColorStateList(requireContext(), colorRes));
|
||||||
|
mangaStatsContainer.addView(statView);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="85dp"
|
android:layout_height="85dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
android:background="@color/primary">
|
android:background="@color/primary">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
|
@ -34,8 +35,8 @@
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@drawable/logo_yomitrack"
|
android:scaleType="fitCenter"
|
||||||
android:scaleType="fitCenter" />
|
android:src="@drawable/logo_yomitrack" />
|
||||||
|
|
||||||
<!-- Icono de perfil en la AppBar (circular) -->
|
<!-- Icono de perfil en la AppBar (circular) -->
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
@ -44,11 +45,11 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@drawable/ic_profile"
|
|
||||||
android:background="@drawable/circle_mask"
|
android:background="@drawable/circle_mask"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
|
android:contentDescription="Profile"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:contentDescription="Profile" />
|
android:src="@drawable/ic_profile" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/background"
|
android:background="@color/background"
|
||||||
tools:context="ui.fragments.home.FragmentHome">
|
tools:context=".ui.fragments.home.FragmentHome">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:fillViewport="true"
|
||||||
android:paddingTop="100dp"
|
|
||||||
android:paddingBottom="32dp"
|
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<LinearLayout
|
||||||
android:id="@+id/mainRecyclerView"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:orientation="vertical"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="80dp"
|
||||||
android:paddingBottom="100dp"
|
android:paddingBottom="100dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false">
|
||||||
android:overScrollMode="never"
|
|
||||||
android:contentDescription="@string/home_section_list" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/mainRecyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:contentDescription="@string/home_section_list" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editStatus"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="60dp"
|
||||||
|
android:hint="Write a status..."
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:background="@drawable/edit_text_background"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textColorHint="@color/textPrimary" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/item_activity_card"
|
||||||
|
android:id="@+id/activityCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginHorizontal="16dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,178 @@
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/background"
|
android:background="@color/background"
|
||||||
tools:context="ui.fragments.profile.FragmentProfile">
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:text="Profile"
|
android:paddingBottom="80dp"> <!-- evita que se tape el final -->
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="30sp"
|
|
||||||
android:textColor="@color/textPrimary"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
<!-- Header con imagen -->
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="200dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/coverImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/sample_cover" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/avatarImage"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:background="@drawable/circle_mask"
|
||||||
|
android:clipToOutline="true"
|
||||||
|
android:src="@drawable/sample_avatar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/usernameText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/avatarImage"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_toEndOf="@id/avatarImage"
|
||||||
|
android:text="BtwIsSanti"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- Descripción -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/descriptionText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Eiko is my waifu right now\nMai and Mikasa is my second wife"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<!-- Título: Anime Stats -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Anime Stats"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="16dp" />
|
||||||
|
|
||||||
|
<!-- Totales de anime -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="3"
|
||||||
|
android:layout_marginTop="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="520\nTotal Anime"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="150.5\nDays Watched"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="67.8\nMean Score"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Contenedor de barras dinámicas de anime -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/animeStatsContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="8dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Título: Manga Stats -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Manga Stats"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="16dp" />
|
||||||
|
|
||||||
|
<!-- Totales de manga -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="3"
|
||||||
|
android:layout_marginTop="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="189\nTotal Manga"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="9280\nChapters Read"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="71.0\nMean Score"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Contenedor de barras dinámicas de manga -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/mangaStatsContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="8dp" />
|
||||||
|
|
||||||
|
<!-- Actividad -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/activityContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="24dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:gravity="center_horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/animeImage"
|
|
||||||
android:layout_width="160dp"
|
|
||||||
android:layout_height="220dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:contentDescription="@string/anime_image_desc"
|
|
||||||
android:background="@drawable/rectangle_placeholder" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/titleTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Anime Title"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@color/background"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginTop="4dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/progressTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="3/12 eps"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="@color/textPrimary"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_marginBottom="8dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/animeImage"
|
|
||||||
android:layout_width="160dp"
|
|
||||||
android:layout_height="220dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:contentDescription="@string/anime_image_desc"
|
|
||||||
android:background="@drawable/rectangle_placeholder" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/titleTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Manga Title"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@color/textPrimary"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginTop="4dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/progressTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="45/100 ch"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="@color/textPrimary"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
@ -1,27 +1,31 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingBottom="0dp">
|
||||||
android:paddingBottom="16dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sectionTitle"
|
android:id="@+id/sectionTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Section Title"
|
android:text="Section Title"
|
||||||
android:textSize="20sp"
|
android:textSize="22sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/textPrimary"
|
android:textColor="@color/textPrimary"
|
||||||
android:layout_marginBottom="12dp" />
|
android:paddingBottom="8dp" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/sectionRecycler"
|
android:id="@+id/sectionRecycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:overScrollMode="never"
|
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:nestedScrollingEnabled="false" />
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,13 @@
|
||||||
<color name="primary">#1F2937</color>
|
<color name="primary">#1F2937</color>
|
||||||
<color name="background">#121926</color>
|
<color name="background">#121926</color>
|
||||||
<color name="textPrimary">#FFFFFF</color>
|
<color name="textPrimary">#FFFFFF</color>
|
||||||
|
<color name="gray">#808080</color>
|
||||||
|
|
||||||
|
<!-- Colores por estado -->
|
||||||
|
<color name="statWatching">#3db4f2</color>
|
||||||
|
<color name="statCompleted">#16c98d</color>
|
||||||
|
<color name="statOnHold">#f5a623</color>
|
||||||
|
<color name="statDropped">#f45b69</color>
|
||||||
|
<color name="statPlanToWatch">#c678dd</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -6,4 +6,15 @@
|
||||||
<item name="sectionTitle" type="id" />
|
<item name="sectionTitle" type="id" />
|
||||||
<item name="sectionRecycler" type="id" />
|
<item name="sectionRecycler" type="id" />
|
||||||
<item name="mediaImage" type="id" />
|
<item name="mediaImage" type="id" />
|
||||||
|
<item name="mainRecyclerView" type="id" />
|
||||||
|
<item name="editStatus" type="id" />
|
||||||
|
<item name="activityCard" type="id" />
|
||||||
|
<item name="activityImage" type="id" />
|
||||||
|
<item name="activityUser" type="id" />
|
||||||
|
<item name="activityText" type="id" />
|
||||||
|
<item name="activityTime" type="id" />
|
||||||
|
<item name="activityTitle" type="id" />
|
||||||
|
<item name="activityAction" type="id" />
|
||||||
|
<item name="statLabelFull" type="id" />
|
||||||
|
<item name="statProgressBar" type="id" />
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -4,4 +4,6 @@
|
||||||
<string name="manga_image_desc" />
|
<string name="manga_image_desc" />
|
||||||
<string name="anime_image_desc" />
|
<string name="anime_image_desc" />
|
||||||
<string name="media_image_desc">Media Image</string>
|
<string name="media_image_desc">Media Image</string>
|
||||||
|
<string name="profile">\n</string>
|
||||||
|
<string name="write_a_status">Write a status...</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue