blob: 8efeef1ffa0a45963402ca19855cb3a20491966e [file] [log] [blame]
Jaewan Kim8f584b82016-03-22 22:16:59 +09001/*
2 * Copyright (C) 2016 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
Winsonbf8c2c02016-10-18 18:56:24 -070017package com.android.systemui.pip.tv;
Jaewan Kim8f584b82016-03-22 22:16:59 +090018
Jaewan Kim8f584b82016-03-22 22:16:59 +090019import android.content.Context;
Gus Prevasab336792018-11-14 13:52:20 -050020import android.util.AttributeSet;
Jaewan Kima0d4d252016-03-31 13:37:10 +090021import android.view.Gravity;
22import android.view.LayoutInflater;
Jaewan Kim8f584b82016-03-22 22:16:59 +090023import android.widget.LinearLayout;
Jaewan Kim8f584b82016-03-22 22:16:59 +090024
25import com.android.systemui.R;
26
Jaewan Kim8f584b82016-03-22 22:16:59 +090027
28/**
29 * A view containing PIP controls including fullscreen, close, and media controls.
30 */
Jaewan Kima0d4d252016-03-31 13:37:10 +090031public class PipControlsView extends LinearLayout {
Winson Chungb6de8722017-06-02 12:45:51 -070032
Sergey Nikolaienkovc44db4e2020-04-07 15:16:08 +020033 public PipControlsView(Context context, AttributeSet attrs) {
34 this(context, attrs, 0);
35 }
36
37 public PipControlsView(Context context, AttributeSet attrs, int defStyleAttr) {
38 this(context, attrs, defStyleAttr, 0);
39 }
40
Jaewan Kim8f584b82016-03-22 22:16:59 +090041 public PipControlsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
42 super(context, attrs, defStyleAttr, defStyleRes);
Dave Mankofff5019142019-12-20 16:22:57 -050043 LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(
44 Context.LAYOUT_INFLATER_SERVICE);
45 layoutInflater.inflate(R.layout.tv_pip_controls, this);
Jaewan Kima0d4d252016-03-31 13:37:10 +090046 setOrientation(LinearLayout.HORIZONTAL);
47 setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
Jaewan Kim8f584b82016-03-22 22:16:59 +090048 }
49
Dave Mankofff5019142019-12-20 16:22:57 -050050 PipControlButtonView getFullButtonView() {
51 return findViewById(R.id.full_button);
Jaewan Kim8f584b82016-03-22 22:16:59 +090052 }
53
Dave Mankofff5019142019-12-20 16:22:57 -050054 PipControlButtonView getCloseButtonView() {
55 return findViewById(R.id.close_button);
Jaewan Kim8f584b82016-03-22 22:16:59 +090056 }
57
Dave Mankofff5019142019-12-20 16:22:57 -050058 PipControlButtonView getPlayPauseButtonView() {
59 return findViewById(R.id.play_pause_button);
Jaewan Kima9e06212016-05-16 22:06:46 +090060 }
Jaewan Kim8f584b82016-03-22 22:16:59 +090061}