Fluent layout - Row, Android framework video

A multi child node control, which is very common in fluent, arranges children in a row. It is estimated that the Flex layout in the Web is used for reference, so many properties and performance are similar to it. Note, however, that it does not have a scrolling attribute. If it exceeds one line, an overflow prompt will be displayed under debug. ...

Posted by Ruud Hermans on Sat, 20 Nov 2021 04:21:52 -0800

Detailed explanation of single case mode

summary Singleton mode: in the whole system, only one instance object of a class can be obtained and used Key points: Private constructorCreate object inside classProvide static methods for obtaining instances externally Hungry Han style Common way Hungry Chinese style: when the class is loaded, create the object directly, which is thread ...

Posted by mzfp2 on Fri, 19 Nov 2021 23:37:05 -0800

Fluent core Future/stream/bloc

Future (asynchronous operation)   Future has three statuses: unfinished, completed with value and completed with exception. Using future can simplify event tasks. In Dart, future objects can be used to represent the results of asynchronous operations. The return type of future is future < T > There are three ways to deal with the ...

Posted by tomm098 on Fri, 19 Nov 2021 20:21:26 -0800

Simple factory model of three factory models

1. Simple factory mode   1.1 meaning The simple factory pattern is also called the static method pattern (because the factory class defines a static method)In real life, factories are responsible for producing products; Similarly, in the design pattern, the simple factory pattern can be understood as a class responsible for production obj ...

Posted by Unholy Prayer on Fri, 19 Nov 2021 19:58:55 -0800

Handwritten a search flow layout of Taobao and jd.com

Some nagging As long as all apps on the market have search function, they are almost inseparable from streaming layout, such as Taobao, JD, xiaohongshu and so on. During the summer vacation, I wrote an app similar to Taobao, which uses this streaming layout. This is the actual effect of your app Here are the test results Inherit ViewG ...

Posted by socadmin on Fri, 19 Nov 2021 17:28:14 -0800

Design mode: observer mode

reference resources Design mode (V) observer mode Observer mode Type: behavioral A one to many dependency is defined, which allows multiple observer objects to listen to a topic object at the same time. When the state of the subject object changes, it will notify all observer objects so that they can update themselves automatically. UML ...

Posted by Mr_Mako on Fri, 19 Nov 2021 14:31:42 -0800

Android EditText limits five implementations of input characters, from entry to depth

@Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { String editable = evPwd.getText().toString(); String regEx = "[^a-zA-Z0-9]"; //Only letters or numbers can be entered Pattern p = Pattern.co ...

Posted by artweb on Fri, 19 Nov 2021 14:11:25 -0800

Detailed explanation of sharing element mode of design mode

Detailed explanation of sharing element mode of design mode 1, What is the meta model Flyweight Pattern, also known as lightweight pattern, is an implementation of object pool. Similar to thread pool, thread pool can avoid performance consumption by constantly creating and destroying objects. The number of objects is reduced to improve ...

Posted by Sphynx on Fri, 19 Nov 2021 11:29:00 -0800

Jetpack Compose Banner out of the box

Jetpack Compose does not have an official Banner control at present, so it can only be completed by writing and searching some materials. Thank you very much for sharing these contents before. design sketch accompanist group Library accompanist The group library aims to provide supplementary functions for jetpack composition. There are ma ...

Posted by tinyashcities on Fri, 19 Nov 2021 02:35:35 -0800

Design pattern - structural pattern

Describes how to combine classes or objects to form a larger structure Structural patterns can be divided into class structural patterns and object structural patterns: Class structured pattern: generally, there are only inheritance and implementation relationships. Object structured patterns: according to the "composite Reuse Princi ...

Posted by ditusade on Wed, 17 Nov 2021 00:09:10 -0800