Loading packages/SystemUI/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ <activity android:name=".media.MediaProjectionPermissionActivity" android:exported="true" android:theme="@style/Theme.AlertDialogHost" android:theme="@style/Theme.MediaProjectionAlertDialog" android:finishOnCloseSystemDialogs="true" android:launchMode="singleTop" android:excludeFromRecents="true" Loading packages/SystemUI/res/layout/media_projection_dialog_title.xml 0 → 100644 +39 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2019, 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. --> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" android:theme="@style/Theme.MediaProjectionAlertDialog" android:paddingStart="?android:attr/dialogPreferredPadding" android:paddingEnd="?android:attr/dialogPreferredPadding" android:paddingTop="?android:attr/dialogPreferredPadding"> <ImageView android:id="@+id/dialog_icon" android:src="@drawable/ic_media_projection_permission" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginBottom="20dp" android:layout_centerInParent="true"/> <TextView android:id="@+id/dialog_title" android:gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/dialog_icon" android:textColor="?android:attr/colorPrimary" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title" /> </RelativeLayout> packages/SystemUI/res/values/styles.xml +2 −2 Original line number Diff line number Diff line Loading @@ -353,13 +353,13 @@ <style name="AutoSizingList"> <item name="enableAutoSizing">true</item> </style> <style name="Theme.AlertDialogHost" parent="android:Theme.DeviceDefault"> <style name="Theme.MediaProjectionAlertDialog" parent="android:Theme.DeviceDefault"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">false</item> <item name="android:backgroundDimEnabled">true</item> <item name="android:alertDialogTheme">@style/Theme.SystemUI.Dialog.Alert</item> </style> Loading packages/SystemUI/src/com/android/systemui/media/MediaProjectionPermissionActivity.java +7 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,10 @@ import android.text.TextPaint; import android.text.TextUtils; import android.text.style.StyleSpan; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; import com.android.systemui.R; Loading Loading @@ -133,9 +135,12 @@ public class MediaProjectionPermissionActivity extends Activity String dialogTitle = getString(R.string.media_projection_dialog_title, appName); View dialogTitleView = View.inflate(this, R.layout.media_projection_dialog_title, null); TextView titleText = (TextView) dialogTitleView.findViewById(R.id.dialog_title); titleText.setText(dialogTitle); mDialog = new AlertDialog.Builder(this) .setTitle(dialogTitle) .setIcon(R.drawable.ic_media_projection_permission) .setCustomTitle(dialogTitleView) .setMessage(message) .setPositiveButton(R.string.media_projection_action_text, this) .setNegativeButton(android.R.string.cancel, this) Loading Loading
packages/SystemUI/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ <activity android:name=".media.MediaProjectionPermissionActivity" android:exported="true" android:theme="@style/Theme.AlertDialogHost" android:theme="@style/Theme.MediaProjectionAlertDialog" android:finishOnCloseSystemDialogs="true" android:launchMode="singleTop" android:excludeFromRecents="true" Loading
packages/SystemUI/res/layout/media_projection_dialog_title.xml 0 → 100644 +39 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2019, 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. --> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" android:theme="@style/Theme.MediaProjectionAlertDialog" android:paddingStart="?android:attr/dialogPreferredPadding" android:paddingEnd="?android:attr/dialogPreferredPadding" android:paddingTop="?android:attr/dialogPreferredPadding"> <ImageView android:id="@+id/dialog_icon" android:src="@drawable/ic_media_projection_permission" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginBottom="20dp" android:layout_centerInParent="true"/> <TextView android:id="@+id/dialog_title" android:gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/dialog_icon" android:textColor="?android:attr/colorPrimary" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title" /> </RelativeLayout>
packages/SystemUI/res/values/styles.xml +2 −2 Original line number Diff line number Diff line Loading @@ -353,13 +353,13 @@ <style name="AutoSizingList"> <item name="enableAutoSizing">true</item> </style> <style name="Theme.AlertDialogHost" parent="android:Theme.DeviceDefault"> <style name="Theme.MediaProjectionAlertDialog" parent="android:Theme.DeviceDefault"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">false</item> <item name="android:backgroundDimEnabled">true</item> <item name="android:alertDialogTheme">@style/Theme.SystemUI.Dialog.Alert</item> </style> Loading
packages/SystemUI/src/com/android/systemui/media/MediaProjectionPermissionActivity.java +7 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,10 @@ import android.text.TextPaint; import android.text.TextUtils; import android.text.style.StyleSpan; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; import com.android.systemui.R; Loading Loading @@ -133,9 +135,12 @@ public class MediaProjectionPermissionActivity extends Activity String dialogTitle = getString(R.string.media_projection_dialog_title, appName); View dialogTitleView = View.inflate(this, R.layout.media_projection_dialog_title, null); TextView titleText = (TextView) dialogTitleView.findViewById(R.id.dialog_title); titleText.setText(dialogTitle); mDialog = new AlertDialog.Builder(this) .setTitle(dialogTitle) .setIcon(R.drawable.ic_media_projection_permission) .setCustomTitle(dialogTitleView) .setMessage(message) .setPositiveButton(R.string.media_projection_action_text, this) .setNegativeButton(android.R.string.cancel, this) Loading