• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 package com.example.android.leanback;
15 
16 import android.content.Context;
17 import android.graphics.drawable.Drawable;
18 import android.support.v17.leanback.widget.SearchOrbView;
19 import android.util.AttributeSet;
20 import android.view.View;
21 import android.widget.LinearLayout;
22 import android.support.v17.leanback.widget.TitleViewAdapter;
23 
24 public class CustomTitleView extends LinearLayout implements TitleViewAdapter.Provider {
25 
26     private final TitleViewAdapter mTitleViewAdapter = new TitleViewAdapter() {
27         @Override
28         public View getSearchAffordanceView() {
29             return null;
30         }
31 
32         @Override
33         public void setOnSearchClickedListener(View.OnClickListener listener) {
34         }
35 
36         @Override
37         public void setAnimationEnabled(boolean enable) {
38         }
39 
40         @Override
41         public Drawable getBadgeDrawable() {
42             return null;
43         }
44 
45         @Override
46         public SearchOrbView.Colors getSearchAffordanceColors() {
47             return null;
48         }
49 
50         @Override
51         public CharSequence getTitle() {
52             return null;
53         }
54 
55         @Override
56         public void setBadgeDrawable(Drawable drawable) {
57         }
58 
59         @Override
60         public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
61         }
62 
63         @Override
64         public void setTitle(CharSequence titleText) {
65         }
66 
67         @Override
68         public void updateComponentsVisibility(int flags) {
69         }
70     };
71 
CustomTitleView(Context context)72     public CustomTitleView(Context context) {
73         this(context, null);
74     }
75 
CustomTitleView(Context context, AttributeSet attrs)76     public CustomTitleView(Context context, AttributeSet attrs) {
77         this(context, attrs, 0);
78     }
79 
CustomTitleView(Context context, AttributeSet attrs, int defStyleAttr)80     public CustomTitleView(Context context, AttributeSet attrs, int defStyleAttr) {
81         super(context, attrs, defStyleAttr);
82     }
83 
84     @Override
getTitleViewAdapter()85     public TitleViewAdapter getTitleViewAdapter() {
86         return mTitleViewAdapter;
87     }
88 }
89