diff options
14 files changed, 175 insertions, 15 deletions
diff --git a/res/drawable/ic_settings_close.xml b/res/drawable/ic_settings_close.xml new file mode 100644 index 0000000000..058b4b5b2e --- /dev/null +++ b/res/drawable/ic_settings_close.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2018 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"> + <path + android:fillColor="#FF000000" + android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41z"/> +</vector> diff --git a/res/drawable/ic_settings_delete.xml b/res/drawable/ic_settings_delete.xml new file mode 100644 index 0000000000..10125acd49 --- /dev/null +++ b/res/drawable/ic_settings_delete.xml @@ -0,0 +1,31 @@ +<!-- + Copyright (C) 2018 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"> + <path + android:fillColor="#FF000000" + android:pathData="M15,4V3H9v1H4v2h1v13c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V6h1V4H15zM17,19H7V6h10V19z"/> + <path + android:fillColor="#FF000000" + android:pathData="M9,8h2v9h-2z"/> + <path + android:fillColor="#FF000000" + android:pathData="M13,8h2v9h-2z"/> +</vector> diff --git a/res/drawable/ic_settings_force_stop.xml b/res/drawable/ic_settings_force_stop.xml new file mode 100644 index 0000000000..eda6079c48 --- /dev/null +++ b/res/drawable/ic_settings_force_stop.xml @@ -0,0 +1,31 @@ +<!-- + Copyright (C) 2018 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"> + <path + android:fillColor="#FF000000" + android:pathData="M12,5.99L19.53,19H4.47L12,5.99M12,2L1,21h22L12,2L12,2z"/> + <path + android:fillColor="#FF000000" + android:pathData="M13,16l-2,0l0,2l2,0l0,-2z"/> + <path + android:fillColor="#FF000000" + android:pathData="M13,10l-2,0l0,4l2,0l0,-4z"/> +</vector> diff --git a/res/drawable/ic_settings_install.xml b/res/drawable/ic_settings_install.xml new file mode 100644 index 0000000000..5bd5e300ea --- /dev/null +++ b/res/drawable/ic_settings_install.xml @@ -0,0 +1,28 @@ +<!-- + Copyright (C) 2018 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"> + <path + android:fillColor="#FF000000" + android:pathData="M18,15v3H6v-3H4v3c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-3H18z"/> + <path + android:fillColor="#FF000000" + android:pathData="M17,11.5l-1.41,-1.41l-2.59,2.58l0,-8.67l-2,0l0,8.67l-2.59,-2.58l-1.41,1.41l5,5z"/> +</vector> diff --git a/res/drawable/ic_settings_open.xml b/res/drawable/ic_settings_open.xml new file mode 100644 index 0000000000..ea7771028b --- /dev/null +++ b/res/drawable/ic_settings_open.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2018 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"> + <path + android:fillColor="#FF000000" + android:pathData="M19,19H5V5h7V3H5C3.89,3 3,3.9 3,5v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2v-7h-2V19zM14,3v2h3.59l-9.83,9.83l1.41,1.41L19,6.41V10h2V3H14z"/> +</vector> diff --git a/res/values/strings.xml b/res/values/strings.xml index dbf2615e62..17eaa35da5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4002,8 +4002,6 @@ <string name="uninstall_all_users_text">Uninstall for all users</string> <!-- [CHAR LIMIT=NONE] Manage applications, individual application info screen, button label under Storage heading. Button to install an application for the user. --> <string name="install_text">Install</string> - <!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to disable an existing application. --> - <string name="disable_text">Disable</string> <!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to re-enable an existing application. --> <string name="enable_text">Enable</string> <!-- Manage applications, individual application info screen, button label under Storage heading. Button to clear all data associated with tis app (for example, remove all cached emails for an Email app) --> diff --git a/res/xml/app_info_settings.xml b/res/xml/app_info_settings.xml index 81afc1a11e..84ea14d34c 100644 --- a/res/xml/app_info_settings.xml +++ b/res/xml/app_info_settings.xml @@ -25,7 +25,8 @@ android:key="header_view" android:layout="@layout/settings_entity_header" android:selectable="false" - android:order="-10000" /> + android:order="-10000" + settings:allowDividerBelow="true"/> <com.android.settings.applications.LayoutPreference android:key="instant_app_buttons" @@ -40,7 +41,8 @@ <Preference android:key="notification_settings" android:title="@string/notifications_label" - settings:controller="com.android.settings.applications.appinfo.AppNotificationPreferenceController" /> + settings:controller="com.android.settings.applications.appinfo.AppNotificationPreferenceController" + settings:allowDividerAbove="true"/> <com.android.settings.widget.FixedLineSummaryPreference android:key="permission_settings" diff --git a/res/xml/bluetooth_device_details_fragment.xml b/res/xml/bluetooth_device_details_fragment.xml index c8f5c1b4ad..01114b6c54 100644 --- a/res/xml/bluetooth_device_details_fragment.xml +++ b/res/xml/bluetooth_device_details_fragment.xml @@ -16,12 +16,14 @@ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:settings="http://schemas.android.com/apk/res-auto" android:title="@string/device_details_title"> <com.android.settings.applications.LayoutPreference android:key="bluetooth_device_header" android:layout="@layout/settings_entity_header" - android:selectable="false"/> + android:selectable="false" + settings:allowDividerBelow="true"/> <com.android.settings.widget.ActionButtonPreference android:key="action_buttons" /> diff --git a/res/xml/wifi_network_details_fragment.xml b/res/xml/wifi_network_details_fragment.xml index 7c8d9a00aa..4198b76fb2 100644 --- a/res/xml/wifi_network_details_fragment.xml +++ b/res/xml/wifi_network_details_fragment.xml @@ -23,7 +23,8 @@ android:key="connection_header" android:layout="@layout/settings_entity_header" android:selectable="false" - android:order="-10000"/> + android:order="-10000" + settings:allowDividerBelow="true"/> <!-- Buttons --> <com.android.settings.widget.ActionButtonPreference diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java index c926da38a7..467b42e139 100644 --- a/src/com/android/settings/applications/AppStorageSettings.java +++ b/src/com/android/settings/applications/AppStorageSettings.java @@ -178,7 +178,9 @@ public class AppStorageSettings extends AppInfoWithHeader mChangeStorageButton.setOnClickListener(this); // Cache section - mButtonsPref.setButton2Text(R.string.clear_cache_btn_text); + mButtonsPref + .setButton2Text(R.string.clear_cache_btn_text) + .setButton2Icon(R.drawable.ic_settings_delete); // URI permissions section mUri = (PreferenceCategory) findPreference(KEY_URI_CATEGORY); @@ -304,16 +306,20 @@ public class AppStorageSettings extends AppInfoWithHeader || !isManageSpaceActivityAvailable) { mButtonsPref .setButton1Text(R.string.clear_user_data_text) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1Enabled(false); mCanClearData = false; } else { if (appHasSpaceManagementUI) { mButtonsPref.setButton1Text(R.string.manage_space_text); } else { - mButtonsPref.setButton1Text(R.string.clear_user_data_text); + mButtonsPref + .setButton1Text(R.string.clear_user_data_text) + .setButton1Icon(R.drawable.ic_settings_delete); } mButtonsPref .setButton1Text(R.string.clear_user_data_text) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1OnClickListener(v -> handleClearDataClick()); } @@ -384,7 +390,9 @@ public class AppStorageSettings extends AppInfoWithHeader private void processClearMsg(Message msg) { int result = msg.arg1; String packageName = mAppEntry.info.packageName; - mButtonsPref.setButton1Text(R.string.clear_user_data_text); + mButtonsPref + .setButton1Text(R.string.clear_user_data_text) + .setButton1Icon(R.drawable.ic_settings_delete); if (result == OP_SUCCESSFUL) { Log.i(TAG, "Cleared user data for package : " + packageName); updateSize(); diff --git a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java index 12c4d9d7f2..b7023bb01e 100644 --- a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java +++ b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java @@ -165,7 +165,9 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp if (isAvailable()) { mButtonsPref = ((ActionButtonPreference) screen.findPreference(KEY_ACTION_BUTTONS)) .setButton1Text(R.string.uninstall_text) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton2Text(R.string.force_stop) + .setButton2Icon(R.drawable.ic_settings_force_stop) .setButton1OnClickListener(new UninstallAndDisableButtonListener()) .setButton2OnClickListener(new ForceStopButtonListener()) .setButton1Positive(false) @@ -541,15 +543,18 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp if (mHomePackages.contains(mAppEntry.info.packageName) || isSystemPackage(mActivity.getResources(), mPm, mPackageInfo)) { // Disable button for core system applications. - mButtonsPref.setButton1Text(R.string.disable_text) + mButtonsPref.setButton1Text(R.string.uninstall_text) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1Positive(false); } else if (mAppEntry.info.enabled && !isDisabledUntilUsed()) { - mButtonsPref.setButton1Text(R.string.disable_text) + mButtonsPref.setButton1Text(R.string.uninstall_text) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1Positive(false); disableable = !mApplicationFeatureProvider.getKeepEnabledPackages() .contains(mAppEntry.info.packageName); } else { - mButtonsPref.setButton1Text(R.string.enable_text) + mButtonsPref.setButton1Text(R.string.install_text) + .setButton1Icon(R.drawable.ic_settings_install) .setButton1Positive(true); disableable = true; } diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsButtonsController.java b/src/com/android/settings/bluetooth/BluetoothDetailsButtonsController.java index 09632df155..ac90870cf8 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsButtonsController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsButtonsController.java @@ -53,6 +53,7 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle protected void init(PreferenceScreen screen) { mActionButtons = ((ActionButtonPreference) screen.findPreference(getPreferenceKey())) .setButton1Text(R.string.forget) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1OnClickListener((view) -> onForgetButtonPressed()) .setButton1Positive(false) .setButton1Enabled(true); @@ -68,6 +69,7 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle if (!mConnectButtonInitialized || !previouslyConnected) { mActionButtons .setButton2Text(R.string.bluetooth_device_context_disconnect) + .setButton2Icon(R.drawable.ic_settings_close) .setButton2OnClickListener(view -> mCachedDevice.disconnect()) .setButton2Positive(false); mConnectButtonInitialized = true; @@ -76,6 +78,7 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle if (!mConnectButtonInitialized || previouslyConnected) { mActionButtons .setButton2Text(R.string.bluetooth_device_context_connect) + // TODO (b/119646923) Icon is not ready. .setButton2OnClickListener( view -> mCachedDevice.connect(true /* connectAllProfiles */)) .setButton2Positive(true); diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java index 46f485c9ba..ea31b1b24c 100644 --- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java +++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java @@ -278,6 +278,7 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController mButtonsPref = ((ActionButtonPreference) screen.findPreference(KEY_BUTTONS_PREF)) .setButton1Text(R.string.forget) + .setButton1Icon(R.drawable.ic_settings_delete) .setButton1Positive(false) .setButton1OnClickListener(view -> forgetNetwork()) .setButton2Text(R.string.wifi_sign_in_button_text) diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java index 44ace780c8..3785de9b3c 100644 --- a/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java @@ -308,7 +308,7 @@ public class AppButtonsPreferenceControllerTest { final boolean controllable = mController.handleDisableable(); - verify(mButtonPrefs).setButton1Text(R.string.disable_text); + verify(mButtonPrefs).setButton1Text(R.string.uninstall_text); assertThat(controllable).isFalse(); } @@ -320,7 +320,7 @@ public class AppButtonsPreferenceControllerTest { final boolean controllable = mController.handleDisableable(); - verify(mButtonPrefs).setButton1Text(R.string.disable_text); + verify(mButtonPrefs).setButton1Text(R.string.uninstall_text); assertThat(controllable).isTrue(); } @@ -332,7 +332,7 @@ public class AppButtonsPreferenceControllerTest { final boolean controllable = mController.handleDisableable(); - verify(mButtonPrefs).setButton1Text(R.string.enable_text); + verify(mButtonPrefs).setButton1Text(R.string.install_text); assertThat(controllable).isTrue(); } |