diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-08-13 18:27:47 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-08-14 19:16:33 +0000 |
commit | d7c1fae12ef0b31c225ef130e6b06445b5af53a9 (patch) | |
tree | 2ef2c01fe52c5aea419e4548fd028a07dd00a8fd /packages/SystemUI | |
parent | 0f623eb8340d43d6bfa0299c87556712c79e6936 (diff) | |
download | frameworks_base-d7c1fae12ef0b31c225ef130e6b06445b5af53a9.zip frameworks_base-d7c1fae12ef0b31c225ef130e6b06445b5af53a9.tar.gz frameworks_base-d7c1fae12ef0b31c225ef130e6b06445b5af53a9.tar.bz2 |
Don't scale notifications on Keyguard for devices < xxhdpi
Bug: 16824061
Change-Id: Iccccebcd17357764aef325df0cd220508fcf7403
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/res/values-h560dp-xhdpi/config.xml | 23 | ||||
-rw-r--r-- | packages/SystemUI/res/values-h560dp-xhdpi/dimens.xml | 21 | ||||
-rw-r--r-- | packages/SystemUI/res/values-h560dp-xxhdpi/config.xml (renamed from packages/SystemUI/res/values-h560dp/config.xml) | 0 | ||||
-rw-r--r-- | packages/SystemUI/res/values-h560dp-xxhdpi/dimens.xml | 21 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 2 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java | 11 |
6 files changed, 75 insertions, 3 deletions
diff --git a/packages/SystemUI/res/values-h560dp-xhdpi/config.xml b/packages/SystemUI/res/values-h560dp-xhdpi/config.xml new file mode 100644 index 0000000..cf2017f1 --- /dev/null +++ b/packages/SystemUI/res/values-h560dp-xhdpi/config.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 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 + --> +<resources> + <!-- The maximum count of notifications on Keyguard. The rest will be collapsed in an overflow + card. --> + <integer name="keyguard_max_notification_count">3</integer> +</resources> + diff --git a/packages/SystemUI/res/values-h560dp-xhdpi/dimens.xml b/packages/SystemUI/res/values-h560dp-xhdpi/dimens.xml new file mode 100644 index 0000000..f6dbc3d --- /dev/null +++ b/packages/SystemUI/res/values-h560dp-xhdpi/dimens.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 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 + --> + +<resources> + <fraction name="keyguard_clock_y_fraction_max">32.5%</fraction> + <fraction name="keyguard_clock_y_fraction_min">24%</fraction> +</resources>
\ No newline at end of file diff --git a/packages/SystemUI/res/values-h560dp/config.xml b/packages/SystemUI/res/values-h560dp-xxhdpi/config.xml index b2231a6..b2231a6 100644 --- a/packages/SystemUI/res/values-h560dp/config.xml +++ b/packages/SystemUI/res/values-h560dp-xxhdpi/config.xml diff --git a/packages/SystemUI/res/values-h560dp-xxhdpi/dimens.xml b/packages/SystemUI/res/values-h560dp-xxhdpi/dimens.xml new file mode 100644 index 0000000..905e9e3 --- /dev/null +++ b/packages/SystemUI/res/values-h560dp-xxhdpi/dimens.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 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 + --> + +<resources> + <fraction name="keyguard_clock_y_fraction_max">32.5%</fraction> + <fraction name="keyguard_clock_y_fraction_min">19.8%</fraction> +</resources>
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 462452b..8e5077c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -280,7 +280,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private void updatePadding(boolean dimmed) { - mPaddingBetweenElements = dimmed + mPaddingBetweenElements = dimmed && mStackScrollAlgorithm.shouldScaleDimmed() ? mPaddingBetweenElementsDimmed : mPaddingBetweenElementsNormal; mBottomStackSlowDownHeight = mStackScrollAlgorithm.getBottomStackSlowDownLength(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index f984339..fc2be1a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.stack; import android.content.Context; +import android.util.DisplayMetrics; import android.util.Log; import android.view.View; import android.view.ViewGroup; @@ -73,6 +74,7 @@ public class StackScrollAlgorithm { private int mCollapseSecondCardPadding; private boolean mIsSmallScreen; private int mMaxNotificationHeight; + private boolean mScaleDimmed; public StackScrollAlgorithm(Context context) { initConstants(context); @@ -80,7 +82,7 @@ public class StackScrollAlgorithm { } private void updatePadding(boolean dimmed) { - mPaddingBetweenElements = dimmed + mPaddingBetweenElements = dimmed && mScaleDimmed ? mPaddingBetweenElementsDimmed : mPaddingBetweenElementsNormal; mTopStackTotalSize = mTopStackSlowDownLength + mPaddingBetweenElements @@ -125,8 +127,13 @@ public class StackScrollAlgorithm { R.dimen.notification_material_rounded_rect_radius); mCollapseSecondCardPadding = context.getResources().getDimensionPixelSize( R.dimen.notification_collapse_second_card_padding); + mScaleDimmed = context.getResources().getDisplayMetrics().densityDpi + >= DisplayMetrics.DENSITY_XXHIGH; } + public boolean shouldScaleDimmed() { + return mScaleDimmed; + } public void getStackScrollState(AmbientState ambientState, StackScrollState resultState) { // The state of the local variables are saved in an algorithmState to easily subdivide it @@ -271,7 +278,7 @@ public class StackScrollAlgorithm { childViewState.dark = dark; childViewState.hideSensitive = hideSensitive; boolean isActivatedChild = activatedChild == child; - childViewState.scale = !dimmed || isActivatedChild + childViewState.scale = !mScaleDimmed || !dimmed || isActivatedChild ? 1.0f : DIMMED_SCALE; if (dimmed && activatedChild != null) { |