1a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev/* 2a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * Copyright (C) 2015 The Android Open Source Project 3a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * 4a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * Licensed under the Apache License, Version 2.0 (the "License"); 5a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * you may not use this file except in compliance with the License. 6a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * You may obtain a copy of the License at 7a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * 8a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * http://www.apache.org/licenses/LICENSE-2.0 9a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * 10a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * Unless required by applicable law or agreed to in writing, software 11a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * distributed under the License is distributed on an "AS IS" BASIS, 12a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * See the License for the specific language governing permissions and 14a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev * limitations under the License. 15a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev */ 16a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 17a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheevpackage android.support.v7.util; 18a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 19a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheevinterface ThreadUtil<T> { 20a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 21a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev interface MainThreadCallback<T> { 22a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 23a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void updateItemCount(int generation, int itemCount); 24a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 25a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void addTile(int generation, TileList.Tile<T> tile); 26a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 27a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void removeTile(int generation, int position); 28a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev } 29a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 30a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev interface BackgroundCallback<T> { 31a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 32a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void refresh(int generation); 33a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 34a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void updateRange(int rangeStart, int rangeEnd, int extRangeStart, int extRangeEnd, 35a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev int scrollHint); 36a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 37a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void loadTile(int position, int scrollHint); 38a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 39a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev void recycleTile(TileList.Tile<T> tile); 40a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev } 41a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 42a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev MainThreadCallback<T> getMainThreadProxy(MainThreadCallback<T> callback); 43a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev 44a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev BackgroundCallback<T> getBackgroundProxy(BackgroundCallback<T> callback); 45a1470623b0f7c52c9e3985012bf9daeb692d7bccVladislav Kaznacheev} 46