diff options
Diffstat (limited to 'RemoteFolder/src/com/android')
-rw-r--r-- | RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java | 27 | ||||
-rw-r--r-- | RemoteFolder/src/com/android/launcher3/RemoteFolderUpdater.java | 83 |
2 files changed, 110 insertions, 0 deletions
diff --git a/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java b/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java new file mode 100644 index 000000000..477f71011 --- /dev/null +++ b/RemoteFolder/src/com/android/launcher3/RemoteFolderManager.java @@ -0,0 +1,27 @@ +package com.android.launcher3; + +/** + * Manages adding and removing the remote folder from the workspace. + */ +public class RemoteFolderManager { + + public RemoteFolderManager(final Launcher launcher) { } + + public void setRemoteFolder(final FolderIcon remoteFolder) { } + + /** + * 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() { } +} diff --git a/RemoteFolder/src/com/android/launcher3/RemoteFolderUpdater.java b/RemoteFolder/src/com/android/launcher3/RemoteFolderUpdater.java new file mode 100644 index 000000000..954595e1f --- /dev/null +++ b/RemoteFolder/src/com/android/launcher3/RemoteFolderUpdater.java @@ -0,0 +1,83 @@ +package com.android.launcher3; + +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.view.View; +import java.util.List; +import android.util.Log; + +public class RemoteFolderUpdater { + + private static final String TAG = "RemoteFolderUpdater"; + + private static final Object sLock = new Object(); + private static RemoteFolderUpdater sInstance; + + public interface RemoteFolderUpdateListener { + void onSuccess(List<RemoteFolderInfo> remoteFolderInfoList); + void onFailure(String error); + } + + public static RemoteFolderUpdater getInstance() { + synchronized (sLock) { + if (sInstance == null) { + sInstance = new RemoteFolderUpdater(); + } + + return sInstance; + } + } + + private RemoteFolderUpdater() { } + + /** + * Requests data needed by remote folders. + * @param context + * @param size + * @param listener + */ + public synchronized void requestSync(Context context, final int size, final RemoteFolderUpdateListener listener) { + if (listener != null) { + listener.onFailure("RemoteFolderUpdater may not have been properly setup"); + } + } + + /** + * Register a callback to track clicks on our individual Remote Folder items. Make sure the + * intent associated with each item has a unique ID. + * + * @param view The individual item the user may click (or just clicked) + * @param intent The intent associated with the ShortcutInfo that belongs to our view + */ + public void registerViewForInteraction(View view, Intent intent) { + Log.e(TAG, "Couldn't register view for user interaction, RemoteFolderUpdater may not have been properly setup"); + } + + /** + * Holds important information that the launcher will need for each item in the remote folder. + */ + public class RemoteFolderInfo { + + public void setRecommendationData(View view) { + return; + } + + public String getTitle() { + return null; + } + + public Bitmap getIcon() { + return null; + } + + public String getIconUrl() { + return null; + } + + public Intent getIntent() { + return null; + } + } + +} |