mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Stat details: reorder stat filters + cleanup
Only show category filter if use has categories Also add a style for the chips to reduce code
This commit is contained in:
parent
e6c36a8144
commit
73e517b9b8
3 changed files with 53 additions and 86 deletions
|
@ -508,7 +508,8 @@ class StatsDetailsController :
|
||||||
chipStatus.isVisible = presenter.selectedStat !in listOf(Stats.STATUS, Stats.READ_DURATION)
|
chipStatus.isVisible = presenter.selectedStat !in listOf(Stats.STATUS, Stats.READ_DURATION)
|
||||||
chipLanguage.isVisible = presenter.selectedStat !in listOf(Stats.LANGUAGE, Stats.READ_DURATION) &&
|
chipLanguage.isVisible = presenter.selectedStat !in listOf(Stats.LANGUAGE, Stats.READ_DURATION) &&
|
||||||
(presenter.selectedStat == Stats.SOURCE || presenter.selectedSource.isEmpty())
|
(presenter.selectedStat == Stats.SOURCE || presenter.selectedSource.isEmpty())
|
||||||
chipCategory.isVisible = presenter.selectedStat !in listOf(Stats.CATEGORY, Stats.READ_DURATION)
|
chipCategory.isVisible = presenter.selectedStat !in listOf(Stats.CATEGORY, Stats.READ_DURATION) &&
|
||||||
|
presenter.categoriesStats.size > 1
|
||||||
statSort.isVisible = presenter.selectedStat !in listOf(
|
statSort.isVisible = presenter.selectedStat !in listOf(
|
||||||
Stats.SCORE, Stats.LENGTH, Stats.START_YEAR, Stats.READ_DURATION,
|
Stats.SCORE, Stats.LENGTH, Stats.START_YEAR, Stats.READ_DURATION,
|
||||||
)
|
)
|
||||||
|
|
|
@ -74,101 +74,52 @@
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
android:id="@+id/chip_stat"
|
android:id="@+id/chip_stat"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/series_type"
|
android:text="@string/series_type"
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_query_stats_24dp"
|
app:chipIcon="@drawable/ic_query_stats_24dp"
|
||||||
app:chipIconEnabled="true"
|
app:chipIconEnabled="true" />
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
|
||||||
app:chipStrokeWidth="1dp"
|
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
|
||||||
app:closeIconEnabled="true"
|
|
||||||
app:closeIconTint="?attr/colorOnBackground" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
|
||||||
android:id="@+id/chip_series_type"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/series_type"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_style_24dp"
|
|
||||||
app:chipIconEnabled="false"
|
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
|
||||||
app:chipStrokeWidth="1dp"
|
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
|
||||||
app:closeIconEnabled="true"
|
|
||||||
app:closeIconTint="?attr/colorOnBackground"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
|
||||||
android:id="@+id/chip_source"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/source"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_browse_24dp"
|
|
||||||
app:chipIconEnabled="false"
|
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
|
||||||
app:chipStrokeWidth="1dp"
|
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
|
||||||
app:closeIconEnabled="true"
|
|
||||||
app:closeIconTint="?attr/colorOnBackground" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
|
||||||
android:id="@+id/chip_status"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/status"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_progress_clock_24dp"
|
|
||||||
app:chipIconEnabled="false"
|
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
|
||||||
app:chipStrokeWidth="1dp"
|
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
|
||||||
app:closeIconEnabled="true"
|
|
||||||
app:closeIconTint="?attr/colorOnBackground" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
|
||||||
android:id="@+id/chip_language"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/language"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_translate_24dp"
|
|
||||||
app:chipIconEnabled="false"
|
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
|
||||||
app:chipStrokeWidth="1dp"
|
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
|
||||||
app:closeIconEnabled="true"
|
|
||||||
app:closeIconTint="?attr/colorOnBackground" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
android:id="@+id/chip_category"
|
android:id="@+id/chip_category"
|
||||||
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/category"
|
android:text="@string/category"
|
||||||
android:textColor="?attr/colorOnBackground"
|
app:chipIcon="@drawable/ic_label_outline_24dp" />
|
||||||
app:checkedIconEnabled="false"
|
|
||||||
app:chipIcon="@drawable/ic_label_outline_24dp"
|
<com.google.android.material.chip.Chip
|
||||||
app:chipIconEnabled="false"
|
android:id="@+id/chip_source"
|
||||||
app:chipIconTint="?attr/colorOnBackground"
|
style="@style/Widget.Tachiyomi.Chip.Stat"
|
||||||
app:chipStrokeColor="?attr/colorSecondary"
|
android:layout_width="wrap_content"
|
||||||
app:chipStrokeWidth="1dp"
|
android:layout_height="wrap_content"
|
||||||
app:closeIcon="@drawable/ic_arrow_drop_down_24dp"
|
android:text="@string/source"
|
||||||
app:closeIconEnabled="true"
|
app:closeIcon="@drawable/ic_arrow_drop_down_24dp" />
|
||||||
app:closeIconTint="?attr/colorOnBackground" />
|
|
||||||
|
<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>
|
</com.google.android.material.chip.ChipGroup>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -354,6 +354,21 @@
|
||||||
<item name="android:checkable">false</item>
|
<item name="android:checkable">false</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Widget.Tachiyomi.Chip.Stat" parent="Widget.Material3.Chip.Assist">
|
||||||
|
<item name="android:textColor">?attr/colorOnBackground</item>
|
||||||
|
<item name="android:checkable">false</item>
|
||||||
|
<item name="checkedIconEnabled">false</item>
|
||||||
|
<item name="chipIconVisible">false</item>
|
||||||
|
<item name="chipIconEnabled">false</item>
|
||||||
|
<item name="chipIconTint">?attr/colorOnBackground</item>
|
||||||
|
<item name="chipStrokeColor">?attr/colorSecondary</item>
|
||||||
|
<item name="chipStrokeWidth">1dp</item>
|
||||||
|
<item name="closeIconEnabled">true</item>
|
||||||
|
<item name="closeIconVisible">true</item>
|
||||||
|
<item name="closeIcon">@drawable/ic_arrow_drop_down_24dp</item>
|
||||||
|
<item name="closeIconTint">?attr/colorOnBackground</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Tachiyomi.Chip.AddTag" parent="Widget.Material3.Chip.Suggestion">
|
<style name="Widget.Tachiyomi.Chip.AddTag" parent="Widget.Material3.Chip.Suggestion">
|
||||||
<item name="chipBackgroundColor">@android:color/transparent</item>
|
<item name="chipBackgroundColor">@android:color/transparent</item>
|
||||||
<item name="chipMinHeight">28dp</item>
|
<item name="chipMinHeight">28dp</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue