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 
17 package com.android.mail.drawer;
18 
19 import android.view.View;
20 import android.view.ViewGroup;
21 
22 import com.android.mail.R;
23 import com.android.mail.ui.ControllableActivity;
24 import com.android.mail.utils.FolderUri;
25 
26 class BlankHeaderDrawerItem extends DrawerItem {
BlankHeaderDrawerItem(ControllableActivity activity)27     BlankHeaderDrawerItem(ControllableActivity activity) {
28         super(activity, null, NONFOLDER_ITEM, null);
29     }
30 
31     @Override
toString()32     public String toString() {
33         return "[DrawerItem VIEW_BLANK_HEADER]";
34     }
35 
36     /**
37      * Returns a blank divider
38      *
39      * @param convertView A previous view, perhaps null
40      * @param parent the parent of this view
41      * @return a blank header
42      */
43     @Override
getView(View convertView, ViewGroup parent)44     public View getView(View convertView, ViewGroup parent) {
45         final View blankHeaderView;
46         if (convertView != null) {
47             blankHeaderView = convertView;
48         } else {
49             blankHeaderView = mInflater.inflate(R.layout.folder_list_blank_header, parent,
50                     false);
51         }
52         return blankHeaderView;
53     }
54 
55     @Override
isHighlighted(FolderUri currentFolder, int currentType)56     public boolean isHighlighted(FolderUri currentFolder, int currentType) {
57         return false;
58     }
59 
60     @Override
isItemEnabled()61     public boolean isItemEnabled() {
62         return false;
63     }
64 
65     @Override
getType()66     public @DrawerItemType int getType() {
67         return VIEW_BLANK_HEADER;
68     }
69 }
70