|
|
@ -3,7 +3,6 @@ package io.legado.app.ui.widget |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import android.util.AttributeSet |
|
|
|
import android.util.AttributeSet |
|
|
|
import android.widget.LinearLayout |
|
|
|
import android.widget.LinearLayout |
|
|
|
import androidx.core.view.setPadding |
|
|
|
|
|
|
|
import io.legado.app.ui.widget.text.AccentBgTextView |
|
|
|
import io.legado.app.ui.widget.text.AccentBgTextView |
|
|
|
import io.legado.app.utils.dp |
|
|
|
import io.legado.app.utils.dp |
|
|
|
|
|
|
|
|
|
|
@ -25,10 +24,17 @@ class LabelsBar(context: Context, attrs: AttributeSet?) : LinearLayout(context, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun clear() { |
|
|
|
|
|
|
|
removeAllViews() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun addLabel(label: String) { |
|
|
|
fun addLabel(label: String) { |
|
|
|
addView(AccentBgTextView(context, null).apply { |
|
|
|
addView(AccentBgTextView(context, null).apply { |
|
|
|
setPadding(2.dp) |
|
|
|
setPadding(3.dp, 0, 3.dp, 0) |
|
|
|
setRadios(2) |
|
|
|
setRadios(2) |
|
|
|
|
|
|
|
val lp = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) |
|
|
|
|
|
|
|
lp.setMargins(0, 0, 2.dp, 0) |
|
|
|
|
|
|
|
layoutParams = lp |
|
|
|
text = label |
|
|
|
text = label |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|