Adam Cohen | 9211d42 | 2014-10-07 18:14:53 -0700 | [diff] [blame^] | 1 | package com.android.launcher3; |
| 2 | |
| 3 | import android.content.ComponentName; |
| 4 | import android.content.Intent; |
| 5 | import android.graphics.Rect; |
| 6 | import android.os.Bundle; |
| 7 | import android.view.Menu; |
| 8 | import android.view.View; |
| 9 | |
| 10 | import java.io.FileDescriptor; |
| 11 | import java.io.PrintWriter; |
| 12 | import java.util.ArrayList; |
| 13 | |
| 14 | /** |
| 15 | * LauncherCallbacks is an interface used to extend the Launcher activity. It includes many hooks |
| 16 | * in order to add additional functionality. Some of these are very general, and give extending |
| 17 | * classes the ability to react to Activity life-cycle or specific user interactions. Others |
| 18 | * are more specific and relate to replacing parts of the application, for example, the search |
| 19 | * interface or the wallpaper picker. |
| 20 | */ |
| 21 | public interface LauncherCallbacks { |
| 22 | |
| 23 | /* |
| 24 | * Activity life-cycle methods. These methods are triggered after |
| 25 | * the code in the corresponding Launcher method is executed. |
| 26 | */ |
| 27 | public void preOnCreate(); |
| 28 | public void onCreate(Bundle savedInstanceState); |
| 29 | public void preOnResume(); |
| 30 | public void onResume(); |
| 31 | public void onStart(); |
| 32 | public void onStop(); |
| 33 | public void onPause(); |
| 34 | public void onDestroy(); |
| 35 | public void onSaveInstanceState(Bundle outState); |
| 36 | public void onPostCreate(Bundle savedInstanceState); |
| 37 | public void onNewIntent(Intent intent); |
| 38 | public void onActivityResult(int requestCode, int resultCode, Intent data); |
| 39 | public void onWindowFocusChanged(boolean hasFocus); |
| 40 | public boolean onPrepareOptionsMenu(Menu menu); |
| 41 | public void dump(String prefix, FileDescriptor fd, PrintWriter w, String[] args); |
| 42 | public void onHomeIntent(); |
| 43 | public boolean handleBackPressed(); |
| 44 | |
| 45 | /* |
| 46 | * Extension points for providing custom behavior on certain user interactions. |
| 47 | */ |
| 48 | public void onLauncherProviderChange(); |
| 49 | public void finishBindingItems(final boolean upgradePath); |
| 50 | public void onClickAllAppsButton(View v); |
| 51 | public void bindAllApplications(ArrayList<AppInfo> apps); |
| 52 | public void onClickFolderIcon(View v); |
| 53 | public void onClickAppShortcut(View v); |
| 54 | public void onClickPagedViewIcon(View v); |
| 55 | public void onClickWallpaperPicker(View v); |
| 56 | public void onClickSettingsButton(View v); |
| 57 | public void onClickAddWidgetButton(View v); |
| 58 | public void onPageSwitch(View newPage, int newPageIndex); |
| 59 | public void onWorkspaceLockedChanged(); |
| 60 | public void onDragStarted(View view); |
| 61 | public void onInteractionBegin(); |
| 62 | public void onInteractionEnd(); |
| 63 | |
| 64 | /* |
| 65 | * Extension points for replacing the search experience |
| 66 | */ |
| 67 | public boolean forceDisableVoiceButtonProxy(); |
| 68 | public boolean providesSearch(); |
| 69 | public boolean startSearch(String initialQuery, boolean selectInitialQuery, |
| 70 | Bundle appSearchData, Rect sourceBounds); |
| 71 | public void startVoice(); |
| 72 | public boolean hasCustomContentToLeft(); |
| 73 | public void populateCustomContentContainer(); |
| 74 | public View getQsbBar(); |
| 75 | |
| 76 | /* |
| 77 | * Extensions points for adding / replacing some other aspects of the Launcher experience. |
| 78 | */ |
| 79 | public Intent getFirstRunActivity(); |
| 80 | public boolean hasFirstRunActivity(); |
| 81 | public boolean hasDismissableIntroScreen(); |
| 82 | public View getIntroScreen(); |
| 83 | public boolean shouldMoveToDefaultScreenOnHomeIntent(); |
| 84 | public boolean hasSettings(); |
| 85 | public ComponentName getWallpaperPickerComponent(); |
| 86 | public boolean overrideWallpaperDimensions(); |
| 87 | public boolean isLauncherPreinstalled(); |
| 88 | |
| 89 | } |