Merge "Move SettingsLib icons to android."

This commit is contained in:
TreeHugger Robot
2019-01-28 22:49:36 +00:00
committed by Android (Google) Code Review
19 changed files with 26 additions and 53 deletions

View File

@@ -1825,7 +1825,7 @@
<activity
android:name="Settings$PrintSettingsActivity"
android:label="@string/print_settings"
android:icon="@drawable/ic_settings_print"
android:icon="@*android:drawable/ic_settings_print"
android:parentActivityName="Settings">
<intent-filter android:priority="1">
<action android:name="android.settings.ACTION_PRINT_SETTINGS" />

View File

@@ -19,6 +19,6 @@
<item android:state_checked="true" android:drawable="@drawable/ic_expand_less" />
<item android:drawable="@drawable/ic_expand_more" />
<item android:drawable="@*android:drawable/ic_expand_more" />
</selector>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000000"
android:pathData="M8.12 9.29L12 13.17l3.88-3.88a.996 .996 0 1 1 1.41 1.41l-4.59 4.59a.996 .996 0 0
1-1.41 0L6.7 10.7a.996 .996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z" />
</vector>

View File

@@ -22,7 +22,7 @@
android:id="@+id/switch_ime_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_lockscreen_ime"
android:src="@*android:drawable/ic_lockscreen_ime"
android:clickable="true"
android:contentDescription="@string/crypt_keeper_switch_input_method"
android:padding="@dimen/crypt_keeper_edit_text_ime_padding"

View File

@@ -45,7 +45,7 @@
android:paddingTop="@dimen/homepage_condition_header_indicator_padding_top"
android:paddingStart="@dimen/homepage_condition_header_indicator_padding_start"
android:paddingEnd="@dimen/homepage_condition_header_indicator_padding_end"
android:src="@drawable/ic_expand_more"/>
android:src="@*android:drawable/ic_expand_more"/>
</LinearLayout>

View File

@@ -298,7 +298,7 @@
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">?android:attr/colorAccent</item>
<item name="android:background">@drawable/btn_borderless_rect</item>
<item name="android:background">@*android:drawable/btn_borderless_rect</item>
<item name="android:gravity">center</item>
<item name="android:focusable">true</item>
<item name="android:padding">8dp</item>

View File

@@ -24,7 +24,7 @@
android:fragment="com.android.settings.connecteddevice.BluetoothDashboardFragment"
android:key="bluetooth_settings"
android:title="@string/bluetooth_settings_title"
android:icon="@drawable/ic_settings_bluetooth"
android:icon="@*android:drawable/ic_settings_bluetooth"
android:order="-9"
settings:searchable="false"/>
@@ -48,7 +48,7 @@
android:key="connected_device_printing"
android:title="@string/print_settings"
android:summary="@string/summary_placeholder"
android:icon="@drawable/ic_settings_print"
android:icon="@*android:drawable/ic_settings_print"
android:fragment="com.android.settings.print.PrintSettingsFragment"
android:order="-3"
settings:searchable="false"/>

View File

@@ -137,7 +137,7 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
MenuItem item = menu.add(0, EDIT_DEVICE_NAME_ITEM_ID, 0, R.string.bluetooth_rename_button);
item.setIcon(R.drawable.ic_mode_edit);
item.setIcon(com.android.internal.R.drawable.ic_mode_edit);
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
super.onCreateOptionsMenu(menu, inflater);
}

View File

@@ -73,7 +73,7 @@ public class BluetoothSliceBuilder {
final boolean isBluetoothEnabled = isBluetoothEnabled();
final CharSequence title = context.getText(R.string.bluetooth_settings);
final IconCompat icon = IconCompat.createWithResource(context,
R.drawable.ic_settings_bluetooth);
com.android.internal.R.drawable.ic_settings_bluetooth);
@ColorInt final int color = com.android.settings.Utils.getColorAccent(
context).getDefaultColor();
final PendingIntent toggleAction = getBroadcastIntent(context);

View File

