blob: c0138f0e200a2e4048839db63fd765f5a55f0236 [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.systemui.media.dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import androidx.core.graphics.drawable.IconCompat;
import com.android.systemui.R;
import javax.inject.Singleton;
/**
* Dialog for media output transferring.
*/
@Singleton
public class MediaOutputDialog extends MediaOutputBaseDialog {
MediaOutputDialog(Context context, boolean aboveStatusbar, MediaOutputController
mediaOutputController) {
super(context, mediaOutputController);
mAdapter = new MediaOutputAdapter(mMediaOutputController);
if (!aboveStatusbar) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
}
show();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
int getHeaderIconRes() {
return 0;
}
@Override
IconCompat getHeaderIcon() {
return mMediaOutputController.getHeaderIcon();
}
@Override
int getHeaderIconSize() {
return mContext.getResources().getDimensionPixelSize(
R.dimen.media_output_dialog_header_album_icon_size);
}
@Override
CharSequence getHeaderText() {
return mMediaOutputController.getHeaderTitle();
}
@Override
CharSequence getHeaderSubtitle() {
return mMediaOutputController.getHeaderSubTitle();
}
@Override
int getStopButtonVisibility() {
return mMediaOutputController.isActiveRemoteDevice(
mMediaOutputController.getCurrentConnectedMediaDevice()) ? View.VISIBLE : View.GONE;
}
}