FileDocCategorySizeDatePackage
LiveFolder.javaAPI DocAndroid 1.5 API4614Wed May 06 22:42:46 BST 2009com.android.launcher

LiveFolder

public class LiveFolder extends Folder

Fields Summary
private android.os.AsyncTask
mLoadingTask
Constructors Summary
public LiveFolder(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
voidbind(FolderInfo info)

        super.bind(info);
        if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
            mLoadingTask.cancel(true);
        }
        mLoadingTask = new FolderLoadingTask(this).execute((LiveFolderInfo) info);
    
static com.android.launcher.LiveFolderfromXml(android.content.Context context, FolderInfo folderInfo)

        final int layout = isDisplayModeList(folderInfo) ?
                R.layout.live_folder_list : R.layout.live_folder_grid;
        return (LiveFolder) LayoutInflater.from(context).inflate(layout, null);
    
private static booleanisDisplayModeList(FolderInfo folderInfo)

        return ((LiveFolderInfo) folderInfo).displayMode ==
                LiveFolders.DISPLAY_MODE_LIST;
    
voidonClose()

        super.onClose();
        if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
            mLoadingTask.cancel(true);
        }

        // The adapter can be null if onClose() is called before FolderLoadingTask
        // is done querying the provider
        final LiveFolderAdapter adapter = (LiveFolderAdapter) mContent.getAdapter();
        if (adapter != null) {
            adapter.cleanup();
        }
    
public voidonItemClick(android.widget.AdapterView parent, android.view.View v, int position, long id)

        LiveFolderAdapter.ViewHolder holder = (LiveFolderAdapter.ViewHolder) v.getTag();

        if (holder.useBaseIntent) {
            final Intent baseIntent = ((LiveFolderInfo) mInfo).baseIntent;
            if (baseIntent != null) {
                final Intent intent = new Intent(baseIntent);
                Uri uri = baseIntent.getData();
                uri = uri.buildUpon().appendPath(Long.toString(holder.id)).build();
                intent.setData(uri);
                mLauncher.startActivitySafely(intent);
            }
        } else if (holder.intent != null) {
            mLauncher.startActivitySafely(holder.intent);
        }
    
public booleanonItemLongClick(android.widget.AdapterView parent, android.view.View view, int position, long id)

        return false;
    
voidonOpen()

        super.onOpen();
        requestFocus();