blob: 49b9ad9185ca6659a233f9034a18e43cc97f2cf6 [file] [log] [blame]
Riddle Hsu0c375982018-06-21 22:06:43 +08001/*
2 * Copyright 2018 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.documentsui;
18
19import android.os.Bundle;
20
21import androidx.recyclerview.selection.MutableSelection;
22import androidx.recyclerview.selection.Selection;
23import androidx.recyclerview.selection.SelectionTracker;
24import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
25
26import java.util.Set;
27
28/**
29 * A dummy SelectionTracker used by DocsSelectionHelper before a real SelectionTracker has been
30 * initialized by DirectoryFragment.
31 */
32public class DummySelectionTracker<K> extends SelectionTracker<K> {
33
34 @Override
35 public void addObserver(SelectionObserver observer) {
36 }
37
38 @Override
39 public boolean hasSelection() {
40 return false;
41 }
42
43 @Override
44 public Selection<K> getSelection() {
45 return new MutableSelection<K>();
46 }
47
48 @Override
49 public void copySelection(MutableSelection<K> dest) {
50 }
51
52 @Override
53 public boolean isSelected(K key) {
54 return false;
55 }
56
57 @Override
58 public void restoreSelection(Selection<K> selection) {
59 }
60
61 @Override
62 public boolean clearSelection() {
63 return false;
64 }
65
66 @Override
67 public boolean setItemsSelected(Iterable<K> keys, boolean selected) {
68 return false;
69 }
70
71 @Override
72 public boolean select(K key) {
73 return false;
74 }
75
76 @Override
77 public boolean deselect(K key) {
78 return false;
79 }
80
81 @Override
82 protected AdapterDataObserver getAdapterDataObserver() {
83 return null;
84 }
85
86 @Override
87 public void startRange(int position) {
88 }
89
90 @Override
91 public void extendRange(int position) {
92 }
93
94 @Override
95 public void endRange() {
96 }
97
98 @Override
99 public boolean isRangeActive() {
100 return false;
101 }
102
103 @Override
104 public void anchorRange(int position) {
105 }
106
107 @Override
108 public void extendProvisionalRange(int position) {
109 }
110
111 @Override
112 public void setProvisionalSelection(Set<K> newSelection) {
113 }
114
115 @Override
116 public void clearProvisionalSelection() {
117 }
118
119 @Override
120 public void mergeProvisionalSelection() {
121 }
122
123 @Override
124 public void onSaveInstanceState(Bundle state) {
125 }
126
127 @Override
128 public void onRestoreInstanceState(Bundle state) {
129 }
130
131}