From 7df0227f6a835641a3d41327a65845806ef070fb Mon Sep 17 00:00:00 2001 From: Tyson Miller Date: Tue, 10 Nov 2015 08:59:15 -0800 Subject: Port Remote Folder from 12.1 to 13. Change-Id: If8cf9d5f054e8948ead702883b79f28db26c4d8b --- .../com/android/launcher3/RemoteFolderManager.java | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java (limited to 'RemoteFolder/src/com/android') 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 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 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 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; } +} -- cgit v1.2.3