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