2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-02 03:40:16 +00:00

For #2205: Updates collection title constraints

This commit is contained in:
Sawyer Blatz 2019-05-21 14:31:45 -07:00 committed by Jeff Boek
parent 9509ce1b12
commit 220a843534
3 changed files with 31 additions and 33 deletions

View File

@ -82,13 +82,7 @@ class CollectionViewHolder(
}
private fun updateCollectionUI() {
val title = if (collection.title.length > maxTitleLength) {
collection.title.substring(0, maxTitleLength) + "..."
} else {
collection.title
}
view.collection_title.text = title
view.collection_title.text = collection.title
var hostNameList = listOf<String>()
@ -116,12 +110,22 @@ class CollectionViewHolder(
collection_title.setPadding(0, 0, 0, EXPANDED_PADDING)
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_top_corners)
view.collection_description.visibility = View.GONE
view.expand_button.setImageDrawable(ContextCompat.getDrawable(view.context, R.drawable.ic_chevron_up))
view.collection_title.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(view.context, R.drawable.ic_chevron_up),
null)
} else {
(view.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = COLLAPSED_MARGIN
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_all_corners)
view.collection_description.visibility = View.VISIBLE
view.expand_button.setImageDrawable(ContextCompat.getDrawable(view.context, R.drawable.ic_chevron_down))
view.collection_title.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(view.context, R.drawable.ic_chevron_down),
null)
}
view.collection_icon.setColorFilter(

View File

@ -5,7 +5,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_collection"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/item_collection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
@ -32,28 +32,21 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/collection_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:layout_marginStart="12dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header16TextStyle"
app:layout_constraintStart_toEndOf="@id/collection_icon"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/expand_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="26dp"
android:layout_marginEnd="8dp"
android:src="@drawable/ic_chevron_down"
app:layout_constraintStart_toEndOf="@id/collection_title"
app:layout_constraintTop_toTopOf="parent"/>
android:id="@+id/collection_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:layout_marginStart="12dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/Header16TextStyle"
android:drawableEnd="@drawable/ic_chevron_down"
android:drawablePadding="8dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toEndOf="@id/collection_icon"
app:layout_constraintEnd_toStartOf="@id/collection_share_button"
app:layout_constraintTop_toTopOf="parent" android:text="The quick brown fox jumps over the lazy dog"/>
<TextView
android:id="@+id/collection_description"
@ -74,6 +67,7 @@
android:id="@+id/collection_share_button"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tab_menu"
android:src="@drawable/ic_hollow_share"

View File

@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="14dp"
android:layout_marginEnd="48dp"
android:layout_marginEnd="74dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"