/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.view;
import com.android.internal.R;
import com.android.internal.view.menu.MenuBuilder;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Interpolator;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Shader;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.Config;
import android.util.EventLog;
import android.util.Log;
import android.util.Pool;
import android.util.Poolable;
import android.util.PoolableManager;
import android.util.Pools;
import android.util.SparseArray;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityEventSource;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.ScrollBarDrawable;
import java.lang.ref.SoftReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.WeakHashMap;
/**
* <p>
* This class represents the basic building block for user interface components. A View
* occupies a rectangular area on the screen and is responsible for drawing and
* event handling. View is the base class for <em>widgets</em>, which are
* used to create interactive UI components (buttons, text fields, etc.). The
* {@link android.view.ViewGroup} subclass is the base class for <em>layouts</em>, which
* are invisible containers that hold other Views (or other ViewGroups) and define
* their layout properties.
* </p>
*
* <div class="special">
* <p>For an introduction to using this class to develop your
* application's user interface, read the Developer Guide documentation on
* <strong><a href="{@docRoot}guide/topics/ui/index.html">User Interface</a></strong>. Special topics
* include:
* <br/><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Declaring Layout</a>
* <br/><a href="{@docRoot}guide/topics/ui/menus.html">Creating Menus</a>
* <br/><a href="{@docRoot}guide/topics/ui/layout-objects.html">Common Layout Objects</a>
* <br/><a href="{@docRoot}guide/topics/ui/binding.html">Binding to Data with AdapterView</a>
* <br/><a href="{@docRoot}guide/topics/ui/ui-events.html">Handling UI Events</a>
* <br/><a href="{@docRoot}guide/topics/ui/themes.html">Applying Styles and Themes</a>
* <br/><a href="{@docRoot}guide/topics/ui/custom-components.html">Building Custom Components</a>
* <br/><a href="{@docRoot}guide/topics/ui/how-android-draws.html">How Android Draws Views</a>.
* </p>
* </div>
*
* <a name="Using"></a>
* <h3>Using Views</h3>
* <p>
* All of the views in a window are arranged in a single tree. You can add views
* either from code or by specifying a tree of views in one or more XML layout
* files. There are many specialized subclasses of views that act as controls or
* are capable of displaying text, images, or other content.
* </p>
* <p>
* Once you have created a tree of views, there are typically a few types of
* common operations you may wish to perform:
* <ul>
* <li><strong>Set properties:</strong> for example setting the text of a
* {@link android.widget.TextView}. The available properties and the methods
* that set them will vary among the different subclasses of views. Note that
* properties that are known at build time can be set in the XML layout
* files.</li>
* <li><strong>Set focus:</strong> The framework will handled moving focus in
* response to user input. To force focus to a specific view, call
* {@link #requestFocus}.</li>
* <li><strong>Set up listeners:</strong> Views allow clients to set listeners
* that will be notified when something interesting happens to the view. For
* example, all views will let you set a listener to be notified when the view
* gains or loses focus. You can register such a listener using
* {@link #setOnFocusChangeListener}. Other view subclasses offer more
* specialized listeners. For example, a Button exposes a listener to notify
* clients when the button is clicked.</li>
* <li><strong>Set visibility:</strong> You can hide or show views using
* {@link #setVisibility}.</li>
* </ul>
* </p>
* <p><em>
* Note: The Android framework is responsible for measuring, laying out and
* drawing views. You should not call methods that perform these actions on
* views yourself unless you are actually implementing a
* {@link android.view.ViewGroup}.
* </em></p>
*
* <a name="Lifecycle"></a>
* <h3>Implementing a Custom View</h3>
*
* <p>
* To implement a custom view, you will usually begin by providing overrides for
* some of the standard methods that the framework calls on all views. You do
* not need to override all of these methods. In fact, you can start by just
* overriding {@link #onDraw(android.graphics.Canvas)}.
* <table border="2" width="85%" align="center" cellpadding="5">
* <thead>
* <tr><th>Category</th> <th>Methods</th> <th>Description</th></tr>
* </thead>
*
* <tbody>
* <tr>
* <td rowspan="2">Creation</td>
* <td>Constructors</td>
* <td>There is a form of the constructor that are called when the view
* is created from code and a form that is called when the view is
* inflated from a layout file. The second form should parse and apply
* any attributes defined in the layout file.
* </td>
* </tr>
* <tr>
* <td><code>{@link #onFinishInflate()}</code></td>
* <td>Called after a view and all of its children has been inflated
* from XML.</td>
* </tr>
*
* <tr>
* <td rowspan="3">Layout</td>
* <td><code>{@link #onMeasure}</code></td>
* <td>Called to determine the size requirements for this view and all
* of its children.
* </td>
* </tr>
* <tr>
* <td><code>{@link #onLayout}</code></td>
* <td>Called when this view should assign a size and position to all
* of its children.
* </td>
* </tr>
* <tr>
* <td><code>{@link #onSizeChanged}</code></td>
* <td>Called when the size of this view has changed.
* </td>
* </tr>
*
* <tr>
* <td>Drawing</td>
* <td><code>{@link #onDraw}</code></td>
* <td>Called when the view should render its content.
* </td>
* </tr>
*
* <tr>
* <td rowspan="4">Event processi
没有合适的资源?快使用搜索试试~ 我知道了~
android-sdk2.1-sources.rar
共2000个文件
java:5962个
4星 · 超过85%的资源 需积分: 9 241 下载量 107 浏览量
2010-05-20
11:19:32
上传
评论
收藏 11.94MB RAR 举报
温馨提示
android-sdk2.1-sources android sdk 2.1 的源码,需要解压在 android-sdk-windows\platforms\android-7 目录中
资源推荐
资源详情
资源评论
收起资源包目录
android-sdk2.1-sources.rar (2000个子文件)
View.java 321KB
TextView.java 254KB
WebView.java 224KB
Intent.java 205KB
LoggerTest.java 181KB
Component.java 178KB
ActivityThread.java 170KB
DatagramChannelTest.java 157KB
FileChannelTest.java 156KB
Activity.java 153KB
Settings.java 149KB
SocketChannelTest.java 139KB
ViewGroup.java 128KB
DatabaseMetaData.java 127KB
ListView.java 127KB
AbsListView.java 126KB
ViewRoot.java 125KB
BigDecimalArithmeticTest.java 120KB
BigDecimal.java 120KB
PackageParser.java 116KB
Character.java 112KB
ObjectInputStream.java 107KB
SearchManager.java 107KB
Collections.java 106KB
ContactsContract.java 104KB
SyncManager.java 103KB
Arrays.java 102KB
DecimalFormatTest.java 101KB
Formatter.java 100KB
JunitTestCases.java 98KB
ActivityManagerNative.java 98KB
ApplicationContext.java 98KB
EncryptedPrivateKeyInfoTest.java 96KB
Gmail.java 95KB
HTMLSchema.java 93KB
DoubleTest.java 90KB
PKIXCertPathReviewer.java 90KB
AbstractQueuedSynchronizer.java 89KB
PatternTest.java 88KB
Contacts.java 87KB
ByteBufferTest.java 87KB
Character_UnicodeBlockTest.java 87KB
EncryptedPrivateKeyInfoData.java 86KB
InputMethodService.java 86KB
GLLogWrapper.java 85KB
VCardComposer.java 85KB
WebViewCore.java 84KB
TreeMap.java 84KB
CharacterTest.java 83KB
Scanner.java 82KB
SearchDialog.java 80KB
Resources.java 79KB
WifiStateTracker.java 78KB
Im.java 77KB
FileUtils.java 77KB
PackageManager.java 76KB
ClassTest.java 75KB
ObjectOutputStream.java 74KB
LogFactory.java 74KB
Context.java 73KB
ThreadPoolExecutor.java 73KB
BasicStroke.java 72KB
DateUtils.java 71KB
ResultSet.java 70KB
SQLiteDatabase.java 70KB
BigIntegerOperateBitsTest.java 69KB
Uri.java 69KB
BidiTest.java 68KB
BouncyCastleProvider.java 68KB
AccountManagerService.java 68KB
Canvas.java 68KB
PhoneNumberUtils.java 67KB
URLConnectionTest.java 66KB
StringBuilderTest.java 66KB
GridView.java 66KB
AccountManager.java 65KB
Parcel.java 65KB
AudioService.java 65KB
BluetoothService.java 64KB
MediaStore.java 64KB
BigDecimalConstructorsTest.java 64KB
ThreadTest.java 64KB
Pattern2Test.java 63KB
ThreadGroupTest.java 63KB
PreferencesTest.java 62KB
StrictMathTest.java 61KB
DecimalFormat.java 61KB
SyncStorageEngine.java 61KB
HttpsURLConnectionTest.java 60KB
MediaPlayer.java 60KB
PKIXCertPathValidatorSpi.java 59KB
URI.java 59KB
MediaScanner.java 59KB
SensorManager.java 59KB
String2Test.java 59KB
Layout.java 59KB
BigDecimalConvertTest.java 58KB
AutoCompleteTextView.java 58KB
Camera.java 58KB
Telephony.java 58KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
laorer
- 粉丝: 527
- 资源: 229
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AIS2024 valid
- 最入门的爬虫代码 python.docx
- 爬虫零基础入门-爬取天气预报.pdf
- 最通俗易懂的 MongoDB 非结构化文档存储数据库教程.zip
- 以mongodb为数据库的订单物流小项目.zip
- 腾讯云-mongodb数据库, 项目部署.zip
- 腾讯 APIJSON 的 MongoDB 数据库插件.zip
- 理解非关系型数据库和关系型数据库的区别.zip
- 操作简单的Mongodb网页web管理工具,基于Spring Boot2.0支持mongodb集群.zip
- tms-mongodb-web,提供访问mongodb数据的REST API和可灵活扩展的mongodb web 客户端.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页