• 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.compat;
18 
19 import android.content.Context;
20 import android.util.AttributeSet;
21 
22 import com.android.tv.settings.library.util.SliceUtils;
23 import com.android.tv.twopanelsettings.slices.SlicePreference;
24 
25 public class TsSlicePreference extends SlicePreference implements HasKeys {
26     private String[] mKeys;
TsSlicePreference(Context context, String[] keys, String uri)27     public TsSlicePreference(Context context, String[] keys, String uri) {
28         super(context);
29         mKeys = keys;
30         setFragment(SliceUtils.PATH_SLICE_FRAGMENT);
31         setUri(uri);
32     }
33 
TsSlicePreference(Context context, AttributeSet attrs)34     public TsSlicePreference(Context context, AttributeSet attrs) {
35         super(context, attrs);
36         init(attrs);
37         setKeys(new String[]{getKey()});
38     }
39 
40     @Override
setKeys(String[] keys)41     public void setKeys(String[] keys) {
42         mKeys = keys;
43     }
44 
45     @Override
getKeys()46     public String[] getKeys() {
47         return mKeys;
48     }
49 }
50