<lambda>null1*c10881ebSWill Schurman// Copyright 2015-present 650 Industries. All rights reserved. 2*c10881ebSWill Schurman package host.exp.exponent.views 3*c10881ebSWill Schurman 4*c10881ebSWill Schurman import android.content.Context 5*c10881ebSWill Schurman import android.graphics.Color 6*c10881ebSWill Schurman import android.util.AttributeSet 7*c10881ebSWill Schurman import android.view.MotionEvent 8*c10881ebSWill Schurman import androidx.appcompat.widget.AppCompatImageButton 9*c10881ebSWill Schurman 10*c10881ebSWill Schurman class ExponentImageButton : AppCompatImageButton { 11*c10881ebSWill Schurman constructor(context: Context) : super(context) { 12*c10881ebSWill Schurman init() 13*c10881ebSWill Schurman } 14*c10881ebSWill Schurman 15*c10881ebSWill Schurman constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { 16*c10881ebSWill Schurman init() 17*c10881ebSWill Schurman } 18*c10881ebSWill Schurman 19*c10881ebSWill Schurman constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( 20*c10881ebSWill Schurman context, 21*c10881ebSWill Schurman attrs, 22*c10881ebSWill Schurman defStyleAttr 23*c10881ebSWill Schurman ) { 24*c10881ebSWill Schurman init() 25*c10881ebSWill Schurman } 26*c10881ebSWill Schurman 27*c10881ebSWill Schurman private fun init() { 28*c10881ebSWill Schurman setOnTouchListener { v, event -> 29*c10881ebSWill Schurman if (event.action == MotionEvent.ACTION_UP) { 30*c10881ebSWill Schurman setColorFilter(Color.TRANSPARENT) 31*c10881ebSWill Schurman } else if (event.action == MotionEvent.ACTION_DOWN) { 32*c10881ebSWill Schurman setColorFilter(Color.GRAY) 33*c10881ebSWill Schurman } 34*c10881ebSWill Schurman false 35*c10881ebSWill Schurman } 36*c10881ebSWill Schurman } 37*c10881ebSWill Schurman } 38