12644d947574240b71c427d457f7a775dc160ec09Yorke Lee/* 22644d947574240b71c427d457f7a775dc160ec09Yorke Lee * Copyright (C) 2011 The Android Open Source Project 32644d947574240b71c427d457f7a775dc160ec09Yorke Lee * 42644d947574240b71c427d457f7a775dc160ec09Yorke Lee * Licensed under the Apache License, Version 2.0 (the "License"); 52644d947574240b71c427d457f7a775dc160ec09Yorke Lee * you may not use this file except in compliance with the License. 62644d947574240b71c427d457f7a775dc160ec09Yorke Lee * You may obtain a copy of the License at 72644d947574240b71c427d457f7a775dc160ec09Yorke Lee * 82644d947574240b71c427d457f7a775dc160ec09Yorke Lee * http://www.apache.org/licenses/LICENSE-2.0 92644d947574240b71c427d457f7a775dc160ec09Yorke Lee * 102644d947574240b71c427d457f7a775dc160ec09Yorke Lee * Unless required by applicable law or agreed to in writing, software 112644d947574240b71c427d457f7a775dc160ec09Yorke Lee * distributed under the License is distributed on an "AS IS" BASIS, 122644d947574240b71c427d457f7a775dc160ec09Yorke Lee * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 132644d947574240b71c427d457f7a775dc160ec09Yorke Lee * See the License for the specific language governing permissions and 142644d947574240b71c427d457f7a775dc160ec09Yorke Lee * limitations under the License. 152644d947574240b71c427d457f7a775dc160ec09Yorke Lee */ 162644d947574240b71c427d457f7a775dc160ec09Yorke Lee 170a49afa2ad697307cc04ef4cb86570574fa720f2Gary Maipackage com.android.contacts.test.mocks; 182644d947574240b71c427d457f7a775dc160ec09Yorke Lee 192644d947574240b71c427d457f7a775dc160ec09Yorke Leeimport android.graphics.Bitmap; 202644d947574240b71c427d457f7a775dc160ec09Yorke Leeimport android.net.Uri; 21b92b637873ce501abce1d4d5cb4ce8f949a5e4fdBrian Attwellimport android.view.View; 222644d947574240b71c427d457f7a775dc160ec09Yorke Leeimport android.widget.ImageView; 232644d947574240b71c427d457f7a775dc160ec09Yorke Lee 240a49afa2ad697307cc04ef4cb86570574fa720f2Gary Maiimport com.android.contacts.ContactPhotoManager; 252644d947574240b71c427d457f7a775dc160ec09Yorke Lee 262644d947574240b71c427d457f7a775dc160ec09Yorke Lee/** 272644d947574240b71c427d457f7a775dc160ec09Yorke Lee * A photo preloader that always uses the "no contact" picture and never executes any real 282644d947574240b71c427d457f7a775dc160ec09Yorke Lee * db queries 292644d947574240b71c427d457f7a775dc160ec09Yorke Lee */ 302644d947574240b71c427d457f7a775dc160ec09Yorke Leepublic class MockContactPhotoManager extends ContactPhotoManager { 312644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 32c4a2a23bda2fdbbf9de43ffca7948bb7721a9e50Yorke Lee public void loadThumbnail(ImageView view, long photoId, boolean darkTheme, boolean isCircular, 339df5e19332197900e8af8c5349a614be9b6c032aYorke Lee DefaultImageRequest defaultImageRequest, DefaultImageProvider defaultProvider) { 349df5e19332197900e8af8c5349a614be9b6c032aYorke Lee defaultProvider.applyDefaultImage(view, -1, darkTheme, null); 352644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 362644d947574240b71c427d457f7a775dc160ec09Yorke Lee 372644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 382644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void loadPhoto(ImageView view, Uri photoUri, int requestedExtent, boolean darkTheme, 39c4a2a23bda2fdbbf9de43ffca7948bb7721a9e50Yorke Lee boolean isCircular, DefaultImageRequest defaultImageRequest, 40c4a2a23bda2fdbbf9de43ffca7948bb7721a9e50Yorke Lee DefaultImageProvider defaultProvider) { 419df5e19332197900e8af8c5349a614be9b6c032aYorke Lee defaultProvider.applyDefaultImage(view, requestedExtent, darkTheme, null); 422644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 432644d947574240b71c427d457f7a775dc160ec09Yorke Lee 442644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 452644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void removePhoto(ImageView view) { 462644d947574240b71c427d457f7a775dc160ec09Yorke Lee view.setImageDrawable(null); 472644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 482644d947574240b71c427d457f7a775dc160ec09Yorke Lee 492644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 50b92b637873ce501abce1d4d5cb4ce8f949a5e4fdBrian Attwell public void cancelPendingRequests(View fragmentRootView) { 51232df2f3b2f34455928c0f163b56f12dd55132b3Tyler Gunn } 52232df2f3b2f34455928c0f163b56f12dd55132b3Tyler Gunn 53232df2f3b2f34455928c0f163b56f12dd55132b3Tyler Gunn @Override 542644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void pause() { 552644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 562644d947574240b71c427d457f7a775dc160ec09Yorke Lee 572644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 582644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void resume() { 592644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 602644d947574240b71c427d457f7a775dc160ec09Yorke Lee 612644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 622644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void refreshCache() { 632644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 642644d947574240b71c427d457f7a775dc160ec09Yorke Lee 652644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 662644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void cacheBitmap(Uri photoUri, Bitmap bitmap, byte[] photoBytes) { 672644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 682644d947574240b71c427d457f7a775dc160ec09Yorke Lee 692644d947574240b71c427d457f7a775dc160ec09Yorke Lee @Override 702644d947574240b71c427d457f7a775dc160ec09Yorke Lee public void preloadPhotosInBackground() { 712644d947574240b71c427d457f7a775dc160ec09Yorke Lee } 722644d947574240b71c427d457f7a775dc160ec09Yorke Lee} 73