Kotlin actual combat [III] representation and selection

preface In this chapter, we will learn how to implement representation and selection through enumeration and when in Kotlin. 1, Enumeration representing and selecting 1.1 definition of enumeration Let's take a look at the usage in java: public enum Color { RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET } Usage in kotlin: enum clas ...

Posted by Morbius on Wed, 03 Nov 2021 08:15:09 +0100

Multi touch Android custom controls

preface In the previous blog, we made a picture view that can move with our fingers. It can only support single finger control. If we touch with multiple fingers, it will be all right. We want the effect There are three types of multi touch ① : baton type or preemptive type ② : Collaborative ③ : non-interference type 1, Baton type or ...

Posted by paradigmapc on Thu, 07 Oct 2021 00:05:47 +0200

Jetpack: ViewModel user guide, detailed analysis of implementation principle!

brief introduction In order to better divide the functions, Android provides us with the ViewModel class, which is specially used to store the data required by the application page. ViewModel can be understood as something between View and Model. It acts as a bridge so that the View and data can not only be separated, but also maintain c ...

Posted by nlhowell on Sun, 05 Sep 2021 05:56:24 +0200