1 /*
2  * Copyright (C) 2016 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.documentsui.sidebar;
18 
19 import static com.android.documentsui.base.SharedMinimal.DEBUG;
20 
21 import android.util.Log;
22 import android.view.View;
23 
24 import com.android.documentsui.R;
25 import com.android.documentsui.base.UserId;
26 
27 /**
28  * Stub {@link Item} for dividers between different types of {@link Item}s.
29  */
30 class SpacerItem extends Item {
31     private static final String TAG = "SpacerItem";
32 
33     private static final String STRING_ID = "SpacerItem";
34 
SpacerItem()35     public SpacerItem() {
36         // Multiple spacer items can share the same string id as they're identical.
37         super(R.layout.item_root_spacer, "" /* title */, STRING_ID, UserId.UNSPECIFIED_USER);
38     }
39 
40     @Override
bindView(View convertView)41     void bindView(View convertView) {
42         // Nothing to bind
43     }
44 
45     @Override
isRoot()46     boolean isRoot() {
47         return false;
48     }
49 
50     @Override
open()51     void open() {
52         if (DEBUG) {
53             Log.d(TAG, "Ignoring click/hover on spacer item.");
54         }
55     }
56 }
57