17ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook/*******************************************************************************
27ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      Copyright (C) 2013 Google Inc.
37ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      Licensed to The Android Open Source Project.
47ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *
57ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      Licensed under the Apache License, Version 2.0 (the "License");
67ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      you may not use this file except in compliance with the License.
77ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      You may obtain a copy of the License at
87ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *
97ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *           http://www.apache.org/licenses/LICENSE-2.0
107ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *
117ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      Unless required by applicable law or agreed to in writing, software
127ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      distributed under the License is distributed on an "AS IS" BASIS,
137ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
147ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      See the License for the specific language governing permissions and
157ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *      limitations under the License.
167ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook *******************************************************************************/
177ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrookpackage com.android.mail.ui;
187ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook
197ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrookimport android.content.Context;
207ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrookimport android.database.Cursor;
217ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrookimport com.android.mail.providers.Folder;
227ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook
237ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrookpublic class UserFolderHierarchicalFolderSelectorAdapter extends HierarchicalFolderSelectorAdapter {
24106a12a1b6642e8c2f716aefa846d9664fbec158Andrew Sapperstein    public UserFolderHierarchicalFolderSelectorAdapter(
25106a12a1b6642e8c2f716aefa846d9664fbec158Andrew Sapperstein            Context context, Cursor folders, int layout, Folder excludedFolder) {
26106a12a1b6642e8c2f716aefa846d9664fbec158Andrew Sapperstein        super(context, folders, layout, excludedFolder);
277ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook    }
287ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook
297ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook    /**
307ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook     * Return whether the supplied folder meets the requirements to be displayed
317ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook     * in the folder list.
327ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook     */
337ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook    @Override
347ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook    protected boolean meetsRequirements(Folder folder) {
357ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook        if (folder.isProviderFolder()) {
367ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook            return false;
377ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook        }
387ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook        return super.meetsRequirements(folder);
397ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook    }
407ac3d4ea760a5b2eef1a1f5476f25747027c2883Paul Westbrook}
41