Remove dependency on ChooserActivity resources

Fork the needed resources.

Bug: 292222314
Test: mp sysuig, view wifi QR code screen
Change-Id: I69fabb8c293e8e8819d93a61df39549b9667c0fa
This commit is contained in:
Matt Casey
2023-07-31 14:16:43 +00:00
parent 72d72142f0
commit 9a7ed87222
4 changed files with 71 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2023 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
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:color="?android:attr/colorControlHighlight">
<item>
<inset
android:insetLeft="0dp"
android:insetTop="8dp"
android:insetRight="0dp"
android:insetBottom="8dp">
<shape android:shape="rectangle">
<corners android:radius="8dp" />
<stroke android:width="1dp"
android:color="?androidprv:attr/colorAccentPrimaryVariant"/>
</shape>
</inset>
</item>
</ripple>

View File

@@ -0,0 +1,32 @@
<!--
~ Copyright (C) 2023 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
-->
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center_vertical|start"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:drawablePadding="8dp"
android:textColor="?android:attr/textColorPrimary"
android:textSize="12sp"
android:maxWidth="192dp"
android:singleLine="true"
android:clickable="true"
android:background="@drawable/action_button_bg"
android:drawableTint="?android:attr/textColorPrimary"
android:drawableTintMode="src_in"
style="?android:attr/borderlessButtonStyle"
/>

View File

@@ -406,6 +406,9 @@
<!-- Margin for SD card setup completion Image --> <!-- Margin for SD card setup completion Image -->
<dimen name="setup_completion_margin_top">88dp</dimen> <dimen name="setup_completion_margin_top">88dp</dimen>
<!-- QR code action button -->
<dimen name="action_button_icon_size">18dp</dimen>
<!-- Biometrics Face enroll education dimensions--> <!-- Biometrics Face enroll education dimensions-->
<dimen name="face_enroll_icon_large_width">300dp</dimen> <dimen name="face_enroll_icon_large_width">300dp</dimen>
<dimen name="face_enroll_icon_large_height">300dp</dimen> <dimen name="face_enroll_icon_large_height">300dp</dimen>

View File

@@ -223,11 +223,9 @@ public class WifiDppQrCodeGeneratorFragment extends WifiDppQrCodeBaseFragment {
private Button createActionButton(Drawable icon, CharSequence title, View.OnClickListener r) { private Button createActionButton(Drawable icon, CharSequence title, View.OnClickListener r) {
final Button b = (Button) LayoutInflater.from(getContext()).inflate( final Button b = (Button) LayoutInflater.from(getContext()).inflate(
com.android.internal.R.layout.chooser_action_button, null); R.layout.action_button, null);
if (icon != null) { if (icon != null) {
final int size = getResources() final int size = getResources().getDimensionPixelSize(R.dimen.action_button_icon_size);
.getDimensionPixelSize(
com.android.internal.R.dimen.chooser_action_button_icon_size);
icon.setBounds(0, 0, size, size); icon.setBounds(0, 0, size, size);
b.setCompoundDrawablesRelative(icon, null, null, null); b.setCompoundDrawablesRelative(icon, null, null, null);
} }