1 /* 2 * Copyright (C) 2015 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.dirlist; 18 19 import android.util.SparseArray; 20 import android.view.ViewGroup; 21 22 import java.util.ArrayList; 23 import java.util.List; 24 25 /** 26 * A skeletal {@link DocumentsAdapter} test double. 27 */ 28 public class TestDocumentsAdapter extends DocumentsAdapter { 29 30 List<String> mModelIds = new ArrayList<>(); 31 32 public TestDocumentsAdapter(List<String> modelIds) { 33 mModelIds = modelIds; 34 } 35 36 @Override 37 public void onModelUpdate(Model model) { 38 } 39 40 @Override 41 public void onModelUpdateFailed(Exception e) { 42 } 43 44 @Override 45 List<String> getModelIds() { 46 return mModelIds; 47 } 48 49 @Override 50 void onItemSelectionChanged(String id) { 51 } 52 53 @Override 54 String getModelId(int position) { 55 return mModelIds.get(position); 56 } 57 58 @Override 59 public SparseArray<String> hide(String... ids) { 60 throw new UnsupportedOperationException(); 61 } 62 63 @Override 64 public DocumentHolder onCreateViewHolder(ViewGroup parent, int viewType) { 65 throw new UnsupportedOperationException(); 66 } 67 68 @Override 69 public void onBindViewHolder(DocumentHolder holder, int position) { 70 throw new UnsupportedOperationException(); 71 } 72 73 @Override 74 public int getItemCount() { 75 return mModelIds.size(); 76 } 77 } 78