android-components / mozilla.components.browser.toolbar.edit / EditToolbar

# EditToolbar

`class EditToolbar : ViewGroup` (source)

Sub-component of the browser toolbar responsible for allowing the user to edit the URL.

Structure: +---------------------------------+---------+------+ | url | actions | exit | +---------------------------------+---------+------+

- url: Editable URL of the currently displayed website
- actions: Optional action icons injected by other components (e.g. barcode scanner)
- exit: Button that switches back to display mode.

### Constructors

<init> | `EditToolbar(context: Context, toolbar: BrowserToolbar)` Sub-component of the browser toolbar responsible for allowing the user to edit the URL.

### Functions

focus | `fun focus(): Unit` Focus the URL editing component and show the virtual keyboard if needed.
onLayout | `fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit`
onMeasure | `fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit`
updateUrl | `fun updateUrl(url: String): Unit` Updates the URL. This should only be called if the toolbar is not in editing mode. Otherwise this might override the URL the user is currently typing.

### Extension Properties

isLTR | `val View.isLTR: Boolean` Is the horizontal layout direction of this view from Left to Right?
isRTL | `val View.isRTL: Boolean` Is the horizontal layout direction of this view from Right to Left?

### Extension Functions

forEach | `fun ViewGroup.forEach(action: (View) -> Unit): Unit` Performs the given action on each View in this ViewGroup.
hideKeyboard | `fun View.hideKeyboard(): Unit` Hides the soft input window.
isGone | `fun View.isGone(): Boolean` Returns true if this view's visibility is set to View.GONE.
isInvisible | `fun View.isInvisible(): Boolean` Returns true if this view's visibility is set to View.INVISIBLE.
isVisible | `fun View.isVisible(): Boolean` Returns true if this view's visibility is set to View.VISIBLE.
setPadding | `fun View.setPadding(padding: Padding): Unit` Set a padding using Padding object.
showKeyboard | `fun View.showKeyboard(flags: Int = InputMethodManager.SHOW_IMPLICIT): Unit` Tries to focus this view and show the soft input window for it.