Control binding is an age-old topic in Android development. You start with findViewById, and you have all kinds of Finds all over the screen; Later Butterknife came along and used annotations for control binding, thus simplifying the UI layer
In order to simulate a real scenario, we found two interfaces from wanandroid website, as follows :(thanks to wanandroid!) 1. Multi-task nested callback scenario: for example, interface 2 can be called only after interface 1 has a callback
SpannableString is used to decorate a TextView, changing the color of text in a paragraph, adding click events, underlining, and so on
Displays the date of the given month and allows you to select a day. These days are arranged in a rectangular grid, one column for each day of the week. SelectedDate: the selectedDate with a circular background. CurrentDate: indicates the currentDate, with text highlighted. OnChanged: Callback when the date selected by the user changes. FirstDate: the start value of the optional date...
Take a mobile phone with a refresh rate of 60Hz as an example, the screen refresh interval is 16ms, if the View does not complete the drawing operation within 16ms, it will cause frame drop, so some frequently drawn and complex controls if simply inherit View in the main line
One. Create two. Just three, From four. Repeat 1. RepeatWhen 2. RepeatUntil 5. Empty/Never/Error 1. Empty () 2. Error () 3. Defer to seven. The Timer eight....
if (TextUtils.if (file == null || ! file.var files = file.if (files == null || files.for (i in files.if (files[i].var path = files[i].LogUtil...
1. Three methods of singleton implementation: Object, lazy, double-checked lock 2. Typealias Assigns individual names to complex types
This article mainly introduces the common skills of Kotlin in project development: 1. Use lazy delegate correctly; 2. Optimize the use of view.postdelay (); 3
In the middle of the App startup, all classes that need to be changed have already been loaded. It is impossible to uninstall a loaded class on Android. Tencent's solution is to let the ClassLoader load new classes,