Android Custom View 102 (Part 11)

Touch event dispatching

Guowei Lv

3 minute read

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().

SICP Goodness - Metacircular Evaluator

a literate programming approach

Guowei Lv

2 minute read

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.

SICP Goodness - Metalinguistic Abstraction

Metalinguistic Abstraction

Guowei Lv

1 minute read

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? What programming languages should I learn?

Best Programming Music

Best programming music

Guowei Lv

1 minute read

I present you the best music to listen to when programming. Katsumi Horii Project To name a few.

SICP Goodness - Orgmode + Racket + SICP = 💕

How to setup orgmode to run racket code from SICP

Guowei Lv

1 minute read

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.