1 /* 2 * Copyright (C) 2015 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.menu; 18 19 import android.content.Context; 20 21 import com.android.tv.R; 22 import com.android.tv.TimeShiftManager; 23 24 public class PlayControlsRow extends MenuRow { 25 public static final String ID = PlayControlsRow.class.getName(); 26 27 private final TimeShiftManager mTimeShiftManager; 28 PlayControlsRow(Context context, Menu menu, TimeShiftManager timeShiftManager)29 public PlayControlsRow(Context context, Menu menu, TimeShiftManager timeShiftManager) { 30 super(context, menu, R.string.menu_title_play_controls, R.dimen.play_controls_height); 31 mTimeShiftManager = timeShiftManager; 32 } 33 34 @Override update()35 public void update() { 36 } 37 38 @Override getLayoutResId()39 public int getLayoutResId() { 40 return R.layout.play_controls; 41 } 42 43 /** 44 * Returns an instance of {@link TimeShiftManager}. 45 */ getTimeShiftManager()46 public TimeShiftManager getTimeShiftManager() { 47 return mTimeShiftManager; 48 } 49 50 @Override getId()51 public String getId() { 52 return ID; 53 } 54 55 @Override isVisible()56 public boolean isVisible() { 57 return mTimeShiftManager.isAvailable(); 58 } 59 60 @Override hideTitleWhenSelected()61 public boolean hideTitleWhenSelected() { 62 return true; 63 } 64 } 65