feat: statistics (wip)

This commit is contained in:
rebelonion 2024-03-02 04:54:02 -06:00
parent 533148069f
commit 500de4e45e
12 changed files with 690 additions and 356 deletions

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/profileProgressBar"
@ -12,255 +12,150 @@
android:layout_height="match_parent"
android:gravity="center"
tools:visibility="gone">
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/profileTopContainer"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/profileBannerImage"
android:layout_width="match_parent"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/gradient_background"
tools:ignore="ContentDescription" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileUserAvatarContainer"
android:layout_width="82dp"
android:layout_height="82dp"
android:layout_marginTop="-52dp"
android:layout_marginEnd="32dp"
android:layout_gravity="end"
app:cardCornerRadius="40dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/profileUserAvatar"
android:layout_gravity="center"
android:layout_width="78dp"
android:layout_height="78dp"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
android:layout_height="wrap_content"
android:layout_marginBottom="72dp">
<LinearLayout
android:id="@+id/profileUserDataContainer"
android:id="@+id/profileTopContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:orientation="vertical"
tools:visibility="visible">
android:orientation="vertical">
<TextView
android:id="@+id/profileUserName"
android:layout_width="wrap_content"
<ImageView
android:id="@+id/profileBannerImage"
android:layout_width="match_parent"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/gradient_background"
tools:ignore="ContentDescription" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileUserAvatarContainer"
android:layout_width="82dp"
android:layout_height="82dp"
android:layout_gravity="end"
android:layout_marginTop="-52dp"
android:layout_marginEnd="32dp"
app:cardCornerRadius="40dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/profileUserAvatar"
android:layout_width="78dp"
android:layout_height="78dp"
android:layout_gravity="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:id="@+id/profileUserDataContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="@string/username"
android:textSize="18sp" />
android:layout_marginStart="18dp"
android:layout_marginTop="-32dp"
android:orientation="vertical"
tools:visibility="visible">
<TextView
android:id="@+id/profileUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="@string/username"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins"
android:text="@string/episodes_watched"
android:textSize="12sp"
tools:ignore="TextContrastCheck,TooDeepLayout" />
<TextView
android:id="@+id/profileUserEpisodesWatched"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:textColor="?attr/colorPrimaryVariant"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins"
android:text="@string/chapters_read"
android:textSize="12sp"
tools:ignore="TextContrastCheck" />
<TextView
android:id="@+id/profileUserChaptersRead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:textColor="?attr/colorPrimaryVariant"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins"
android:text="@string/episodes_watched"
android:textSize="12sp"
tools:ignore="TextContrastCheck,TooDeepLayout" />
<TextView
android:id="@+id/profileUserEpisodesWatched"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:textColor="?attr/colorPrimaryVariant"
android:textSize="12sp" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/mediaViewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="true"
tools:ignore="SpeakableTextPresentCheck" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins"
android:text="@string/chapters_read"
android:textSize="12sp"
tools:ignore="TextContrastCheck" />
<TextView
android:id="@+id/profileUserChaptersRead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:textColor="?attr/colorPrimaryVariant"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="24dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="List"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</ScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/profileListContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingStart="24dp"
android:paddingEnd="24dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileAnimeList"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_margin="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardCornerRadius="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/profileMangaList"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_max="256dp"
tools:visibility="visible">
<ImageView
android:id="@+id/profileAnimeListImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/backgrounds/scenic" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.6"
android:background="@color/bg_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/poppins_bold"
android:text="@string/anime_list"
android:textAllCaps="true"
android:textColor="@color/bg_white"
android:textSize="16sp" />
<View
android:layout_width="64dp"
android:layout_height="2dp"
android:layout_gravity="center"
android:background="?attr/colorPrimary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileMangaList"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_margin="8dp"
android:layout_marginBottom="16dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardCornerRadius="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profileAnimeList"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_max="256dp"
tools:visibility="visible">
<ImageView
android:id="@+id/profileMangaListImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/backgrounds/scenic" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.6"
android:background="@color/bg_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/poppins_bold"
android:text="@string/manga_list"
android:textAllCaps="true"
android:textColor="@color/bg_white"
android:textSize="16sp" />
<View
android:layout_width="64dp"
android:layout_height="2dp"
android:layout_gravity="center"
android:background="?attr/colorPrimary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="24dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Info"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/profileUserInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:layout_marginStart="18dp"
android:layout_marginEnd="18dp"
android:text="info"
android:alpha="0.58"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<nl.joery.animatedbottombar.AnimatedBottomBar
android:id="@+id/typeTab"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_gravity="center_horizontal|bottom"
android:background="?attr/colorSurface"
android:padding="0dp"
app:abb_animationInterpolator="@anim/over_shoot"
app:abb_indicatorAppearance="round"
app:abb_indicatorLocation="top"
app:abb_selectedTabType="text"
app:abb_textAppearance="@style/NavBarText"
app:itemActiveIndicatorStyle="@style/BottomNavBar"
app:itemIconTint="@color/tab_layout_icon"
app:itemRippleColor="#00000000"
app:itemTextAppearanceActive="@style/NavBarText"
app:itemTextAppearanceInactive="@style/NavBarText"
app:itemTextColor="@color/tab_layout_icon" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="24dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="List"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/profileListContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingStart="24dp"
android:paddingEnd="24dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileAnimeList"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_margin="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardCornerRadius="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/profileMangaList"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_max="256dp"
tools:visibility="visible">
<ImageView
android:id="@+id/profileAnimeListImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/backgrounds/scenic" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.6"
android:background="@color/bg_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/poppins_bold"
android:text="@string/anime_list"
android:textAllCaps="true"
android:textColor="@color/bg_white"
android:textSize="16sp" />
<View
android:layout_width="64dp"
android:layout_height="2dp"
android:layout_gravity="center"
android:background="?attr/colorPrimary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/profileMangaList"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_margin="8dp"
android:layout_marginBottom="16dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardCornerRadius="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profileAnimeList"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_max="256dp"
tools:visibility="visible">
<ImageView
android:id="@+id/profileMangaListImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/backgrounds/scenic" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.6"
android:background="@color/bg_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/poppins_bold"
android:text="@string/manga_list"
android:textAllCaps="true"
android:textColor="@color/bg_white"
android:textSize="16sp" />
<View
android:layout_width="64dp"
android:layout_height="2dp"
android:layout_gravity="center"
android:background="?attr/colorPrimary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="24dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Info"
android:textSize="18sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/profileUserInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:layout_marginStart="18dp"
android:layout_marginEnd="18dp"
android:text="info"
android:alpha="0.58"
android:textSize="12sp" />
</LinearLayout>

View file

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<nl.joery.animatedbottombar.AnimatedBottomBar
android:id="@+id/typeTab"
@ -28,15 +25,6 @@
app:itemTextAppearanceInactive="@style/NavBarText"
app:itemTextColor="@color/tab_layout_icon" />
<TextView
android:id="@+id/selectedTabText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Anime"
android:textSize="18sp"
android:textStyle="bold" />
<com.github.aachartmodel.aainfographics.aachartcreator.AAChartView
android:id="@+id/formatChartView"
android:layout_width="match_parent"
@ -97,4 +85,3 @@
android:layout_width="match_parent"
android:layout_height="250dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>