It is interesting how Android view’s touch events are dispatched. Let’s explore it.
Firstly, write a custom view and override its onTouchEvent() method.
class TouchView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { override fun onTouchEvent(event: MotionEvent): Boolean { Log.d("TAG", "TouchView - onTouchEvent - ${event.action}") return super.onTouchEvent(event) } } Then, in MainActivity, on the view, call setOnTouchListener() and setOnClickListener().
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
At the beginning of Chapter 4, we will implement an evaluator.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Do you have the following questions?
I present you the best music to listen to when programming.
Katsumi Horii Project
To name a few.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Recently, I started to write down study notes in one org file.