Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 1 | /* |
| 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 | |
Winson | bf8c2c0 | 2016-10-18 18:56:24 -0700 | [diff] [blame] | 17 | package com.android.systemui.pip.tv; |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 18 | |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 19 | import android.content.Context; |
Gus Prevas | ab33679 | 2018-11-14 13:52:20 -0500 | [diff] [blame] | 20 | import android.util.AttributeSet; |
Jaewan Kim | a0d4d25 | 2016-03-31 13:37:10 +0900 | [diff] [blame] | 21 | import android.view.Gravity; |
| 22 | import android.view.LayoutInflater; |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 23 | import android.widget.LinearLayout; |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 24 | |
| 25 | import com.android.systemui.R; |
| 26 | |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 27 | |
| 28 | /** |
| 29 | * A view containing PIP controls including fullscreen, close, and media controls. |
| 30 | */ |
Jaewan Kim | a0d4d25 | 2016-03-31 13:37:10 +0900 | [diff] [blame] | 31 | public class PipControlsView extends LinearLayout { |
Winson Chung | b6de872 | 2017-06-02 12:45:51 -0700 | [diff] [blame] | 32 | |
Sergey Nikolaienkov | c44db4e | 2020-04-07 15:16:08 +0200 | [diff] [blame] | 33 | 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 Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 41 | public PipControlsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { |
| 42 | super(context, attrs, defStyleAttr, defStyleRes); |
Dave Mankoff | f501914 | 2019-12-20 16:22:57 -0500 | [diff] [blame] | 43 | LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService( |
| 44 | Context.LAYOUT_INFLATER_SERVICE); |
| 45 | layoutInflater.inflate(R.layout.tv_pip_controls, this); |
Jaewan Kim | a0d4d25 | 2016-03-31 13:37:10 +0900 | [diff] [blame] | 46 | setOrientation(LinearLayout.HORIZONTAL); |
| 47 | setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL); |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 48 | } |
| 49 | |
Dave Mankoff | f501914 | 2019-12-20 16:22:57 -0500 | [diff] [blame] | 50 | PipControlButtonView getFullButtonView() { |
| 51 | return findViewById(R.id.full_button); |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 52 | } |
| 53 | |
Dave Mankoff | f501914 | 2019-12-20 16:22:57 -0500 | [diff] [blame] | 54 | PipControlButtonView getCloseButtonView() { |
| 55 | return findViewById(R.id.close_button); |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 56 | } |
| 57 | |
Dave Mankoff | f501914 | 2019-12-20 16:22:57 -0500 | [diff] [blame] | 58 | PipControlButtonView getPlayPauseButtonView() { |
| 59 | return findViewById(R.id.play_pause_button); |
Jaewan Kim | a9e0621 | 2016-05-16 22:06:46 +0900 | [diff] [blame] | 60 | } |
Jaewan Kim | 8f584b8 | 2016-03-22 22:16:59 +0900 | [diff] [blame] | 61 | } |