This article simulates three roles: Android architect-Fulamatu, Android control development engineer-small black, Android development engineer-Small white, below three roles to analyze the measure process in different angles.Xiao Fu is responsible for sharing :
The essence of measure-OK
Measure code Flow-Analysis Framelayout.onmeasure
Onmeasure
AttributeSet.
By specifying the resource file in the Label property "style".
The default defstyleattr.
The default defstyleres.
The default value in the current theme.
The code for the constructor is too long, it is not posted here, the main work is to obtain the properties of each system definition, and then initialize the view's individual member variables and events based on the property values. In general, when we customize the
PrefaceAndroid View system is the core of interface programming, he is no less important than Android four components, in this series I will continue to talk about the view coordinate system, view sliding, view event distribution and other articles to gradually introduce the
Scroroller for Android (5)-detailed explanation of scroroller call process and View re-paintingMainActivity is as follows:
package cc.ww;import android.os.Bundle;import android.widget.ImageView;import android.widget.ImageView.ScaleType;import android.widget.RelativeLayout;import android.widget.RelativeLayout.LayoutParams;import android.app.Activity;import android.content.Context;public class MainActivity ex
Android learning-grid view and image switcher)
The GridView is used to display multiple components by row and column distribution on the interface. The GridView and ListView have the same parent class: AbsListView. The difference between the GridView and ListView is that the ListView is distributed only in one direction, and the GridView is distributed in two directions. Therefore, when using the GridView
Android View touch event Transfer Mechanism
PS: from the current perspective, you may feel bad about the previous blogs. You may feel the same if you look at the current blog for a while. So I learned to discover and understand new things every moment.Introduction
Because the quality of a previously written blog about the sequence of Android event transfer is too
Examples are:Android custom View Password Box example1 Good Custom viewEasy to use, standard, open.A well-designed custom view is similar to other well-designed classes. Encapsulates a feature combination with an easy-to-use interface that can be used efficiently with CPU and memory, and is very open. However, in addition to starting a well-designed class, a custom view
1 Android Drawing View simple description of the processA simple description can be interpreted as: Calculate size (measure), Layout coordinate calculation (layouts), Draw to the screen (draw);Let 's take a look at each step of the action exactly what it is,The first step: When the activity starts, triggering the initialization of the view process is called by th
Android coordinate system understanding directly related to the back of your Android advanced part of the study, if there is no solid foundation, you customize the view will have a desire dissatisfaction, can't stop-want to understand but feel difficult, want to give up and feel reluctant.The coordinate system in Android
Android View FrameAndroid UI system is the core of Android application System framework, the most basic content!1. Android View system, hierarchical relationshipAndroid app design is similar to Web application design, and also sub-front and back-end design. The core elements
Android custom View needs to override ondraw () and other methods
Android custom View Requires override of ondraw () and other methods. This blog tells you how to write a custom View. We need to inherit the View and then rewrite s
Original address http://developer.android.com/training/custom-views/create-view.html
As mentioned above:For the first translation, the self-knowledge translation is not very good. Therefore, please do not blame the readers (if any). I believe they will do better in the future.
I think there are several reasons for translation:
Exercise my ability to read English
Through careful translation, I can have a deeper understanding of the translation content and learn the knowledge well.
Translatin
Android View measure (2) related to custom UI control measure
This article simulates three roles: Android architect-Xiao Fu, Android control development engineer-Xiao, Android Development Engineer-Xiao Bai. The following describes the measure process from different angles o
onItemSelected (AdapterView View arg1, int arg2, long arg3 ){// TODO Auto-generated method stub/* Process the selected current event in the move focus of the image in the GridView */}/* Image Items event processing in the GridView is not selected */@ OverridePublic void onNothingSelected (AdapterView // TODO Auto-generated method stub}----------------------------- The code is as follows --------------------------------Copy code
Modify mainActivity. j
1. Use Android API functions to view1.1 activitymanager view available memory.Activitymanager. memoryinfo outinfo = new activitymanager. memoryinfo ();Am. getmemoryinfo (outinfo );Outinfo. availmem is available idle memory.1.2. Android. OS. debug queries memory usage information of a single process, such as PSS, VSS, and USS.Memoryinfo [] memoryinfoarray = aM. ge
The gallery control of Android is a Good Graph Display Control, which greatly reduces developers' development of the Image view function and provides a more elegant effect.
/Chapter04_ui_gallery01/src/COM/Amaker/test/mainactivity. Java
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Package Com. Amaker. test; Import
Use of Custom Controls
Explain the meaning of the following sentence
xmlns:custom_btn="http://schemas.android.com/apk/res/com.example.buttontest"Custom_btn is the prefix of the custom attribute, Which is used later when you reference the custom attribute.
Com. example. buttontest is the package name of the program to be created. No matter which package
Android custom View. What do you need to know?
Why do we think that custom View is a hurdle for learning Android?Why do so many Android experts think that custom View is so simple?Why does google define a
View pager for Android gallery effects multiple images
First, let's look at the following results:
From the above picture, we can see that when multiple images are added, they can be squashed into a gallery. We pull the images left and right to see the images we added. Is the effect much better? Let's see how it works!
The above effect is similar to the ViewPage effect in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.