Skip to content

Commit 3ee7b96

Browse files
committed
Pixelify 3 - Accent colour, widget scrolling
1 parent 2b32fb8 commit 3ee7b96

File tree

9 files changed

+32
-19
lines changed

9 files changed

+32
-19
lines changed

res/drawable-ldrtl/container_fastscroll_popup_bg.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<shape xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:shape="rectangle">
19-
<solid android:color="?android:attr/colorAccent" />
19+
<solid android:color="@color/accentColor" />
2020
<size
2121
android:width="64dp"
2222
android:height="64dp" />

res/drawable/all_apps_search_divider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
-->
1616
<shape xmlns:android="http://schemas.android.com/apk/res/android"
1717
android:shape="rectangle">
18-
<solid android:color="?android:attr/colorAccent" />
18+
<solid android:color="@color/accentColor" />
1919
<size android:height="1dp" />
2020
</shape>

res/drawable/all_apps_search_hint.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
-->
1717
<selector xmlns:android="http://schemas.android.com/apk/res/android">
1818
<item android:color="@android:color/transparent" android:state_focused="true" />
19-
<item android:color="?android:attr/colorAccent"/>
19+
<item android:color="@color/accentColor"/>
2020
</selector>

res/drawable/container_fastscroll_popup_bg.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<shape xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:shape="rectangle">
19-
<solid android:color="?android:attr/colorAccent" />
19+
<solid android:color="@color/accentColor" />
2020
<size
2121
android:width="64dp"
2222
android:height="64dp" />

res/drawable/ic_allapps_search.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
android:viewportHeight="24.0"
2020
android:viewportWidth="24.0">
2121
<path
22-
android:fillColor="?android:attr/colorAccent"
22+
android:fillColor="@color/accentColor"
2323
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
2424
</vector>

res/layout/all_apps_search_market.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:paddingRight="@dimen/container_fastscroll_thumb_max_width"
2424
android:fontFamily="sans-serif-medium"
2525
android:textSize="14sp"
26-
android:textColor="?android:attr/colorAccent"
26+
android:textColor="@color/accentColor"
2727
android:text="@string/all_apps_search_market_message"
2828
android:textAllCaps="true"
2929
android:focusable="true"

res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@
5454
<!-- Pixel -->
5555
<color name="qsb_connector">#fff2f2f2</color>
5656
<color name="qsb_background">#ffffffff</color>
57+
<color name="accentColor">#ff4286f4</color>
5758
</resources>

res/values/styles.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040

4141
<style name="CustomOverscroll.Light" parent="@android:style/Theme.DeviceDefault.Light">
4242
<item name="android:colorEdgeEffect">@color/folder_edge_effect_color</item>
43+
<item name="android:colorAccent">@color/accentColor</item>
4344
</style>
4445

4546
<style name="CustomOverscroll.Dark">
4647
<item name="android:colorEdgeEffect">@color/workspace_edge_effect_color</item>
48+
<item name="android:colorAccent">@color/accentColor</item>
4749
</style>
4850

4951
<!-- Different icons -->

src/com/android/launcher3/allapps/AllAppsTransitionController.java

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.animation.ArgbEvaluator;
88
import android.animation.ObjectAnimator;
99
import android.graphics.Color;
10+
import android.graphics.Rect;
1011
import android.support.v4.content.ContextCompat;
1112
import android.support.v4.graphics.ColorUtils;
1213
import android.support.v4.view.animation.FastOutSlowInInterpolator;
@@ -17,11 +18,13 @@
1718
import android.view.animation.DecelerateInterpolator;
1819
import android.view.animation.Interpolator;
1920

20-
import com.android.launcher3.DeviceProfile;
21+
import com.android.launcher3.CellLayout;
2122
import com.android.launcher3.Hotseat;
2223
import com.android.launcher3.Launcher;
2324
import com.android.launcher3.LauncherAnimUtils;
25+
import com.android.launcher3.LauncherAppWidgetHostView;
2426
import com.android.launcher3.R;
27+
import com.android.launcher3.ShortcutAndWidgetContainer;
2528
import com.android.launcher3.Utilities;
2629
import com.android.launcher3.Workspace;
2730
import com.android.launcher3.userevent.nano.LauncherLogProto;
@@ -116,6 +119,8 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
116119
} else if (mLauncher.isAllAppsVisible() &&
117120
!mAppsView.shouldContainerScroll(ev)) {
118121
mNoIntercept = true;
122+
} else if (!mLauncher.isAllAppsVisible() && !shouldPossiblyIntercept(ev)) {
123+
mNoIntercept = true;
119124
} else {
120125
// Now figure out which direction scroll events the controller will start
121126
// calling the callbacks.
@@ -153,22 +158,27 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
153158
}
154159

155160
private boolean shouldPossiblyIntercept(MotionEvent ev) {
156-
DeviceProfile grid = mLauncher.getDeviceProfile();
157161
if (mDetector.isIdleState()) {
158-
if (grid.isVerticalBarLayout()) {
159-
if (ev.getY() > mLauncher.getDeviceProfile().heightPx - mBezelSwipeUpHeight) {
160-
return true;
161-
}
162-
} else {
163-
if (mLauncher.getDragLayer().isEventOverHotseat(ev) ||
164-
mLauncher.getDragLayer().isEventOverPageIndicator(ev)) {
165-
return true;
162+
CellLayout cl = mLauncher.getWorkspace().getCurrentDropLayout();
163+
if (cl != null) {
164+
ShortcutAndWidgetContainer c = cl.getShortcutsAndWidgets();
165+
int x = (int)ev.getX();
166+
int y = (int)ev.getY();
167+
Rect outRect = new Rect();
168+
int count = c.getChildCount();
169+
for (int i = 0; i < count; i++) {
170+
View v = c.getChildAt(i);
171+
if (v instanceof LauncherAppWidgetHostView) {
172+
v.getGlobalVisibleRect(outRect);
173+
if (outRect.contains(x, y)) {
174+
return false;
175+
}
176+
}
166177
}
167178
}
168-
return false;
169-
} else {
170-
return true;
171179
}
180+
181+
return true;
172182
}
173183

174184
@Override

0 commit comments

Comments
 (0)