diff options
| author | 2022-03-03 18:07:44 +0000 | |
|---|---|---|
| committer | 2022-03-03 18:07:44 +0000 | |
| commit | f233e14747e84745915f01b49e67359c016cc941 (patch) | |
| tree | 960d051904fc90301895cf46f46767bc10e87d7b | |
| parent | 5dcd46d356da9dc9f607def072fb3d944c48b8bf (diff) | |
| parent | a7ab4fce87b39c0518695274b294d79cd7c9c702 (diff) | |
Merge "Add icon for user switching" into tm-dev
| -rw-r--r-- | core/res/res/drawable/ic_swap_horiz.xml | 28 | ||||
| -rw-r--r-- | core/res/res/layout/user_switching_dialog.xml | 7 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/UserSwitchingDialog.java | 9 |
4 files changed, 41 insertions, 5 deletions
diff --git a/core/res/res/drawable/ic_swap_horiz.xml b/core/res/res/drawable/ic_swap_horiz.xml new file mode 100644 index 000000000000..e7517f9e8d91 --- /dev/null +++ b/core/res/res/drawable/ic_swap_horiz.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright 2022, 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="@android:color/white" + android:pathData="M17,14L15.6,12.575L18.175,10H11V8H18.175L15.6,5.425L17,4L22,9ZM7,20L2,15L7,10L8.4,11.425L5.825,14H13V16H5.825L8.4,18.575Z" /> +</vector> diff --git a/core/res/res/layout/user_switching_dialog.xml b/core/res/res/layout/user_switching_dialog.xml index c80621092e22..2e041f5f2be2 100644 --- a/core/res/res/layout/user_switching_dialog.xml +++ b/core/res/res/layout/user_switching_dialog.xml @@ -18,10 +18,13 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/message" style="?attr/textAppearanceListItem" - android:layout_width="match_parent" + android:background="?attr/colorSurface" + android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" + android:drawablePadding="12dp" + android:drawableTint="?attr/textColorPrimary" android:paddingStart="?attr/dialogPreferredPadding" android:paddingEnd="?attr/dialogPreferredPadding" android:paddingTop="24dp" - android:paddingBottom="24dp" />
\ No newline at end of file + android:paddingBottom="24dp" /> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 2112953d6962..114bbb7f6621 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -4763,4 +4763,6 @@ <java-symbol type="bool" name="config_bg_prompt_fgs_with_noti_to_bg_restricted" /> <java-symbol type="integer" name="config_bg_current_drain_exempted_types" /> <java-symbol type="bool" name="config_bg_current_drain_high_threshold_by_bg_location" /> + <java-symbol type="drawable" name="ic_swap_horiz" /> + </resources> diff --git a/services/core/java/com/android/server/am/UserSwitchingDialog.java b/services/core/java/com/android/server/am/UserSwitchingDialog.java index 16d83ec729b9..7a6603d1f243 100644 --- a/services/core/java/com/android/server/am/UserSwitchingDialog.java +++ b/services/core/java/com/android/server/am/UserSwitchingDialog.java @@ -91,8 +91,8 @@ class UserSwitchingDialog extends AlertDialog setCancelable(false); Resources res = getContext().getResources(); // Custom view due to alignment and font size requirements - View view = LayoutInflater.from(getContext()).inflate(R.layout.user_switching_dialog, - null); + TextView view = (TextView) LayoutInflater.from(getContext()).inflate( + R.layout.user_switching_dialog, null); String viewMessage = null; if (UserManager.isSplitSystemUser() && mNewUser.id == UserHandle.USER_SYSTEM) { @@ -115,9 +115,12 @@ class UserSwitchingDialog extends AlertDialog if (viewMessage == null) { viewMessage = res.getString(R.string.user_switching_message, mNewUser.name); } + + view.setCompoundDrawablesWithIntrinsicBounds(null, + getContext().getDrawable(R.drawable.ic_swap_horiz), null, null); } view.setAccessibilityPaneTitle(viewMessage); - ((TextView) view.findViewById(R.id.message)).setText(viewMessage); + view.setText(viewMessage); setView(view); } |