diff options
author | Tyson Miller <tmiller@cyngn.com> | 2015-11-10 08:59:15 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-28 17:00:28 -0800 |
commit | 7df0227f6a835641a3d41327a65845806ef070fb (patch) | |
tree | 3fcf92a1fba468facc675ad47accb08ec2f9f907 /RemoteFolder | |
parent | 84dfd2a560442953af78aa77dbd6c909aed63589 (diff) | |
download | android_packages_apps_Trebuchet-7df0227f6a835641a3d41327a65845806ef070fb.tar.gz android_packages_apps_Trebuchet-7df0227f6a835641a3d41327a65845806ef070fb.tar.bz2 android_packages_apps_Trebuchet-7df0227f6a835641a3d41327a65845806ef070fb.zip |
Port Remote Folder from 12.1 to 13.
Change-Id: If8cf9d5f054e8948ead702883b79f28db26c4d8b
Diffstat (limited to 'RemoteFolder')
-rw-r--r-- | RemoteFolder/Android-prebuilt-libs.mk | 1 | ||||
-rw-r--r-- | RemoteFolder/Android.mk | 1 | ||||
-rw-r--r-- | RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java | 128 |
3 files changed, 130 insertions, 0 deletions
diff --git a/RemoteFolder/Android-prebuilt-libs.mk b/RemoteFolder/Android-prebuilt-libs.mk new file mode 100644 index 000000000..65357a8b8 --- /dev/null +++ b/RemoteFolder/Android-prebuilt-libs.mk @@ -0,0 +1 @@ +# Empty file needed to mirror lib makefile in overlay
\ No newline at end of file diff --git a/RemoteFolder/Android.mk b/RemoteFolder/Android.mk new file mode 100644 index 000000000..2a7441345 --- /dev/null +++ b/RemoteFolder/Android.mk @@ -0,0 +1 @@ +LOCAL_SRC_FILES += $(call all-java-files-under, RemoteFolder/src) diff --git a/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java b/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java new file mode 100644 index 000000000..8bb55a69f --- /dev/null +++ b/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java @@ -0,0 +1,128 @@ +package com.android.launcher3; + +import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.view.View; +import android.view.ViewGroup; +import com.android.launcher3.allapps.AllAppsGridAdapter; +import com.android.launcher3.allapps.AlphabeticalAppsList; + + +import java.util.ArrayList; +import java.util.List; + +/** + * Manages adding and removing the remote folder from the workspace. + */ +public class RemoteFolderManager { + + public RemoteFolderManager(final Launcher launcher) { } + + /** + * Called when launcher receives a non-initial {@link Launcher#onCreate(Bundle)} call. + * @param launcher new launcher activity. + */ + public void onRecreateLauncher(final Launcher launcher) { } + + /** + * Create a remote folder view. + * @param icon folder icon view on the workspace. + * @return a view for the remote folder. + */ + public Folder createRemoteFolder(final FolderIcon icon, ViewGroup root) { return null; } + + /** + * Get a drawable for the supplied item in the folder icon preview. + * @param items list of views in the folder. + * @param position index of icon to retreive. + * @return an icon to draw in the folder preview. + */ + public Drawable getFolderIconDrawable(final ArrayList<View> items, + final int position) { return null; } + + /** + * Called when Launcher finishes binding items from the model. + */ + public void bindFinished() { } + + /** + * Called when the setting for remote folder is updated. + * @param newValue the new setting for remote folder + */ + public void onSettingChanged(final boolean newValue) { } + + /** + * Called when the remote folder is dropped into the delete area on the workspace. + */ + public void onFolderDeleted() { } + + /** + * Called when the app drawer is opened. + */ + public void onAppDrawerOpened() { } + + /** + * Called when the app drawer is reloaded. + */ + public void onReloadAppDrawer() { } + + /** + * Called when the app drawer is measured. + * @param numAppsPerRow the number of apps the drawer will show in a row. + */ + public void onMeasureDrawer(int numAppsPerRow) { } + + /** + * Called when new apps are added to launcher. + * @param apps list of added apps. + */ + public void onBindAddApps(ArrayList<AppInfo> apps) { } + + /** + * Called when the info icon is clicked + */ + public void onInfoIconClicked() { } + + /** + * Change the appearance of FolderIcon for our RemoteFolder by adding a badge + * @param icon the FolderIcon to update + * @return a FolderIcon with an added ImageView + */ + public static FolderIcon addBadgeToFolderIcon(FolderIcon icon) { + return icon; + } + + /** + * Called when adapter items for predicted apps are updated. + * @param items current list of built adapter items. + * @param fastScrollInfo fast scroller info for this section. + * @param sectionInfo info about apps in this section. + * @param position current position of item to be built into the adapter. + * @return the new position to start from for next adapter items. + */ + public int onUpdateAdapterItems(final List<AlphabeticalAppsList.AdapterItem> items, + final AlphabeticalAppsList.FastScrollSectionInfo fastScrollInfo, + final AlphabeticalAppsList.SectionInfo sectionInfo, + int position) { return position; } + + /** + * Called when a view holder is created for a remote app. + * @param holder remote view holder. + * @param viewType specific type of view holder. + */ + public void onCreateViewHolder(final AllAppsGridAdapter.ViewHolder holder, final int viewType) { } + + /** + * Called when a view holder is bound for a remote app. + * @param holder remote view holder. + * @param item info for this app. + */ + public void onBindViewHolder(final AllAppsGridAdapter.ViewHolder holder, final AppInfo item) { } + + /** + * Get the String to be used for the RemoteFolder name and its corresponding Settings option + * @return the name RemoteFolder and its Setting option should use + */ + public static String getFeatureTitle(Resources res) { return null; } +} |