• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 
17 package com.android.tv.settings.about;
18 
19 import android.content.Context;
20 import android.util.AttributeSet;
21 
22 import androidx.preference.DialogPreference;
23 
24 import com.android.tv.settings.R;
25 
26 /**
27  * Implementation of {@link DialogPreference} to show the consumer information
28  * {@link androidx.preference.Preference Preference}.
29  */
30 public class ConsumerInformationDialogPreference extends DialogPreference {
ConsumerInformationDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)31     public ConsumerInformationDialogPreference(Context context, AttributeSet attrs,
32             int defStyleAttr, int defStyleRes) {
33         super(context, attrs, defStyleAttr, defStyleRes);
34     }
35 
ConsumerInformationDialogPreference(Context context, AttributeSet attrs, int defStyleAttr)36     public ConsumerInformationDialogPreference(Context context, AttributeSet attrs,
37             int defStyleAttr) {
38         super(context, attrs, defStyleAttr);
39     }
40 
ConsumerInformationDialogPreference(Context context, AttributeSet attrs)41     public ConsumerInformationDialogPreference(Context context, AttributeSet attrs) {
42         super(context, attrs);
43     }
44 
ConsumerInformationDialogPreference(Context context)45     public ConsumerInformationDialogPreference(Context context) {
46         super(context);
47     }
48 
49     @Override
getDialogMessage()50     public CharSequence getDialogMessage() {
51         return getContext().getString(R.string.consumer_information_message);
52     }
53 
54     @Override
getPositiveButtonText()55     public CharSequence getPositiveButtonText() {
56         return getContext().getString(R.string.consumer_information_button_ok);
57     }
58 }
59