mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-23 01:00:04 +02:00
Merge branch 'develop' of https://codeberg.org/tom79/Fedilab into develop
This commit is contained in:
commit
0d93afac51
2 changed files with 18 additions and 18 deletions
|
@ -3,6 +3,7 @@ package app.fedilab.android.helper
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.graphics.Canvas
|
import android.graphics.Canvas
|
||||||
|
import android.graphics.Color
|
||||||
import android.graphics.DashPathEffect
|
import android.graphics.DashPathEffect
|
||||||
import android.graphics.Paint
|
import android.graphics.Paint
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
|
@ -46,20 +47,19 @@ class RecyclerViewThreadLines(context: Context, private val lineInfoList: List<L
|
||||||
val lineInfo = lineInfoList[position]
|
val lineInfo = lineInfoList[position]
|
||||||
val level = lineInfo.level
|
val level = lineInfo.level
|
||||||
|
|
||||||
for (j in 1..level) {
|
for (j in 0..level) {
|
||||||
val lineMargin = margin * j + 3.dpToPx
|
val lineMargin = margin * j.coerceAtLeast(1) + 3.dpToPx
|
||||||
val lineStart = if (parent.layoutDirection == View.LAYOUT_DIRECTION_LTR) lineMargin else c.width - lineMargin
|
val lineStart = if (parent.layoutDirection == View.LAYOUT_DIRECTION_LTR) lineMargin else c.width - lineMargin
|
||||||
var lineTop: Float = (view.top - baseMargin).toFloat()
|
var lineTop: Float = (view.top - baseMargin).toFloat()
|
||||||
if (j == 0) lineTop += view.height / 2
|
|
||||||
val paint = Paint(commonPaint)
|
val paint = Paint(commonPaint)
|
||||||
paint.color = lineColors[j - 1]
|
paint.color = if (j > 0) lineColors[j - 1] else Color.GRAY
|
||||||
|
|
||||||
// draw lines for below statuses
|
// draw lines for below statuses
|
||||||
if (j != level && j >= lineInfo.fullLinesStart && j <= lineInfo.fullLinesEnd)
|
if (j != level && j >= lineInfo.fullLinesStart && j <= lineInfo.fullLinesEnd)
|
||||||
c.drawLine(lineStart, lineTop, lineStart, view.bottom.toFloat(), paint)
|
c.drawLine(lineStart, lineTop, lineStart, view.bottom.toFloat(), paint)
|
||||||
|
|
||||||
// draw vertical line for current statuses
|
// draw vertical line for current statuses
|
||||||
if (j == level) {
|
if (j == level && i != 0) {
|
||||||
// top the line starts at the middle of the above status
|
// top the line starts at the middle of the above status
|
||||||
if (i > 0) lineTop -= parent.getChildAt(i - 1).height / 2 - 1 // '- 1' is to prevent overlapping with above horizontal line
|
if (i > 0) lineTop -= parent.getChildAt(i - 1).height / 2 - 1 // '- 1' is to prevent overlapping with above horizontal line
|
||||||
|
|
||||||
|
|
|
@ -427,19 +427,6 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
|
||||||
android:id="@+id/action_button_favorite"
|
|
||||||
android:layout_width="28dp"
|
|
||||||
android:layout_height="28dp"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
app:sparkbutton_activeImage="@drawable/ic_baseline_star_24"
|
|
||||||
app:sparkbutton_animationSpeed="1.5"
|
|
||||||
app:sparkbutton_iconSize="24dp"
|
|
||||||
app:sparkbutton_inActiveImage="@drawable/ic_star_outline"
|
|
||||||
app:sparkbutton_primaryColor="@color/marked_icon"
|
|
||||||
app:sparkbutton_secondaryColor="@color/marked_icon" />
|
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<com.varunest.sparkbutton.SparkButton
|
||||||
android:id="@+id/action_button_boost"
|
android:id="@+id/action_button_boost"
|
||||||
android:layout_width="28dp"
|
android:layout_width="28dp"
|
||||||
|
@ -453,6 +440,19 @@
|
||||||
app:sparkbutton_primaryColor="@color/boost_icon"
|
app:sparkbutton_primaryColor="@color/boost_icon"
|
||||||
app:sparkbutton_secondaryColor="@color/boost_icon" />
|
app:sparkbutton_secondaryColor="@color/boost_icon" />
|
||||||
|
|
||||||
|
<com.varunest.sparkbutton.SparkButton
|
||||||
|
android:id="@+id/action_button_favorite"
|
||||||
|
android:layout_width="28dp"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
app:sparkbutton_activeImage="@drawable/ic_baseline_star_24"
|
||||||
|
app:sparkbutton_animationSpeed="1.5"
|
||||||
|
app:sparkbutton_iconSize="24dp"
|
||||||
|
app:sparkbutton_inActiveImage="@drawable/ic_star_outline"
|
||||||
|
app:sparkbutton_primaryColor="@color/marked_icon"
|
||||||
|
app:sparkbutton_secondaryColor="@color/marked_icon" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<com.varunest.sparkbutton.SparkButton
|
||||||
android:id="@+id/action_button_bookmark"
|
android:id="@+id/action_button_bookmark"
|
||||||
android:layout_width="28dp"
|
android:layout_width="28dp"
|
||||||
|
|
Loading…
Reference in a new issue