[components] Add longClickListener documentation, fix style problems

move TwoStateButton background to match argument order
This commit is contained in:
Steven Knipe
2021-07-31 06:04:39 -07:00
committed by mergify[bot]
parent 7fe1b10694
commit ea9cb18430
3 changed files with 6 additions and 3 deletions

View File

@@ -384,6 +384,7 @@ class BrowserToolbar @JvmOverloads constructor(
* @param background A custom (stateful) background drawable resource to be used. * @param background A custom (stateful) background drawable resource to be used.
* @param padding a custom [Padding] for this Button. * @param padding a custom [Padding] for this Button.
* @param iconTintColorResource Optional ID of color resource to tint the icon. * @param iconTintColorResource Optional ID of color resource to tint the icon.
* @param longClickListener Callback that will be invoked whenever the button is long-pressed.
* @param listener Callback that will be invoked whenever the button is pressed * @param listener Callback that will be invoked whenever the button is pressed
*/ */
@Suppress("LongParameterList") @Suppress("LongParameterList")
@@ -460,6 +461,7 @@ class BrowserToolbar @JvmOverloads constructor(
* @param longClickListener Callback that will be invoked whenever the button is long-pressed. * @param longClickListener Callback that will be invoked whenever the button is long-pressed.
* @param listener Callback that will be invoked whenever the button is pressed. * @param listener Callback that will be invoked whenever the button is pressed.
*/ */
@Suppress("LongParameterList")
open class TwoStateButton( open class TwoStateButton(
val primaryImage: Drawable, val primaryImage: Drawable,
val primaryContentDescription: String, val primaryContentDescription: String,
@@ -475,9 +477,9 @@ class BrowserToolbar @JvmOverloads constructor(
) : BrowserToolbar.Button( ) : BrowserToolbar.Button(
primaryImage, primaryImage,
primaryContentDescription, primaryContentDescription,
background = background,
longClickListener = longClickListener, longClickListener = longClickListener,
listener = listener, listener = listener,
background = background
) { ) {
var enabled: Boolean = false var enabled: Boolean = false
private set private set

View File

@@ -232,6 +232,7 @@ interface Toolbar {
* @param visible Lambda that returns true or false to indicate whether this button should be shown. * @param visible Lambda that returns true or false to indicate whether this button should be shown.
* @param padding A optional custom padding. * @param padding A optional custom padding.
* @param iconTintColorResource Optional ID of color resource to tint the icon. * @param iconTintColorResource Optional ID of color resource to tint the icon.
* @param longClickListener Callback that will be invoked whenever the button is long-pressed.
* @param listener Callback that will be invoked whenever the button is pressed * @param listener Callback that will be invoked whenever the button is pressed
*/ */
@Suppress("LongParameterList") @Suppress("LongParameterList")