1 // CHECKSTYLE:OFF Generated code 2 /* This file is auto-generated from PlaybackOverlayActivity.java. DO NOT MODIFY. */ 3 4 /* 5 * Copyright (C) 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 8 * in compliance with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software distributed under the License 13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 * or implied. See the License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 package com.example.android.leanback; 18 19 import android.support.v4.app.FragmentActivity; 20 import android.os.Bundle; 21 22 import java.util.ArrayList; 23 import java.util.List; 24 25 public class PlaybackOverlaySupportActivity extends FragmentActivity { 26 private List<PictureInPictureListener> mListeners = new ArrayList<>(); 27 28 /** Called when the activity is first created. */ 29 @Override onCreate(Bundle savedInstanceState)30 public void onCreate(Bundle savedInstanceState) 31 { 32 super.onCreate(savedInstanceState); 33 setContentView(R.layout.playback_controls_support); 34 } 35 36 @Override onPictureInPictureModeChanged(boolean isInPictureInPictureMode)37 public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) { 38 for (PictureInPictureListener listener : mListeners) { 39 listener.onPictureInPictureModeChanged(isInPictureInPictureMode); 40 } 41 } 42 registerPictureInPictureListener(PictureInPictureListener listener)43 public void registerPictureInPictureListener(PictureInPictureListener listener) { 44 mListeners.add(listener); 45 } 46 unregisterPictureInPictureListener(PictureInPictureListener listener)47 public void unregisterPictureInPictureListener(PictureInPictureListener listener) { 48 mListeners.remove(listener); 49 } 50 51 public interface PictureInPictureListener { onPictureInPictureModeChanged(boolean isInPictureInPictureMode)52 void onPictureInPictureModeChanged(boolean isInPictureInPictureMode); 53 } 54 } 55