/*
* Copyright (C) 2008 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 com.ives.launcher;
import static android.util.Log.d;
import static android.util.Log.e;
import static android.util.Log.w;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.LinkedList;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.SearchManager;
import android.app.WallpaperInfo;
import android.app.WallpaperManager;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.LabeledIntent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.MessageQueue;
import android.os.Parcelable;
import android.os.RemoteException;
import android.provider.LiveFolders;
import android.text.Selection;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.TextKeyListener;
import android.util.SparseArray;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
/**
* Default launcher application.
*/
@SuppressLint({ "NewApi"})
public final class Launcher extends Activity implements View.OnClickListener, OnLongClickListener {
static final String LOG_TAG = "Launcher";
static final boolean LOGD = false;
private static final boolean PROFILE_STARTUP = false;
private static final boolean PROFILE_DRAWER = false;
private static final boolean PROFILE_ROTATE = false;
private static final boolean DEBUG_USER_INTERFACE = false;
private static final int MENU_GROUP_ADD = 1;
private static final int MENU_ADD = Menu.FIRST + 1;
private static final int MENU_WALLPAPER_SETTINGS = MENU_ADD + 1;
private static final int MENU_SEARCH = MENU_WALLPAPER_SETTINGS + 1;
private static final int MENU_NOTIFICATIONS = MENU_SEARCH + 1;
private static final int MENU_SETTINGS = MENU_NOTIFICATIONS + 1;
private static final int REQUEST_CREATE_SHORTCUT = 1;
private static final int REQUEST_CREATE_LIVE_FOLDER = 4;
private static final int REQUEST_CREATE_APPWIDGET = 5;
private static final int REQUEST_PICK_APPLICATION = 6;
private static final int REQUEST_PICK_SHORTCUT = 7;
private static final int REQUEST_PICK_LIVE_FOLDER = 8;
private static final int REQUEST_PICK_APPWIDGET = 9;
static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
static final String EXTRA_CUSTOM_WIDGET = "custom_widget";
static final String SEARCH_WIDGET = "search_widget";
static final int WALLPAPER_SCREENS_SPAN = 2;
static final int SCREEN_COUNT = 3;
static final int DEFAULT_SCREN = 1;
static final int NUMBER_CELLS_X = 4;
static final int NUMBER_CELLS_Y = 4;
private static final int DIALOG_CREATE_SHORTCUT = 1;
static final int DIALOG_RENAME_FOLDER = 2;
private static final String PREFERENCES = "launcher.preferences";
// Type: int
private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
// Type: boolean
private static final String RUNTIME_STATE_ALL_APPS_FOLDER = "launcher.all_apps_folder";
// Type: long
private static final String RUNTIME_STATE_USER_FOLDERS = "launcher.user_folder";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_SCREEN = "launcher.add_screen";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_CELL_X = "launcher.add_cellX";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_CELL_Y = "launcher.add_cellY";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_SPAN_X = "launcher.add_spanX";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_SPAN_Y = "launcher.add_spanY";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_COUNT_X = "launcher.add_countX";
// Type: int
private static final String RUNTIME_STATE_PENDING_ADD_COUNT_Y = "launcher.add_countY";
// Type: int[]
private static final String RUNTIME_STATE_PENDING_ADD_OCCUPIED_CELLS = "launcher.add_occupied_cells";
// Type: boolean
private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME = "launcher.rename_folder";
// Type: long
private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME_ID = "launcher.rename_folder_id";
private static final LauncherModel sModel = new LauncherModel();
private static final Object sLock = new Object();
private static int sScreen = DEFAULT_SCREN;
private final BroadcastReceiver mApplicationsReceiver = new ApplicationsIntentReceiver();
private final BroadcastReceiver mCloseSystemDialogsReceiver = new CloseSystemDialogsIntentReceiver();
private final ContentObserver mObserver = new FavoritesChangeObserver();
private final ContentObserver mWidgetObserver = new AppWidgetResetObserver();
private LayoutInflater mInflater;
private DragLayer mDragLayer;
private Workspace mWorkspace;
private AppWidgetManager mAppWidgetManager;
private LauncherAppWidgetHost mAppWidgetHost;
static final int APPWIDGET_HOST_ID = 1024;
private CellLayout.CellInfo mAddItemCellInfo;
private CellLayout.CellInfo mMenuAddInfo;
private final int[] mCellCoordinates = new int[2];
private FolderInfo mFolderInfo;
private SlidingDrawer mDrawer;
private TransitionDrawable mHandleIcon;
private HandleView mHandleView;
private AllAppsGridView mAllAppsGrid;
private boolean mDesktopLocked = true;
private Bundle mSavedState;
private SpannableStringBuilder mDefaultKeySsb = null;
private boolean mDestroyed;
private boolean mIsNewIntent;
private boolean mRestoring;
private boolean mWaitingForResult;
private boolean mLocaleChanged;
private Bundle mSavedInstanceState;
private DesktopBinder mBinder;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mInflater = getLayoutInflater();
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
android launcher2.1源码,可运行,已经修改好 (452个子文件)
resources.ap_ 6.44MB
MyLauncher1.0.1.apk 6.54MB
jarlist.cache 119B
Launcher.class 51KB
LauncherModel.class 29KB
Workspace.class 28KB
CellLayout.class 16KB
LauncherProvider$DatabaseHelper.class 15KB
DragLayer.class 12KB
LauncherModel$DesktopItemsLoader.class 9KB
Search.class 9KB
DeleteZone.class 8KB
LiveFolderAdapter.class 8KB
Launcher$CreateShortcut.class 6KB
WallpaperChooser.class 6KB
LauncherProvider.class 6KB
Folder.class 5KB
Launcher$RenameFolder.class 5KB
AllAppsGridView.class 5KB
Utilities.class 5KB
R$drawable.class 4KB
BubbleTextView.class 4KB
InstallShortcutReceiver.class 4KB
FolderIcon.class 4KB
LiveFolder.class 4KB
Launcher$DesktopBinder.class 4KB
UserFolder.class 4KB
LauncherModel$ApplicationsLoader.class 4KB
CellLayout$CellInfo.class 3KB
LiveFolderIcon.class 3KB
WallpaperChooser$WallpaperLoader.class 3KB
UninstallShortcutReceiver.class 3KB
ApplicationInfo.class 3KB
AddAdapter.class 3KB
Launcher$DrawerManager.class 3KB
HandleView.class 3KB
ItemInfo.class 3KB
WallpaperChooser$ImageAdapter.class 2KB
LauncherAppWidgetHostView.class 2KB
ApplicationsAdapter.class 2KB
LauncherSettings$Favorites.class 2KB
R$string.class 2KB
LiveFolder$FolderLoadingTask.class 2KB
CellLayout$LayoutParams.class 2KB
Launcher$ApplicationsIntentReceiver.class 2KB
LauncherModel$ChangeNotifier.class 2KB
R$styleable.class 2KB
LauncherProvider$SqlArguments.class 2KB
Search$1.class 2KB
CellLayout$CellInfo$VacantCell.class 2KB
LiveFolderInfo.class 2KB
FastBitmapDrawable.class 2KB
Workspace$SavedState.class 1KB
R$id.class 1KB
Workspace$SavedState$1.class 1KB
LauncherAppWidgetHostView$CheckForLongPress.class 1KB
Search$FromParentOriginAnimation.class 1KB
LauncherModel$ApplicationInfoComparator.class 1KB
Search$ToParentOriginAnimation.class 1KB
Launcher$RenameFolder$4.class 1KB
UserFolderInfo.class 1KB
LauncherModel$DesktopItemsLoader$1.class 1KB
R$layout.class 1KB
Search$2.class 1KB
DragLayer$ScrollRunnable.class 1KB
R$attr.class 1006B
LauncherAppWidgetInfo.class 1006B
AddAdapter$ListItem.class 996B
Launcher$RenameFolder$3.class 980B
Launcher$RenameFolder$2.class 980B
Launcher$CloseSystemDialogsIntentReceiver.class 980B
Launcher$RenameFolder$1.class 960B
Launcher$1.class 954B
LiveFolderAdapter$ViewHolder.class 888B
R.class 855B
DeleteZone$FastTranslateAnimation.class 835B
LauncherAppWidgetHost.class 821B
LauncherSettings$BaseLauncherColumns.class 767B
Manifest$permission.class 758B
R$color.class 753B
Search$1$1.class 753B
Launcher$FavoritesChangeObserver.class 745B
Launcher$AppWidgetResetObserver.class 742B
Launcher$LocaleConfiguration.class 632B
DeleteZone$FastAnimationSet.class 614B
R$dimen.class 565B
LauncherApplication.class 554B
Widget.class 552B
R$style.class 526B
LauncherSettings.class 492B
R$array.class 434B
R$anim.class 430B
DragController.class 418B
R$xml.class 395B
Manifest.class 372B
FolderInfo.class 365B
DragController$DragListener.class 346B
BuildConfig.class 343B
DropTarget.class 337B
DragScroller.class 172B
共 452 条
- 1
- 2
- 3
- 4
- 5
iveshuang
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页