@@ -157,7 +157,7 @@ public class BatteryEntry {
break;
case BLUETOOTH:
name = context.getResources().getString(R.string.power_bluetooth);
iconId = R.drawable.ic_settings_bluetooth;
iconId = com.android.internal.R.drawable.ic_settings_bluetooth;
break;
case SCREEN:
name = context.getResources().getString(R.string.power_screen);

View File

@@ -103,7 +103,7 @@ public class BluetoothDevicesSlice implements CustomSliceable {
@Override
public Slice getSlice() {
final IconCompat icon = IconCompat.createWithResource(mContext,
R.drawable.ic_settings_bluetooth);
com.android.internal.R.drawable.ic_settings_bluetooth);
final CharSequence title = mContext.getText(R.string.bluetooth_devices);
final CharSequence titleNoBluetoothDevices = mContext.getText(
R.string.no_bluetooth_devices);
@@ -236,7 +236,8 @@ public class BluetoothDevicesSlice implements CustomSliceable {
if (pair.first != null) {
return IconCompat.createWithBitmap(getBitmapFromVectorDrawable(pair.first));
} else {
return IconCompat.createWithResource(mContext, R.drawable.ic_settings_bluetooth);
return IconCompat.createWithResource(mContext,
com.android.internal.R.drawable.ic_settings_bluetooth);
}
}

View File

@@ -55,7 +55,7 @@ public class LocationSlice implements CustomSliceable {
@Override
public Slice getSlice() {
final IconCompat icon = IconCompat.createWithResource(mContext,
R.drawable.ic_signal_location);
com.android.internal.R.drawable.ic_signal_location);
final CharSequence title = mContext.getText(R.string.location_settings_title);
@ColorInt final int color = Utils.getColorAccentDefaultColor(mContext);
final PendingIntent primaryAction = getPrimaryAction();

View File

@@ -62,7 +62,7 @@ public class ZenRuleButtonsPreferenceController extends AbstractZenModePreferenc
if (isAvailable()) {
mButtonsPref = ((ActionButtonsPreference) screen.findPreference(KEY))
.setButton1Text(R.string.zen_mode_rule_name_edit)
.setButton1Icon(R.drawable.ic_mode_edit)
.setButton1Icon(com.android.internal.R.drawable.ic_mode_edit)
.setButton1OnClickListener(new EditRuleNameClickListener())
.setButton2Text(R.string.zen_mode_delete_rule_button)
.setButton2Icon(R.drawable.ic_settings_delete)

View File

@@ -344,7 +344,7 @@ public class EntityHeaderController {
if (mEditOnClickListener == null) {
button.setVisibility(View.GONE);
} else {
button.setImageResource(R.drawable.ic_mode_edit);
button.setImageResource(com.android.internal.R.drawable.ic_mode_edit);
button.setVisibility(View.VISIBLE);
button.setOnClickListener(mEditOnClickListener);
}

View File

@@ -101,7 +101,7 @@ public class WifiNetworkDetailsFragment extends DashboardFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
MenuItem item = menu.add(0, Menu.FIRST, 0, R.string.wifi_modify);
item.setIcon(R.drawable.ic_mode_edit);
item.setIcon(com.android.internal.R.drawable.ic_mode_edit);
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
super.onCreateOptionsMenu(menu, inflater);
}

View File

@@ -171,7 +171,8 @@ public class BluetoothDevicePreferenceTest {
.thenReturn(new BluetoothClass(BluetoothClass.Device.Major.IMAGING));
mPreference.onDeviceAttributesChanged();
DrawableTestHelper.assertDrawableResId(mPreference.getIcon(), R.drawable.ic_settings_print);
DrawableTestHelper.assertDrawableResId(mPreference.getIcon(),
com.android.internal.R.drawable.ic_settings_print);
}
@Test

View File

@@ -68,7 +68,7 @@ public class BluetoothSliceBuilderTest {
final SliceAction primaryAction = metadata.getPrimaryAction();
final IconCompat expectedToggleIcon = IconCompat.createWithResource(mContext,
R.drawable.ic_settings_bluetooth);
com.android.internal.R.drawable.ic_settings_bluetooth);
assertThat(primaryAction.getIcon().toString()).isEqualTo(expectedToggleIcon.toString());
}

View File

@@ -83,7 +83,8 @@ public class BluetoothDevicesSliceTest {
mBluetoothDevicesSlice = spy(new BluetoothDevicesSlice(mContext));
// Mock the icon and detail intent of Bluetooth.
mIcon = IconCompat.createWithResource(mContext, R.drawable.ic_settings_bluetooth);
mIcon = IconCompat.createWithResource(mContext,
com.android.internal.R.drawable.ic_settings_bluetooth);
mDetailIntent = PendingIntent.getActivity(mContext, 0, new Intent("test action"), 0);
doReturn(mIcon).when(mBluetoothDevicesSlice).getBluetoothDeviceIcon(any());
doReturn(mDetailIntent).when(mBluetoothDevicesSlice).getBluetoothDetailIntent(any());

View File

@@ -47,7 +47,7 @@ public class LocationSliceTest {
final SliceAction primaryAction = metadata.getPrimaryAction();
final IconCompat expectedToggleIcon = IconCompat.createWithResource(mContext,
R.drawable.ic_signal_location);
com.android.internal.R.drawable.ic_signal_location);
assertThat(primaryAction.getIcon().toString()).isEqualTo(expectedToggleIcon.toString());
}
}