1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.mail.drawer;
18
19import android.view.View;
20import android.view.ViewGroup;
21
22import com.android.mail.R;
23import com.android.mail.ui.ControllableActivity;
24import com.android.mail.utils.FolderUri;
25
26class WaitViewDrawerItem extends DrawerItem {
27    WaitViewDrawerItem(ControllableActivity activity) {
28        super(activity, null, NONFOLDER_ITEM, null);
29    }
30
31    @Override
32    public String toString() {
33        return "[DrawerItem VIEW_WAITING_FOR_SYNC]";
34    }
35
36    /**
37     * Return a view for the 'Waiting for sync' item with the indeterminate progress indicator.
38     *
39     * @param convertView a view, possibly null, to be recycled.
40     * @param parent the parent hosting this view.
41     * @return a view for "Waiting for sync..." at given position.
42     */
43    @Override
44    public View getView(View convertView, ViewGroup parent) {
45        final ViewGroup emptyView;
46        if (convertView != null) {
47            emptyView = (ViewGroup) convertView;
48        } else {
49            emptyView = (ViewGroup) mInflater.inflate(R.layout.drawer_empty_view, parent, false);
50        }
51        return emptyView;
52    }
53
54    @Override
55    public boolean isHighlighted(FolderUri currentFolder, int currentType) {
56        return false;
57    }
58
59    @Override
60    public boolean isItemEnabled() {
61        return false;
62    }
63
64    @Override
65    public @DrawerItemType int getType() {
66        return VIEW_WAITING_FOR_SYNC;
67    }
68}
69