1c5afb16430a145f20d7c887e45f47b38687054daMarc Blank/*
2c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Copyright (C) 2011 The Android Open Source Project
3c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
4c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Licensed under the Apache License, Version 2.0 (the "License");
5c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * you may not use this file except in compliance with the License.
6c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * You may obtain a copy of the License at
7c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
8c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *      http://www.apache.org/licenses/LICENSE-2.0
9c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
10c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Unless required by applicable law or agreed to in writing, software
11c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * distributed under the License is distributed on an "AS IS" BASIS,
12c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * See the License for the specific language governing permissions and
14c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * limitations under the License.
15c5afb16430a145f20d7c887e45f47b38687054daMarc Blank */
16c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
17c5afb16430a145f20d7c887e45f47b38687054daMarc Blankpackage com.android.email.activity.setup;
18c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
19c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.content.Context;
20c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.preference.Preference;
21c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.util.AttributeSet;
22c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.view.View;
23c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.widget.TextView;
24c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
25c5afb16430a145f20d7c887e45f47b38687054daMarc Blank/**
26c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Simple text preference allowing a large number of lines
27c5afb16430a145f20d7c887e45f47b38687054daMarc Blank */
28c5afb16430a145f20d7c887e45f47b38687054daMarc Blankpublic class PolicyListPreference extends Preference {
29c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    // Arbitrary, but large number (we don't, and won't, have nearly this many)
30c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    public static final int MAX_POLICIES = 24;
31c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
32c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    public PolicyListPreference(Context ctx, AttributeSet attrs, int defStyle) {
33c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        super(ctx, attrs, defStyle);
34c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
35c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
36c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    public PolicyListPreference(Context ctx, AttributeSet attrs) {
37c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        super(ctx, attrs);
38c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
39c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
40c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    @Override
41c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    protected void onBindView(View view) {
42c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        super.onBindView(view);
43c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        ((TextView)view.findViewById(android.R.id.summary)).setMaxLines(MAX_POLICIES);
44c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
45c5afb16430a145f20d7c887e45f47b38687054daMarc Blank}
46