blob: db8f06f25ee30aab2c2c4d248b6261ebd13cce6d [file] [log] [blame]
Yorke Lee2644d942013-10-28 11:05:43 -07001/*
2 * Copyright (C) 2011 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.contacts.common.test.mocks;
18
19import android.graphics.Bitmap;
20import android.net.Uri;
Brian Attwellb92b6372014-07-21 23:39:35 -070021import android.view.View;
Yorke Lee2644d942013-10-28 11:05:43 -070022import android.widget.ImageView;
23
24import com.android.contacts.common.ContactPhotoManager;
25
26/**
27 * A photo preloader that always uses the "no contact" picture and never executes any real
28 * db queries
29 */
30public class MockContactPhotoManager extends ContactPhotoManager {
31 @Override
Yorke Leec4a2a232014-04-28 17:53:42 -070032 public void loadThumbnail(ImageView view, long photoId, boolean darkTheme, boolean isCircular,
Yorke Lee9df5e192014-02-12 14:58:25 -080033 DefaultImageRequest defaultImageRequest, DefaultImageProvider defaultProvider) {
34 defaultProvider.applyDefaultImage(view, -1, darkTheme, null);
Yorke Lee2644d942013-10-28 11:05:43 -070035 }
36
37 @Override
38 public void loadPhoto(ImageView view, Uri photoUri, int requestedExtent, boolean darkTheme,
Yorke Leec4a2a232014-04-28 17:53:42 -070039 boolean isCircular, DefaultImageRequest defaultImageRequest,
40 DefaultImageProvider defaultProvider) {
Yorke Lee9df5e192014-02-12 14:58:25 -080041 defaultProvider.applyDefaultImage(view, requestedExtent, darkTheme, null);
Yorke Lee2644d942013-10-28 11:05:43 -070042 }
43
44 @Override
45 public void removePhoto(ImageView view) {
46 view.setImageDrawable(null);
47 }
48
49 @Override
Brian Attwellb92b6372014-07-21 23:39:35 -070050 public void cancelPendingRequests(View fragmentRootView) {
Tyler Gunn232df2f2014-04-15 15:30:58 -070051 }
52
53 @Override
Yorke Lee2644d942013-10-28 11:05:43 -070054 public void pause() {
55 }
56
57 @Override
58 public void resume() {
59 }
60
61 @Override
62 public void refreshCache() {
63 }
64
65 @Override
66 public void cacheBitmap(Uri photoUri, Bitmap bitmap, byte[] photoBytes) {
67 }
68
69 @Override
70 public void preloadPhotosInBackground() {
71 }
72}