This chapter is divided into three parts:
(1) Custom control: The teacher first briefly explained some details, such as why not PX, and to use DP, only because of the screen resolution of different models, with PX will lead to the difference is too large. Then we demonstrate the steps to make a custom control by first adding the corresponding custom view class to the XML file and giving the canvas size, And then OnDraw in. Java, it's worth noting that the coordinates in OnDraw are relative to the canvas (as defined in XML), so it's easy to have a problem by drawing a view with specific values.
(2) Fragment: The 1th is the two methods of setting Fragment. The first is in the. xml file, which is statically set, not interactive, and the second is set in. Java and can be interacted with. The 2nd is Fragment life cycle, and activity is similar, just fragment to more than a few stages, and fragment is dependent on activity, from the log can be seen.
(3) Handler: Use the message delay to send information, Handler processing information, modify TextView, create a timing effect.
Simple learning experience: NetEase Cloud Classroom Android Development Chapter III custom controls