Skip to content

Commit e2f0ec8

Browse files
Adam CohenAndroid (Google) Code Review
authored andcommitted
Merge "Enabling hardware layers while overscrolling widget pager" into jb-mr1-dev
2 parents e01538f + 5b50a25 commit e2f0ec8

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

core/res/res/layout/keyguard_transport_control_view.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
android:layout_width="wrap_content"
2121
android:layout_height="wrap_content"
2222
android:gravity="center_horizontal"
23-
android:layerType="hardware"
2423
android:id="@+id/keyguard_transport_control">
2524

2625
<!-- FrameLayout used as scrim to show between album art and buttons -->

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSubdivisionLayout.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ BiTree getNextNodeToBranch() {
9797
leafs.clear();
9898
getLeafs(leafs, 1);
9999

100-
// We find the first leaf who's depth is not
100+
// If the tree is complete, then we start a new level at the rightmost side.
101101
double r = log2(leafs.size());
102102
if (Math.ceil(r) == Math.floor(r)) {
103103
return leafs.get(leafs.size() - 1);
104104
}
105105

106+
// Tree is not complete, find the first leaf who's depth is less than the depth of
107+
// the tree.
106108
int treeDepth = depth();
107109
for (int i = leafs.size() - 1; i >= 0; i--) {
108110
BiTree n = leafs.get(i);

policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,14 @@ void setOverScrollAmount(float r, boolean left) {
9191

9292
mForegroundAlpha = (int) Math.round((r * 255));
9393
mForegroundDrawable.setAlpha(mForegroundAlpha);
94+
if (getLayerType() != LAYER_TYPE_HARDWARE) {
95+
setLayerType(LAYER_TYPE_HARDWARE, null);
96+
}
9497
invalidate();
98+
} else {
99+
if (getLayerType() != LAYER_TYPE_NONE) {
100+
setLayerType(LAYER_TYPE_NONE, null);
101+
}
95102
}
96103
}
97104
}

0 commit comments

Comments
 (0)