blob: 10d189c6568cd0c29753aa716600b388776dea02 [file] [log] [blame]
Chiao Chenga953aa72012-12-04 17:04:48 -08001/*
2 * Copyright (C) 2012 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.list;
18
19import android.net.Uri;
20import android.util.Log;
21
Chiao Chenga953aa72012-12-04 17:04:48 -080022/**
23 * Version of PhoneNumberPickerFragment used specifically for legacy support.
24 */
25public class LegacyPhoneNumberPickerFragment extends PhoneNumberPickerFragment {
26
27 private static final String TAG = LegacyPhoneNumberPickerFragment.class.getSimpleName();
28
29 @Override
30 protected boolean getVisibleScrollbarEnabled() {
31 return false;
32 }
33
34 @Override
35 protected Uri getPhoneUri(int position) {
36 final LegacyPhoneNumberListAdapter adapter = (LegacyPhoneNumberListAdapter) getAdapter();
37 return adapter.getPhoneUri(position);
38 }
39
40 @Override
Brian Attwelle48aefc2015-05-04 22:33:54 -070041 protected String getLookupKey(int position) {
42 // There is no lookup key for the legacy adapter.
43 return null;
44 }
45
46 @Override
Chiao Chenga953aa72012-12-04 17:04:48 -080047 protected ContactEntryListAdapter createListAdapter() {
48 LegacyPhoneNumberListAdapter adapter = new LegacyPhoneNumberListAdapter(getActivity());
49 adapter.setDisplayPhotos(true);
50 return adapter;
51 }
52
53 @Override
54 protected void setPhotoPosition(ContactEntryListAdapter adapter) {
55 // no-op
56 }
57
58 @Override
Tyler Gunn0a8f9732015-12-15 15:38:54 -080059 protected void startPhoneNumberShortcutIntent(Uri uri, boolean isVideoCall) {
Chiao Chenga953aa72012-12-04 17:04:48 -080060 throw new UnsupportedOperationException();
61 }
62
63 @Override
64 public void setPhotoPosition(ContactListItemView.PhotoPosition photoPosition) {
65 Log.w(TAG, "setPhotoPosition() is ignored in legacy compatibility mode.");
66 }
67}