1132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood/*
2132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * Copyright (C) 2010 The Android Open Source Project
3132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood *
4132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * Licensed under the Apache License, Version 2.0 (the "License");
5132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * you may not use this file except in compliance with the License.
6132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * You may obtain a copy of the License at
7132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood *
8132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood *      http://www.apache.org/licenses/LICENSE-2.0
9132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood *
10132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * Unless required by applicable law or agreed to in writing, software
11132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * distributed under the License is distributed on an "AS IS" BASIS,
12132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * See the License for the specific language governing permissions and
14132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * limitations under the License.
15132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood */
16132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
17132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwoodpackage com.android.quicksearchbox;
18132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
19132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
20132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood/**
21132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood * Mock for {@link TextAppearanceFactory}.
22132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood */
23132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwoodpublic class MockTextAppearanceFactory extends TextAppearanceFactory {
24132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
25132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public static final int ID_QUERY_TEXT = 0;
26132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public static final int ID_SUGGESTED_TEXT = 1;
27132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
28132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public MockTextAppearanceFactory() {
29132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        super(null);
30132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    }
31132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
32132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    @Override
33132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public Object[] createSuggestionQueryTextAppearance() {
34132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        return new Object[]{
35132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood                new MockStyleSpan(ID_QUERY_TEXT)
36132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        };
37132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    }
38132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
39132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    @Override
40132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public Object[] createSuggestionSuggestedTextAppearance() {
41132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        return new Object[]{
42132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood                new MockStyleSpan(ID_SUGGESTED_TEXT),
43132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        };
44132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    }
45132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
46132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    public static class MockStyleSpan {
47132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        private final int mId;
48132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        public MockStyleSpan(int id) {
49132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood            mId = id;
50132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        }
51132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        public int getId() {
52132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood            return mId;
53132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood        }
54132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood    }
55132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood
56132a8afcb4970d1b783a6dba7944dc0dd5063101Mathew Inwood}
57