What: What is custom UI?
To put it bluntly, there are multiple View containers, which encapsulate the logic and control of these views and control the containers externally by passing parameters and callbacks, in order to achieve the high cohesion of views in the container and the low coupling between the container and the external. We will not go into the so-called special effects here. What we want to talk about is from the functional point of view.
Why: Why do I need to write a custom UI? What problems does it solve?
It's easy. Don't you feel uncomfortable if you don't write these UIS together? In the future, it will be difficult to change the demand, so we need to extract them so that a container can accept them and define some methods for the outer layer to call. From the design point of view, programmers not only need to meet their needs, but also work hard for the loosely coupled design between interaction objects. This is called a programmer. It seems that I haven't figured out why I want to write a custom UI. Okay, start your brain, fragment, or even activity. What are they essentially? Isn't it a big container? It's not just a custom UI.
How: How to Write a custom UI? What do you need to pay attention?
How to write? If I say I want to watch a video, is it a beat? Well, this involves too many things and it is too difficult to express them in words.
To put it simply, follow these principles:
1. The granularity should be well adjusted, that is, you should extract the View into a container. When analyzing requirements, you need to know which Views are independent and can be encapsulated.
2. Although the container controls all sub-views, the container is controlled by the outer layer, so which methods should be exposed by the container and how to correctly callback the response event to the outer layer. Do not frequently reference each other and cause code confusion.
3. follow MVC and try to separate the View and Model. This means that your custom UI is actually bound to a specific Model (Javabean, Descriptor, in the future, there will be no way to reuse it.
4. Reserved interfaces for future extension, that is, writing a few more lines of code.
Two custom UIS will be introduced in this course, and other custom UIS will be provided later based on the feedback from students.
The first custom UI is RowView, GroupView, and ContainerView. Implement dynamic configuration to generate the UI effect as required.
P.s. RowView is the View of each Item. GroupView is a Group that contains multiple sub-items. ContainerView is a container that encapsulates multiple sub-groups.
The second custom UI: chat emoticons (encapsulate the components used by all emoticons to implement emoticons selection, emoticons grouping, and emoticons downloading and a series of emoticons related UIS)
This series is tailored for intermediate Android Developers. It is an essential tool for promotion and salary increase. It is different from the beginner videos on the market that only teach you to call APIs. This course is in-depth and extensive. To ensure that you can use it, you can add a technical QQ group: or QQ :. You can also visit my website www.stay4it.com to learn more. For more information, see the public platform:
Course address: http://www.chuanke.com/1462121-99650.html