/*
* 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 android.content.ClipData;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Camera;
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.RectF;
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.text.TextUtils;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.LocaleUtil;
import android.util.Log;
import android.util.Pool;
import android.util.Poolable;
import android.util.PoolableManager;
import android.util.Pools;
import android.util.Property;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityEventSource;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
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 static android.os.Build.VERSION_CODES.*;
import com.android.internal.R;
import com.android.internal.util.Predicate;
import com.android.internal.view.menu.MenuBuilder;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* <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 reference">
* <h3>Developer Guides</h3>
* <p>For information about using this class to develop your application's user interface,
* read the <a href="{@docRoot}guide/topics/ui/index.html">User Interface</a> developer guide.
* </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(android.view.View.OnFocusChangeListener)}.
* 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(int)}.</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(int, int)}</code></td>
* <td>Called to determine the size requirements for this view and all
* of its children.
* </td>
* </tr>
* <tr>
* <td><code>{@link #onLayout(boolean, int, int, int, int)}</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(int, int, int, int)}</code></td>
* <td>Called when the size of this view has changed.
* </td>
* </tr>
*
* <tr>
* <td>Drawing</td>
* <td><code>{@link #onDraw(android.graphics.Canvas)}</code></td>
* <td>Called when the view should render its content.
* </td>
* </tr>
*
* <tr>
* <td rowspan="4">Event processing</td>
*
没有合适的资源?快使用搜索试试~ 我知道了~
android.jar 源码
共1574个文件
java:1287个
aidl:228个
html:54个
5星 · 超过95%的资源 需积分: 33 379 下载量 183 浏览量
2012-12-08
11:03:38
上传
评论 5
收藏 4.63MB RAR 举报
温馨提示
昨天花了一个晚上用git 从http://android.git.kernel.org/platform/frameworks/base.git 上搞下来的,给有需要的朋友,使用方法:在android.jar 同级目录下新建sources文件夹,将解压的内容放入其中,在eclipse中右键android.jar选择属性,关联到sources文件夹即可,小菜鸟新到,各位大手多多指教。
资源推荐
资源详情
资源评论
收起资源包目录
android.jar 源码 (1574个子文件)
IPackageManager.aidl 14KB
IBackupManager.aidl 12KB
IWindowManager.aidl 9KB
IBackupTransport.aidl 9KB
INetworkManagementService.aidl 9KB
IWindowSession.aidl 7KB
ITextToSpeechService.aidl 6KB
IBackupAgent.aidl 5KB
IBluetooth.aidl 5KB
IContentService.aidl 5KB
IAccessibilityServiceConnection.aidl 5KB
IRestoreSession.aidl 5KB
IDevicePolicyManager.aidl 4KB
IInputMethodManager.aidl 4KB
IConnectivityManager.aidl 4KB
IUsbManager.aidl 4KB
IBatteryStats.aidl 3KB
IAccountManager.aidl 3KB
IWindow.aidl 3KB
IAccountAuthenticator.aidl 3KB
IRecognitionListener.aidl 3KB
IRecognitionService.aidl 2KB
IInputContext.aidl 2KB
IRestoreObserver.aidl 2KB
IFullBackupRestoreObserver.aidl 2KB
IStatusBarService.aidl 2KB
IAppWidgetService.aidl 2KB
IBluetoothHeadset.aidl 2KB
IActivityController.aidl 2KB
ISyncAdapter.aidl 2KB
IAccessibilityInteractionConnectionCallback.aidl 2KB
INetworkStatsService.aidl 2KB
IAccessibilityInteractionCallback.aidl 2KB
INetworkManagementEventObserver.aidl 2KB
IPowerManager.aidl 2KB
IInputMethod.aidl 2KB
IAccessibilityManager.aidl 2KB
IWallpaperManager.aidl 2KB
ITextServicesManager.aidl 2KB
IInputMethodSession.aidl 2KB
IAccessibilityInteractionConnection.aidl 2KB
INetworkPolicyManager.aidl 2KB
INotificationManager.aidl 2KB
INfcTag.aidl 2KB
IBluetoothA2dp.aidl 2KB
INfcAdapter.aidl 1KB
IStatusBar.aidl 1KB
IUiModeManager.aidl 1KB
IMediaContainerService.aidl 1KB
IClipboard.aidl 1KB
IDropBoxManagerService.aidl 1KB
IAlarmManager.aidl 1KB
ISyncContext.aidl 1KB
IInputMethodCallback.aidl 1KB
ISearchManager.aidl 1KB
IBluetoothHealthCallback.aidl 1KB
IThrottleManager.aidl 1KB
IRemoteViewsFactory.aidl 1KB
IEventListener.aidl 1KB
IIntentReceiver.aidl 1KB
IInputContextCallback.aidl 1KB
IInputMethodClient.aidl 1KB
IUsageStats.aidl 1KB
ISpellCheckerService.aidl 1KB
IInstrumentationWatcher.aidl 1KB
IWallpaperEngine.aidl 1KB
IAppWidgetHost.aidl 1KB
IPackageStatsObserver.aidl 1KB
INfcAdapterExtras.aidl 1KB
IWallpaperManagerCallback.aidl 1KB
IFaceLockInterface.aidl 1020B
IInputConnectionCallback.aidl 1018B
IPackageDataObserver.aidl 1007B
IThumbnailReceiver.aidl 1005B
IContentObserver.aidl 1000B
IBluetoothPbap.aidl 1000B
ITextServicesSessionListener.aidl 990B
IAccountAuthenticatorResponse.aidl 971B
ISpellCheckerSession.aidl 954B
IAccountManagerResponse.aidl 949B
IWallpaperService.aidl 944B
IApplicationToken.aidl 936B
IWallpaperConnection.aidl 926B
IIntentSender.aidl 922B
IAccessibilityManagerClient.aidl 915B
IVibratorService.aidl 906B
ITextToSpeechCallback.aidl 906B
IActivityWatcher.aidl 894B
IFaceLockCallback.aidl 889B
IServiceConnection.aidl 886B
IResultReceiver.aidl 878B
IActivityPendingResult.aidl 877B
IPackageDeleteObserver.aidl 866B
IPackageInstallObserver.aidl 864B
IPackageMoveObserver.aidl 864B
ISpellCheckerSessionListener.aidl 864B
IProcessObserver.aidl 853B
IRemoteViewsAdapterConnection.aidl 851B
IRemoteCallback.aidl 849B
IBluetoothStateChangeCallback.aidl 846B
共 1574 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
zhengkuo1025
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页