For #1843 - Wires up close button
parent
cddb4de79b
commit
f58400660a
|
@ -13,6 +13,7 @@ import io.reactivex.Observer
|
|||
import io.reactivex.Observable
|
||||
import io.reactivex.functions.Consumer
|
||||
import kotlinx.android.synthetic.main.component_collection_creation.view.*
|
||||
import org.mozilla.fenix.ext.increaseTapArea
|
||||
import org.mozilla.fenix.mvi.UIView
|
||||
|
||||
class CollectionCreationUIView(
|
||||
|
@ -38,6 +39,13 @@ class CollectionCreationUIView(
|
|||
actionEmitter.onNext(CollectionCreationAction.SelectAllTapped)
|
||||
}
|
||||
|
||||
view.close_icon.apply {
|
||||
increaseTapArea(increaseButtonByDps)
|
||||
setOnClickListener {
|
||||
actionEmitter.onNext(CollectionCreationAction.Close)
|
||||
}
|
||||
}
|
||||
|
||||
view.tab_list.run {
|
||||
adapter = collectionCreationTabListAdapter
|
||||
layoutManager = LinearLayoutManager(container.context, RecyclerView.VERTICAL, true)
|
||||
|
@ -53,6 +61,11 @@ class CollectionCreationUIView(
|
|||
view.context.getString(R.string.create_collection_save_to_collection_full, it.selectedTabs.size)
|
||||
}
|
||||
|
||||
view.add_tabs_button.contentDescription = buttonText
|
||||
view.add_tabs_button_text.text = buttonText
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val increaseButtonByDps = 16
|
||||
}
|
||||
}
|
|
@ -58,15 +58,18 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@drawable/add_tabs_to_collection_background"
|
||||
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<ImageView
|
||||
<ImageButton
|
||||
android:id="@+id/close_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/mozac_ic_close"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/create_collection_close"
|
||||
android:src="@drawable/mozac_ic_close"
|
||||
android:layout_margin="16dp"
|
||||
android:tint="?neutral"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -75,6 +78,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/add_tabs_button_text"
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
|
@ -90,6 +94,7 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/save_icon"
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
|
|
|
@ -416,4 +416,7 @@
|
|||
<!-- Text to prompt users to select how many tabs they have
|
||||
selected in the "select tabs" stepof the collection creator -->
|
||||
<string name="create_collection_save_to_collection_full">%d tabs selected</string>
|
||||
|
||||
<!-- Content description (not visible, for screen readers etc.): button to close the collection creator -->
|
||||
<string name="create_collection_close">Close</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue