diff options
| author | Kenny Guy <kennyguy@google.com> | 2015-06-19 14:56:47 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-19 14:56:51 +0000 |
| commit | 43cf8d1ed10728f40736fa82c1a569d9aa82bfc6 (patch) | |
| tree | 98fdc9e1a218d884ced97a4bfa65415c805c1c3d /packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | |
| parent | 660130b9b01deaa36a714c7c137688ce456b4e55 (diff) | |
| parent | 63bf8acb2a0e5e3f128f853a824ed5c570c57695 (diff) | |
| download | frameworks_base-43cf8d1ed10728f40736fa82c1a569d9aa82bfc6.zip frameworks_base-43cf8d1ed10728f40736fa82c1a569d9aa82bfc6.tar.gz frameworks_base-43cf8d1ed10728f40736fa82c1a569d9aa82bfc6.tar.bz2 | |
Merge "Use closer to standard toast for work profile toast." into mnc-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index a496548..f8a1385 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -393,13 +393,16 @@ public abstract class BaseStatusBar extends SystemUI implements if (recentTask != null && recentTask.size() > 0) { UserInfo user = mUserManager.getUserInfo(recentTask.get(0).userId); if (user != null && user.isManagedProfile()) { - LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( - Context.LAYOUT_INFLATER_SERVICE); - View layout = inflater.inflate(R.layout.managed_profile_toast, null); - Toast toast = new Toast(mContext); - toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); - toast.setDuration(Toast.LENGTH_SHORT); - toast.setView(layout); + Toast toast = Toast.makeText(mContext, + R.string.managed_profile_foreground_toast, + Toast.LENGTH_SHORT); + TextView text = (TextView) toast.getView().findViewById( + android.R.id.message); + text.setCompoundDrawablesRelativeWithIntrinsicBounds( + R.drawable.stat_sys_managed_profile_status, 0, 0, 0); + int paddingPx = mContext.getResources().getDimensionPixelSize( + R.dimen.managed_profile_toast_padding); + text.setCompoundDrawablePadding(paddingPx); toast.show(); } } |
