mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Added landscape layout to stat details
This commit is contained in:
parent
fc81fabd1d
commit
9ae9cfde88
3 changed files with 356 additions and 18 deletions
|
@ -1,7 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.ui.more.stats.details
|
package eu.kanade.tachiyomi.ui.more.stats.details
|
||||||
|
|
||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
@ -14,11 +13,15 @@ import android.widget.TextView
|
||||||
import androidx.annotation.PluralsRes
|
import androidx.annotation.PluralsRes
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.util.Pair
|
import androidx.core.util.Pair
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.isInvisible
|
import androidx.core.view.isInvisible
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.core.view.updatePaddingRelative
|
||||||
import com.github.mikephil.charting.components.MarkerView
|
import com.github.mikephil.charting.components.MarkerView
|
||||||
import com.github.mikephil.charting.components.XAxis
|
import com.github.mikephil.charting.components.XAxis
|
||||||
import com.github.mikephil.charting.data.BarData
|
import com.github.mikephil.charting.data.BarData
|
||||||
|
@ -57,6 +60,7 @@ import eu.kanade.tachiyomi.util.system.withIOContext
|
||||||
import eu.kanade.tachiyomi.util.system.withUIContext
|
import eu.kanade.tachiyomi.util.system.withUIContext
|
||||||
import eu.kanade.tachiyomi.util.view.backgroundColor
|
import eu.kanade.tachiyomi.util.view.backgroundColor
|
||||||
import eu.kanade.tachiyomi.util.view.compatToolTipText
|
import eu.kanade.tachiyomi.util.view.compatToolTipText
|
||||||
|
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsetsCompat
|
||||||
import eu.kanade.tachiyomi.util.view.isControllerVisible
|
import eu.kanade.tachiyomi.util.view.isControllerVisible
|
||||||
import eu.kanade.tachiyomi.util.view.liftAppbarWith
|
import eu.kanade.tachiyomi.util.view.liftAppbarWith
|
||||||
import eu.kanade.tachiyomi.util.view.setOnQueryTextChangeListener
|
import eu.kanade.tachiyomi.util.view.setOnQueryTextChangeListener
|
||||||
|
@ -94,10 +98,12 @@ class StatsDetailsController :
|
||||||
|
|
||||||
override fun createBinding(inflater: LayoutInflater) = StatsDetailsControllerBinding.inflate(inflater)
|
override fun createBinding(inflater: LayoutInflater) = StatsDetailsControllerBinding.inflate(inflater)
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
val scrollView: View
|
||||||
|
get() = binding.statsDetailsScrollView ?: binding.statsRecyclerView
|
||||||
|
|
||||||
override fun onViewCreated(view: View) {
|
override fun onViewCreated(view: View) {
|
||||||
super.onViewCreated(view)
|
super.onViewCreated(view)
|
||||||
liftAppbarWith(binding.statsDetailsScrollView, false, liftOnScroll = { colorToolbar(it) })
|
liftAppbarWith(scrollView, false, liftOnScroll = { colorToolbar(it) })
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
|
|
||||||
if (presenter.selectedStat == null) {
|
if (presenter.selectedStat == null) {
|
||||||
|
@ -107,6 +113,12 @@ class StatsDetailsController :
|
||||||
resetAndSetup()
|
resetAndSetup()
|
||||||
initializeChips()
|
initializeChips()
|
||||||
with(binding) {
|
with(binding) {
|
||||||
|
chartLinearLayout?.doOnApplyWindowInsetsCompat { view, insets, _ ->
|
||||||
|
view.updatePaddingRelative(
|
||||||
|
bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
statsClearButtonContainer.compatToolTipText = activity?.getString(R.string.clear_filters)
|
statsClearButtonContainer.compatToolTipText = activity?.getString(R.string.clear_filters)
|
||||||
statsClearButtonContainer.setOnClickListener {
|
statsClearButtonContainer.setOnClickListener {
|
||||||
resetFilters()
|
resetFilters()
|
||||||
|
@ -274,8 +286,9 @@ class StatsDetailsController :
|
||||||
val scrollingColor = activity.getResourceColor(R.attr.colorPrimaryVariant)
|
val scrollingColor = activity.getResourceColor(R.attr.colorPrimaryVariant)
|
||||||
val topColor = activity.getResourceColor(R.attr.colorSurface)
|
val topColor = activity.getResourceColor(R.attr.colorSurface)
|
||||||
colorAnimator?.cancel()
|
colorAnimator?.cancel()
|
||||||
|
val view = binding.filterConstraintLayout ?: binding.statsHorizontalScroll
|
||||||
val percent = ImageUtil.getPercentOfColor(
|
val percent = ImageUtil.getPercentOfColor(
|
||||||
binding.statsHorizontalScroll.backgroundColor ?: Color.TRANSPARENT,
|
view.backgroundColor ?: Color.TRANSPARENT,
|
||||||
activity.getResourceColor(R.attr.colorSurface),
|
activity.getResourceColor(R.attr.colorSurface),
|
||||||
activity.getResourceColor(R.attr.colorPrimaryVariant),
|
activity.getResourceColor(R.attr.colorPrimaryVariant),
|
||||||
)
|
)
|
||||||
|
@ -285,7 +298,7 @@ class StatsDetailsController :
|
||||||
)
|
)
|
||||||
colorAnimator = cA
|
colorAnimator = cA
|
||||||
colorAnimator?.addUpdateListener { animator ->
|
colorAnimator?.addUpdateListener { animator ->
|
||||||
binding.statsHorizontalScroll.setBackgroundColor(
|
view.setBackgroundColor(
|
||||||
ColorUtils.blendARGB(
|
ColorUtils.blendARGB(
|
||||||
topColor,
|
topColor,
|
||||||
scrollingColor,
|
scrollingColor,
|
||||||
|
@ -477,8 +490,9 @@ class StatsDetailsController :
|
||||||
private fun resetLayout(updateChipsVisibility: Boolean = false, resetReadDuration: Boolean = updateChipsVisibility) {
|
private fun resetLayout(updateChipsVisibility: Boolean = false, resetReadDuration: Boolean = updateChipsVisibility) {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
progress.isVisible = true
|
progress.isVisible = true
|
||||||
statsDetailsScrollView.isInvisible = true
|
scrollView.isInvisible = true
|
||||||
statsDetailsScrollView.scrollTo(0, 0)
|
scrollView.scrollTo(0, 0)
|
||||||
|
chartLinearLayout?.isVisible = false
|
||||||
statsPieChart.isVisible = false
|
statsPieChart.isVisible = false
|
||||||
statsBarChart.isVisible = false
|
statsBarChart.isVisible = false
|
||||||
statsLineChart.isVisible = false
|
statsLineChart.isVisible = false
|
||||||
|
@ -501,6 +515,7 @@ class StatsDetailsController :
|
||||||
binding.noChartData.show(R.drawable.ic_heart_off_24dp, R.string.no_data_for_filters)
|
binding.noChartData.show(R.drawable.ic_heart_off_24dp, R.string.no_data_for_filters)
|
||||||
presenter.currentStats?.removeAll { it.count == 0 }
|
presenter.currentStats?.removeAll { it.count == 0 }
|
||||||
handleNoChartLayout()
|
handleNoChartLayout()
|
||||||
|
chartLinearLayout?.isVisible = false
|
||||||
statsPieChart.isVisible = false
|
statsPieChart.isVisible = false
|
||||||
statsBarChart.isVisible = false
|
statsBarChart.isVisible = false
|
||||||
statsLineChart.isVisible = false
|
statsLineChart.isVisible = false
|
||||||
|
@ -508,7 +523,7 @@ class StatsDetailsController :
|
||||||
binding.noChartData.hide()
|
binding.noChartData.hide()
|
||||||
handleLayout()
|
handleLayout()
|
||||||
}
|
}
|
||||||
statsDetailsScrollView.isVisible = true
|
scrollView.isVisible = true
|
||||||
progress.isVisible = false
|
progress.isVisible = false
|
||||||
totalDurationStatsText.text = adapter?.list?.sumOf { it.readDuration }?.getReadDuration()
|
totalDurationStatsText.text = adapter?.list?.sumOf { it.readDuration }?.getReadDuration()
|
||||||
}
|
}
|
||||||
|
@ -603,6 +618,9 @@ class StatsDetailsController :
|
||||||
* Handle which layout should be displayed according to the selected stat
|
* Handle which layout should be displayed according to the selected stat
|
||||||
*/
|
*/
|
||||||
private fun handleLayout() {
|
private fun handleLayout() {
|
||||||
|
binding.chartLinearLayout?.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||||
|
matchConstraintPercentWidth = 0.5f
|
||||||
|
}
|
||||||
when (presenter.selectedStat) {
|
when (presenter.selectedStat) {
|
||||||
Stats.SERIES_TYPE, Stats.STATUS, Stats.LANGUAGE, Stats.TRACKER, Stats.CATEGORY -> handlePieChart()
|
Stats.SERIES_TYPE, Stats.STATUS, Stats.LANGUAGE, Stats.TRACKER, Stats.CATEGORY -> handlePieChart()
|
||||||
Stats.SCORE -> handleScoreLayout()
|
Stats.SCORE -> handleScoreLayout()
|
||||||
|
@ -725,9 +743,13 @@ class StatsDetailsController :
|
||||||
statsPieChart.clear()
|
statsPieChart.clear()
|
||||||
statsPieChart.invalidate()
|
statsPieChart.invalidate()
|
||||||
|
|
||||||
statsPieChart.visibility = View.VISIBLE
|
chartLinearLayout?.isVisible = true
|
||||||
statsBarChart.visibility = View.GONE
|
statsPieChart.isVisible = true
|
||||||
statsLineChart.visibility = View.GONE
|
statsBarChart.isVisible = false
|
||||||
|
statsLineChart.isVisible = false
|
||||||
|
chartLinearLayout?.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||||
|
matchConstraintPercentWidth = 0.33f
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val pieData = PieData(pieDataSet)
|
val pieData = PieData(pieDataSet)
|
||||||
|
@ -758,9 +780,10 @@ class StatsDetailsController :
|
||||||
statsBarChart.axisLeft.resetAxisMinimum()
|
statsBarChart.axisLeft.resetAxisMinimum()
|
||||||
statsBarChart.axisLeft.resetAxisMaximum()
|
statsBarChart.axisLeft.resetAxisMaximum()
|
||||||
|
|
||||||
statsPieChart.visibility = View.GONE
|
chartLinearLayout?.isVisible = true
|
||||||
statsBarChart.visibility = View.VISIBLE
|
statsPieChart.isVisible = false
|
||||||
statsLineChart.visibility = View.GONE
|
statsBarChart.isVisible = true
|
||||||
|
statsLineChart.isVisible = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val newValueFormatter = object : ValueFormatter() {
|
val newValueFormatter = object : ValueFormatter() {
|
||||||
|
@ -870,9 +893,10 @@ class StatsDetailsController :
|
||||||
statsLineChart.clear()
|
statsLineChart.clear()
|
||||||
statsLineChart.invalidate()
|
statsLineChart.invalidate()
|
||||||
|
|
||||||
statsPieChart.visibility = View.GONE
|
chartLinearLayout?.isVisible = true
|
||||||
statsBarChart.visibility = View.GONE
|
statsPieChart.isVisible = false
|
||||||
statsLineChart.visibility = View.VISIBLE
|
statsBarChart.isVisible = false
|
||||||
|
statsLineChart.isVisible = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val newValueFormatter = object : ValueFormatter() {
|
val newValueFormatter = object : ValueFormatter() {
|
||||||
|
|
313
app/src/main/res/layout-land/stats_details_controller.xml
Normal file
313
app/src/main/res/layout-land/stats_details_controller.xml
Normal file
|
@ -0,0 +1,313 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/stats_details_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="eu.kanade.tachiyomi.ui.more.stats.details.StatsDetailsController">
|
||||||
|
|
||||||
|
<eu.kanade.tachiyomi.widget.EmptyView
|
||||||
|
android:id="@+id/no_chart_data"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/filter_constraint_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/stats_details_scroll_view"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/stats_horizontal_scroll"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/stat_sort"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:fadingEdgeLength="20dp"
|
||||||
|
android:requiresFadingEdge="horizontal"
|
||||||
|
android:scrollbars="none">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/stats_filter_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="20dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/stats_clear_button_container"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:layout_marginEnd="-6dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/stats_clear_button"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:background="@drawable/round_clear_border"
|
||||||
|
android:contentDescription="@string/clear"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:src="@drawable/ic_close_24dp"
|
||||||
|
app:tint="@color/gray_button" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.chip.ChipGroup
|
||||||
|
android:id="@+id/stats_chip_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginVertical="5dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
app:chipSpacingHorizontal="5dp"
|
||||||
|
app:singleLine="true">
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_stat"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/series_type"
|
||||||
|
app:chipIcon="@drawable/ic_query_stats_24dp"
|
||||||
|
app:chipIconEnabled="true" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_category"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/category"
|
||||||
|
app:chipIcon="@drawable/ic_label_outline_24dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_source"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/source"
|
||||||
|
app:closeIcon="@drawable/ic_arrow_drop_down_24dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_status"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/status"
|
||||||
|
app:chipIcon="@drawable/ic_progress_clock_24dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_series_type"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/series_type"
|
||||||
|
app:chipIcon="@drawable/ic_style_24dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip_language"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/language"
|
||||||
|
app:chipIcon="@drawable/ic_translate_24dp" />
|
||||||
|
</com.google.android.material.chip.ChipGroup>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/stat_sort"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/stats_horizontal_scroll"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:background="@drawable/square_ripple"
|
||||||
|
android:clickable="true"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:alpha=".8"
|
||||||
|
app:drawableTint="?android:textColorPrimary"
|
||||||
|
android:ellipsize="start"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center|end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_gravity="center|end"
|
||||||
|
android:textAlignment="textEnd"
|
||||||
|
style="?textAppearanceBodyMedium"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
tools:text="Title Count"
|
||||||
|
app:drawableEndCompat="@drawable/ic_sort_24dp" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/chart_linear_layout"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/filter_constraint_layout"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/stats_recycler_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintVertical_bias="0.0"
|
||||||
|
app:layout_constraintHeight_max="700dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/stats_date_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/stats_date_start_arrow"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:contentDescription="@string/mean_score"
|
||||||
|
android:src="@drawable/ic_arrow_start_24dp"
|
||||||
|
app:tint="?attr/colorOnBackground" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/stats_date_text"
|
||||||
|
style="?textAppearanceLabelLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_toStartOf="@id/stats_date_end_arrow"
|
||||||
|
android:layout_toEndOf="@id/stats_date_start_arrow"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="August 6" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/stats_date_end_arrow"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:contentDescription="@string/mean_score"
|
||||||
|
android:src="@drawable/ic_arrow_end_24dp"
|
||||||
|
app:tint="?attr/colorOnBackground" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/total_duration_stats_text"
|
||||||
|
style="?textAppearanceLabelLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="15h27"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/stats_chart_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginStart="@dimen/marginNormal"
|
||||||
|
android:layout_marginTop="@dimen/marginNormal"
|
||||||
|
android:layout_marginEnd="@dimen/marginNormal"
|
||||||
|
android:maxWidth="600dp">
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.PieChart
|
||||||
|
android:id="@+id/stats_pie_chart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="@fraction/chartRatio"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.BarChart
|
||||||
|
android:id="@+id/stats_bar_chart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="@fraction/chartRatio"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
|
android:id="@+id/stats_line_chart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="@fraction/chartRatio"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/stats_recycler_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/chart_linear_layout"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/filter_constraint_layout"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progress"
|
||||||
|
android:layout_width="75dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:elevation="30dp" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -37,7 +37,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingStart="6dp"
|
android:paddingStart="0dp"
|
||||||
android:paddingEnd="20dp">
|
android:paddingEnd="20dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
|
android:layout_marginEnd="-6dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true">
|
android:focusable="true">
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue