1. Controls
- Genymotion virtual machine and plus
- drawable-24 is used to put vector graphics
- ConstraintLayout layout can add percentage auxiliary line to help adapt
- The right side is multi-selection and then aligned in one way, which is also very easy to use
- Picture references such as R.drawable.apple can be stored in int type picture id
- style: This resource directory is used to place various themes for ToolBar or other controls such as portals
- Regarding so many texts, the first one is label, Plain Text is fully displayed, Password is *****, Number will only pop up the numeric keyboard (emmm, so some only fill in the numeric verification code but jump out of the full keyboard is The programmer is lazy)
- calendar
- Rating stars
- Screen flip
- Two sets of layouts can be done in horizontal and vertical mode.
2. Localization (adapt to multiple languages)
1)
Go to the values folder, open strings.xml, and use open editor 2) Click on the small globe and look for simplified Chinese (Minima is localized and powerful)
3) Add the corresponding conversion language
4) The corresponding folder is generated
2.5 Use layout_marginStart and End to replace Left and Right
2.6 clipToPadding 和 clipChildren
- LinearLayout can also make a bottom with a bottom beyond the boundary (for example, the width is set to 0, and the weight of the four FrameLayout is one). The properties are all true by default.
1) If clipToPadding is false, it means that the padding area inside the view can also display the view.
2) If clipChildren is false, it means that even if the child view inside the layout is outside the boundary of the layout, the child view interface can be displayed.
- Pay attention to clipToPadding. Use this carefully. Don't just write it without nesting (anywhere), and weight=1 and other layouts may be combined into unclear effects.
4) Good-looking example
5) If the child control exceeds the parent control, the android:clipToPadding and android:clipChildren attributes of the parent control must be set to false. Sometimes we find that the parent control has set these two attributes, and the child control is still clipped , This is because the space of the parent control is not enough, that is, the parent control is cropped. At this time, we need to set the property of the parent control of the parent control to false. Haha, but don't just add it to the summary, which is to set the properties of which control space you want to occupy.
List<Integer> idlistgroup = Arrays.asList(
R.id.first,
R.id.second,
R.id.third,
R.id.forth)
2.7 Interface writing: two ways
3. A class in ViewModel-jetpack (a component of the androidx library)
- ViewModel is part of jetpack architecture components
- Make the interface Activity and Fragment UI only control the interface, and hand over the code data operation to the ViewModel to decouple
- Store Activity data, when the ac is not destroyed, the data will not be lost when the screen is redrawn (switching language, rotating the screen)
- ViewModelProviders have been deprecated and changed to ViewModelProvider samples
- Cooperate with LifeData to complete the monitoring of dynamic data (automatically refresh data changes, and complete database storage in conjunction with Room.