lambda expression - shawn, how to ensure high availability

There is only one abstract method in the interface: Modifier interface Interface name { public abstract Return value type method name(Optional parameter information); // Other non abstract method content } Since the public abstract keywords in the interface can be omitted, the above functional interface can be written in the follow ...

Added by lispwriter on Sat, 04 Sep 2021 02:59:40 +0300

Design Mode - Creator Mode Factory Mode

The 23 design modes we often refer to can be roughly divided into three categories: BuilderStructural patternBehavioral patterns The factory design mode belongs to the creator mode. Builder As the name implies, the focus is on how to create objects, and the feature is to separate the creation and use of objects.Reduce system coupling so tha ...

Added by bulrush on Fri, 03 Sep 2021 22:00:17 +0300

NestScrollView principle analysis, done Android for three years

At present, the classes that have implemented the modified interface include coordinatorlayout, nestedscrollview and swiperefreshlayout. It is usually nested and sliding with NestedScrollingChild. boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) This method is called when Scrolling Child starts sliding When Scrollin ...

Added by mattastic on Fri, 03 Sep 2021 21:36:36 +0300

_ Kotlin_ Series_ 2, Kotlin generic, byte Android Senior Engineer Interview

2. What is the use of generics? 3. How to define and use generics? 1. What is generics? The popular understanding of generics is that many types allow us to program without specifying specific types by using the concept of parameterized types 2. What is the use of generics? Generics is a security mechanism introduced by JDK 1.5 and a techn ...

Added by magic2goodil on Fri, 03 Sep 2021 09:17:54 +0300

Template Method Design Mode Theory and Application

This article is included in github and gitee , with my complete Java series of articles, you can read them for both study and interview (1) What is Template method First learn what a template is. When you specify a tool in a factory, you first design a template, and then make tools of various colors from it.Although the tools may be made in ...

Added by YourNameHere on Fri, 03 Sep 2021 09:12:17 +0300

ScrollView (RecyclerView, etc.) does not look at absolute blood loss

@Override public void requestChildFocus(View child, View focused) { if (!mIsLayoutDirty) { scrollToChild(focused); } else { mChildToScrollTo = focused; } super.requestChildFocus(child, focused); } Because the requestLayout() method was called before addViewInner: @Override public void requestLayout() { mIsLayou ...

Added by Pehape on Fri, 03 Sep 2021 08:51:56 +0300

The new function of Fragment, setMaxLifecycle, has lasted for 30 days

INITIALIZING initial state CREATED created status ACTIVITY_CREATED   fully created but not started STARTED creates and starts, visible and inoperable RESUMED creation is started and operable [picture uploading... (image-1940e7-1557923091355-0)] This article only explains the CREATED, STARTED and RESUMED states. Since the mState ...

Added by NeoGeo on Fri, 03 Sep 2021 04:04:01 +0300

WebView interactive architecture project practice (I) in-depth understanding of JVM

android:layout_width="match_parent" android:layout_height="match_parent"/> ...... </LinearLayout> `````` // MainActivity.java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ...

Added by pyfsapple on Fri, 03 Sep 2021 02:59:55 +0300

Kotlin: high order function, small code farmers also have big dreams

1.1. Higher order function when function is used as function parameter Here we introduce sumBy{} higher-order functions in strings. Take a look at the source code first //  Source code of sumBy function public inline fun CharSequence.sumBy(selector: (Char) -> Int): Int {     var sum: Int = 0     for (element in this) {         ...

Added by shneoh on Fri, 03 Sep 2021 01:44:50 +0300

Pangu and Nuwa in the Java World - Zygote, it's really a sudden enlightenment

registerServerSocketFromEnv registers the server socket for cross process communication. Binder communication is not used here.preload() to perform the preload operationgcAndFinalize(), take the initiative to conduct a garbage collection before forkSystemServerforkSystemServer(), create SystemServer processrunSelectLoop(), waiting for the socke ...

Added by tfburges on Thu, 02 Sep 2021 10:57:45 +0300