mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-21 19:14:45 +01:00
Probably fix list divider color (#1270)
Co-authored-by: Rafał Borcz <RafalBO99@outlook.com>
This commit is contained in:
parent
2a7f846d3f
commit
b2efe0d981
@ -2,7 +2,6 @@ package io.github.wulkanowy.ui.widgets
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Canvas
|
import android.graphics.Canvas
|
||||||
import android.view.View
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
|
||||||
@ -12,13 +11,13 @@ class DividerItemDecoration(context: Context) : DividerItemDecoration(context, V
|
|||||||
canvas.save()
|
canvas.save()
|
||||||
val dividerLeft = parent.paddingLeft
|
val dividerLeft = parent.paddingLeft
|
||||||
val dividerRight = parent.width - parent.paddingRight
|
val dividerRight = parent.width - parent.paddingRight
|
||||||
val childCount = parent.childCount
|
|
||||||
|
|
||||||
for (i in 0..childCount - 2) {
|
for (i in 0..parent.childCount - 2) {
|
||||||
val child: View = parent.getChildAt(i)
|
val child = parent.getChildAt(i)
|
||||||
val params = child.layoutParams as RecyclerView.LayoutParams
|
val params = child.layoutParams as RecyclerView.LayoutParams
|
||||||
val dividerTop: Int = child.bottom + params.bottomMargin
|
val dividerTop = child.bottom + params.bottomMargin
|
||||||
val dividerBottom = dividerTop + drawable!!.intrinsicHeight
|
val dividerBottom = dividerTop + drawable!!.intrinsicHeight
|
||||||
|
|
||||||
drawable?.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom)
|
drawable?.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom)
|
||||||
drawable?.draw(canvas)
|
drawable?.draw(canvas)
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<gradient
|
|
||||||
android:angle="270"
|
|
||||||
android:centerColor="@android:color/transparent"
|
|
||||||
android:centerX="0.01"
|
|
||||||
android:startColor="@color/colorDividerInverse" />
|
|
||||||
</shape>
|
|
@ -1,9 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<gradient
|
<solid android:color="?colorDivider" />
|
||||||
android:angle="270"
|
|
||||||
android:centerColor="@android:color/transparent"
|
|
||||||
android:centerX="0.01"
|
|
||||||
android:startColor="@color/colorDivider" />
|
|
||||||
</shape>
|
</shape>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
android:paddingTop="24dp"
|
android:paddingTop="24dp"
|
||||||
android:text="@string/all_details"
|
android:text="@string/all_details"
|
||||||
android:textSize="21sp"
|
android:textSize="21sp"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/errorDialogMessage"
|
android:id="@+id/errorDialogMessage"
|
||||||
@ -58,10 +58,14 @@
|
|||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@drawable/ic_all_divider" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:minHeight="52dp"
|
android:minHeight="52dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -71,6 +75,7 @@
|
|||||||
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
@ -79,7 +84,6 @@
|
|||||||
android:insetRight="0dp"
|
android:insetRight="0dp"
|
||||||
android:insetBottom="0dp"
|
android:insetBottom="0dp"
|
||||||
android:minWidth="88dp"
|
android:minWidth="88dp"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:text="@string/about_feedback" />
|
android:text="@string/about_feedback" />
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
@ -92,6 +96,7 @@
|
|||||||
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
@ -100,7 +105,6 @@
|
|||||||
android:insetRight="0dp"
|
android:insetRight="0dp"
|
||||||
android:insetBottom="0dp"
|
android:insetBottom="0dp"
|
||||||
android:minWidth="88dp"
|
android:minWidth="88dp"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:text="@android:string/cancel" />
|
android:text="@android:string/cancel" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
@ -108,6 +112,7 @@
|
|||||||
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
@ -116,7 +121,6 @@
|
|||||||
android:insetRight="0dp"
|
android:insetRight="0dp"
|
||||||
android:insetBottom="0dp"
|
android:insetBottom="0dp"
|
||||||
android:minWidth="88dp"
|
android:minWidth="88dp"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:text="@android:string/copy" />
|
android:text="@android:string/copy" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -15,10 +15,14 @@
|
|||||||
tools:itemCount="1"
|
tools:itemCount="1"
|
||||||
tools:listitem="@layout/item_homework_dialog_details" />
|
tools:listitem="@layout/item_homework_dialog_details" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:minHeight="52dp"
|
android:minHeight="52dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -62,10 +61,14 @@
|
|||||||
tools:text="50" />
|
tools:text="50" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -90,10 +93,14 @@
|
|||||||
tools:text="0" />
|
tools:text="0" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -118,10 +125,14 @@
|
|||||||
tools:text="25" />
|
tools:text="25" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -146,10 +157,14 @@
|
|||||||
tools:text="0" />
|
tools:text="0" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -174,10 +189,14 @@
|
|||||||
tools:text="6" />
|
tools:text="6" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -202,10 +221,14 @@
|
|||||||
tools:text="0" />
|
tools:text="0" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -229,4 +252,9 @@
|
|||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:text="0" />
|
tools:text="0" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
android:id="@+id/gradeSummaryItemPointsContainer"
|
android:id="@+id/gradeSummaryItemPointsContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -63,10 +62,14 @@
|
|||||||
tools:text="123/150" />
|
tools:text="123/150" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -91,10 +94,14 @@
|
|||||||
tools:text="5" />
|
tools:text="5" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
|
||||||
android:minHeight="35dp"
|
android:minHeight="35dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -118,4 +125,9 @@
|
|||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:text="5" />
|
tools:text="5" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/ic_all_divider"
|
||||||
|
android:layout_height="1dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user