Skip to content

Commit

Permalink
Pixelify 3 - Accent colour, widget scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed Jun 12, 2017
1 parent 2b32fb8 commit 3ee7b96
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion res/drawable-ldrtl/container_fastscroll_popup_bg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?android:attr/colorAccent" />
<solid android:color="@color/accentColor" />
<size
android:width="64dp"
android:height="64dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/drawable/all_apps_search_divider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?android:attr/colorAccent" />
<solid android:color="@color/accentColor" />
<size android:height="1dp" />
</shape>
2 changes: 1 addition & 1 deletion res/drawable/all_apps_search_hint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/transparent" android:state_focused="true" />
<item android:color="?android:attr/colorAccent"/>
<item android:color="@color/accentColor"/>
</selector>
2 changes: 1 addition & 1 deletion res/drawable/container_fastscroll_popup_bg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?android:attr/colorAccent" />
<solid android:color="@color/accentColor" />
<size
android:width="64dp"
android:height="64dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/drawable/ic_allapps_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="?android:attr/colorAccent"
android:fillColor="@color/accentColor"
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" />
</vector>
2 changes: 1 addition & 1 deletion res/layout/all_apps_search_market.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:paddingRight="@dimen/container_fastscroll_thumb_max_width"
android:fontFamily="sans-serif-medium"
android:textSize="14sp"
android:textColor="?android:attr/colorAccent"
android:textColor="@color/accentColor"
android:text="@string/all_apps_search_market_message"
android:textAllCaps="true"
android:focusable="true"
Expand Down
1 change: 1 addition & 0 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@
<!-- Pixel -->
<color name="qsb_connector">#fff2f2f2</color>
<color name="qsb_background">#ffffffff</color>
<color name="accentColor">#ff4286f4</color>
</resources>
2 changes: 2 additions & 0 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@

<style name="CustomOverscroll.Light" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:colorEdgeEffect">@color/folder_edge_effect_color</item>
<item name="android:colorAccent">@color/accentColor</item>
</style>

<style name="CustomOverscroll.Dark">
<item name="android:colorEdgeEffect">@color/workspace_edge_effect_color</item>
<item name="android:colorAccent">@color/accentColor</item>
</style>

<!-- Different icons -->
Expand Down
36 changes: 23 additions & 13 deletions src/com/android/launcher3/allapps/AllAppsTransitionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.graphics.Color;
import android.graphics.Rect;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.ColorUtils;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
Expand All @@ -17,11 +18,13 @@
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.CellLayout;
import com.android.launcher3.Hotseat;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherAppWidgetHostView;
import com.android.launcher3.R;
import com.android.launcher3.ShortcutAndWidgetContainer;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.userevent.nano.LauncherLogProto;
Expand Down Expand Up @@ -116,6 +119,8 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
} else if (mLauncher.isAllAppsVisible() &&
!mAppsView.shouldContainerScroll(ev)) {
mNoIntercept = true;
} else if (!mLauncher.isAllAppsVisible() && !shouldPossiblyIntercept(ev)) {
mNoIntercept = true;
} else {
// Now figure out which direction scroll events the controller will start
// calling the callbacks.
Expand Down Expand Up @@ -153,22 +158,27 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
}

private boolean shouldPossiblyIntercept(MotionEvent ev) {
DeviceProfile grid = mLauncher.getDeviceProfile();
if (mDetector.isIdleState()) {
if (grid.isVerticalBarLayout()) {
if (ev.getY() > mLauncher.getDeviceProfile().heightPx - mBezelSwipeUpHeight) {
return true;
}
} else {
if (mLauncher.getDragLayer().isEventOverHotseat(ev) ||
mLauncher.getDragLayer().isEventOverPageIndicator(ev)) {
return true;
CellLayout cl = mLauncher.getWorkspace().getCurrentDropLayout();
if (cl != null) {
ShortcutAndWidgetContainer c = cl.getShortcutsAndWidgets();
int x = (int)ev.getX();
int y = (int)ev.getY();
Rect outRect = new Rect();
int count = c.getChildCount();
for (int i = 0; i < count; i++) {
View v = c.getChildAt(i);
if (v instanceof LauncherAppWidgetHostView) {
v.getGlobalVisibleRect(outRect);
if (outRect.contains(x, y)) {
return false;
}
}
}
}
return false;
} else {
return true;
}

return true;
}

@Override
Expand Down

0 comments on commit 3ee7b96

Please sign in to comment.