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