Merge "Support multiple Views of extra hotseat content" into ub-launcher3-master

This commit is contained in:
TreeHugger Robot
2018-03-22 02:52:42 +00:00
committed by Android (Google) Code Review
5 changed files with 38 additions and 8 deletions
@@ -100,7 +100,10 @@ public class UiFactory {
}
}
public static View getHotseatExtraContent(Hotseat hotseat) {
return hotseat.findViewById(R.id.search_container_hotseat);
public static View[] getHotseatExtraContent(Hotseat hotseat) {
return new View[] {
hotseat.findViewById(R.id.drag_indicator),
hotseat.findViewById(R.id.search_container_hotseat),
};
}
}
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="2dp"
android:width="16dp"
android:viewportHeight="2.0"
android:viewportWidth="16.0">
<path
android:fillColor="@android:color/white"
android:pathData="M1,0h14c0.55,0,1,0.45,1,1s-0.45,1-1,1H1C0.45,2,0,1.55,0,1S0.45,0,1,0z"/>
</vector>
@@ -84,8 +84,10 @@ public class WorkspaceStateTransitionAnimation {
float hotseatExtraAlpha = (elements & HOTSEAT_EXTRA) != 0 ? 1 : 0;
propertySetter.setViewAlpha(mLauncher.getHotseat().getLayout(), hotseatIconsAlpha,
pageAlphaProvider.interpolator);
propertySetter.setViewAlpha(UiFactory.getHotseatExtraContent(mLauncher.getHotseat()),
hotseatExtraAlpha, pageAlphaProvider.interpolator);
for (View hotseatExtraContent : UiFactory.getHotseatExtraContent(mLauncher.getHotseat())) {
propertySetter.setViewAlpha(hotseatExtraContent, hotseatExtraAlpha,
pageAlphaProvider.interpolator);
}
propertySetter.setViewAlpha(mLauncher.getWorkspace().getPageIndicator(),
hotseatIconsAlpha, pageAlphaProvider.interpolator);
@@ -155,8 +155,8 @@ public class WorkspacePageIndicator extends View
int lineWidth = (int) (availableWidth / mNumPagesFloat);
int lineLeft = (int) (progress * (availableWidth - lineWidth));
int lineRight = lineLeft + lineWidth;
canvas.drawRect(lineLeft, canvas.getHeight() - mLineHeight, lineRight, canvas.getHeight(),
mLinePaint);
canvas.drawRoundRect(lineLeft, canvas.getHeight() / 2 - mLineHeight / 2, lineRight,
canvas.getHeight() / 2 + mLineHeight / 2, mLineHeight, mLineHeight, mLinePaint);
}
@Override
@@ -48,7 +48,7 @@ public class UiFactory {
public static void onTrimMemory(Launcher launcher, int level) { }
public static View getHotseatExtraContent(Hotseat hotseat) {
return null;
public static View[] getHotseatExtraContent(Hotseat hotseat) {
return new View[0];
}
}