belongs to Maven artifact androidx.car:car:1.0.0-alpha1

ClickThroughToolbar

public class ClickThroughToolbar
extends Toolbar

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ androidx.appcompat.widget.Toolbar
         ↳ androidx.car.widget.ClickThroughToolbar


A toolbar that optionally supports allowing clicks on it to pass through to any underlying views.

By default, the Toolbar eats all touches on it. This view will override onTouchEvent(MotionEvent) and return false if configured to allow pass through.

Summary

Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

ClickThroughToolbar(Context context)
ClickThroughToolbar(Context context, AttributeSet attrs)
ClickThroughToolbar(Context context, AttributeSet attrs, int defStyleAttrs)

Public methods

boolean onTouchEvent(MotionEvent ev)
void setClickPassThrough(boolean allowPassThrough)

Whether or not clicks on this toolbar will pass through to any views that are underneath it.

Inherited methods

Public constructors

ClickThroughToolbar

ClickThroughToolbar (Context context)

Parameters
context Context

ClickThroughToolbar

ClickThroughToolbar (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ClickThroughToolbar

ClickThroughToolbar (Context context, 
                AttributeSet attrs, 
                int defStyleAttrs)

Parameters
context Context

attrs AttributeSet

defStyleAttrs int

Public methods

onTouchEvent

boolean onTouchEvent (MotionEvent ev)

Parameters
ev MotionEvent

Returns
boolean

setClickPassThrough

void setClickPassThrough (boolean allowPassThrough)

Whether or not clicks on this toolbar will pass through to any views that are underneath it. By default, this value is false.

Parameters
allowPassThrough boolean: true if clicks will pass through to an underlying view; false otherwise.