This article original, reproduced please indicate the source: http://blog.csdn.net/qinjuningTranslation three:Optimizing viewsFor more information on how to design a custom view and respond to touch time, see Android Developer:Address: http://developer.android.com/training/custom-views/index.htmlThis article translated address: optimizing the ViewWith the previous study, the well-designed
Original article,Reprinted please indicate the source: http://blog.csdn.net/qinjuning
Translated 3:Optimization View
For details about how to design custom views and response touch time, see Android developer:
Address: http://developer.android.com/training/custom-views/index.html
Translation address: optimizing the view
Through the previous study, the well-
Written in the previous words: This chapter is very valuable, want to enhance the knowledge of Android must read. Other aspects of Ascension can also be achieved without being an android. Original address: http://android.xsoftlab.net/training/custom-views/making-interactive.htmlThe drawing of the UI is only part of the custom view. You also need to enable
customize a View and obtain the coordinates of the touch point in the onTouchEvent () method:
Public boolean onTouchEvent (MotionEvent event) {// obtain the x and Y coordinates of the finger, int x = (int) event. getX (); int y = (int) event. getY (); switch (event. getAction () {case MotionEvent. ACTION_DOWN: lastX = x; lastY = y; break ;...
Next we will calculate the offset in the ACTION_MOVE event, and then call the layout () method to re-place th
The project team, now using the MVVM (Model-view-view-model) pattern, has been engaged for one months and feels a little bit clear.The MVVM framework, which is limited to the WPF that we use, is the View folder: The main interface (view)-related. xaml and corresponding. cs files are heavily used for binding (usually th
in Android is not like this. It should be throughXML...
Let's modify the example.
First, we willClass is extracted and put into a separate class file. Next, we need to add some constructors to pass parameters to the view. It is best to see the sayhelloThe class should be like this:
Public class sayhello extends View
The standard valid and touchable UI elements specified by Android4.0 are 48dp, which is converted to a physical size of about 9mm. The recommended target size is 7 ~ 10mm, which is consistent with the iPhone, is an area where the user's fingers are accurate and comfortable to touch. As shown in, your UI elements may be smaller than 48dp, the icons only have 32dp, And the buttons only have 40dp, but their actual operational focus has reached the 48dp size.
In order to make the small UI area have
Sometimes we need to check the source code of the referenced jar package, which can be achieved through simple configuration.
Prerequisites: Download the source code of the jar package to your computer.
Example: to view the source code of the struts2-core-2.2.1.1.jar as an example.
Download Struts-2.2.1.1 with source code from the Internet.
When a str
Android special effect View: flashing View in the third bullet, androidviewFlashing View in the third bullet of Android special effect ViewI 've only been doing this for half a day, but I still have to give it one. The rest depends on imagination.
Package com.
OverviewIn the previous article, the drawing process of the Android view (top)--view The measure process of the view is described in detail. For the entire process of drawing the view, after measuring the size of the view, you sta
The types of events in Android are key events and screen touch events, and touch events are the underlying events of screen touch events, and it is necessary to understand them in depth.One of the simplest screen touch actions triggered a series of touch events:action_down->action_move->action_move->action_move...->action_move-> Action_upWhen the screen contains a viewgroup, and the ViewGroup contains a sub-view
My Android advanced tutorial ------) Create and view a custom Debug version Android signature certificate in Android
When Android Application Development accesses various sdks, it will find that many sdks need to be identified by the package name and the certificate fingerpr
Please respect the results of the sharing, reproduced please indicate the source:http://blog.csdn.net/hejjunlin/article/details/52263256Preface: The view frame written to the sixth article, found that the second article did not, and then the matter is in the public number, forget the update on the blog, so the attention of the public should have seen, while today there is time to fill up. (PS: The source code in this article is
Android learning --- Gallery gallery view, android --- Gallery
Gallery and Spinner share the same parent class: AbsPinner, indicating that Gallery and Spinner are both a list box. The difference between them is that the Spinner displays a vertical list selection box, while the Gallery displays a horizontal list selection box. The role of the Spinner is to allow u
Please respect the results of the sharing, reproduced please indicate the source:http://blog.csdn.net/hejjunlin/article/details/52282833View layout is over, from the beginning of this article view event correlation analysis, today is analyzing the view of the event distribution mechanism (PS: The source code in this article is Android 6.0, please know)
D
not intercept, continue to pass down.Click on the event from the bottom of the pass ruleThe Click event passes to the lowest view, and if his ontouchevent () method returns True, the event is consumed and processed by the lowest view, and if False indicates that the view is not processed, it is passed to the parent view's ontouchevent () processing, If the paren
lines and curves to the Path object, and then draw the shapes with the DrawPath () method. Just these base shapes can define their path style through the SetStyle () method.
You can define a gradient fill pattern by creating a LinearGradient object. Call the Setshader () method to populate the shape.
Draws a bitmap by using the Drawbitmap () method.
For example, the following code is used to draw a piechart. It mixes text, lines, and sha
:
XML attributes
Related Methods
Description
Android: layout_marginBottom
SetMargins (int, int)
The margin of the Child widget.
Android: layout_marginLeft
SetMargins (int, int)
The margin on the left of the Child widget.
Android: layout_marginRight
SetMargins (int, int)
The margin on the Right of t
Original URL: http://blog.csdn.net/vipzjyno1/article/details/22954775When we read the Android API Development documentation, each of the above classes, as well as the various methods of the class, are all methods and controls that have been written, but we are just moving in, not knowing how it works and how it is implemented. Android system is open source, so the official Google in each release of a versio
Article about the Android View event distribution process on the network can be found a large, here to post a code-based article, the author is also a cow: the Android event distribution mechanism completely parse, take you from the source point of view thoroughly understand (on).Although the talk is very good, but aft
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.