Minor changes to help address some hiccups when panning, changing tabs and rotating in AppsCustomize.
- Also removing references to old all-apps 2d/3d Change-Id: Ibe07ad8b4facc5c57b3c82ccf0b55260be61a31b
This commit is contained in:
parent
563ed71d68
commit
63257c110a
|
@ -44,6 +44,7 @@
|
||||||
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
|
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
|
||||||
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
|
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
|
||||||
|
|
||||||
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
|
||||||
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
|
||||||
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
|
||||||
|
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2010 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Sapphire gets 2D all apps view -->
|
|
||||||
<com.android.launcher2.AllApps2D
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
|
|
||||||
android:id="@+id/all_apps_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:padding="2dip"
|
|
||||||
android:background="#FF000000">
|
|
||||||
|
|
||||||
<GridView android:id="@+id/all_apps_2d_grid"
|
|
||||||
android:tag="all_apps_2d_grid"
|
|
||||||
android:scrollbars="none"
|
|
||||||
android:drawSelectorOnTop="false"
|
|
||||||
android:listSelector="@drawable/grid_selector"
|
|
||||||
android:verticalSpacing="10dip"
|
|
||||||
android:numColumns="6"
|
|
||||||
android:fadingEdgeLength="48dip"
|
|
||||||
android:cacheColorHint="#FF000000"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginRight="@dimen/button_bar_height_portrait"
|
|
||||||
android:nextFocusRight="@+id/all_apps_2d_home"
|
|
||||||
android:nextFocusUp="@null"
|
|
||||||
android:nextFocusLeft="@null"
|
|
||||||
android:nextFocusDown="@null"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<view
|
|
||||||
class="com.android.launcher2.AllApps2D$HomeButton"
|
|
||||||
android:id="@+id/all_apps_2d_home"
|
|
||||||
android:tag="all_apps_2d_home"
|
|
||||||
android:src="@drawable/home_button"
|
|
||||||
android:background="#FF000000"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="@dimen/button_bar_height_portrait"
|
|
||||||
android:paddingBottom="@dimen/status_bar_height"
|
|
||||||
android:nextFocusLeft="@+id/all_apps_2d_grid"
|
|
||||||
android:nextFocusDown="@null"
|
|
||||||
android:nextFocusUp="@null"
|
|
||||||
android:nextFocusRight="@null"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</com.android.launcher2.AllApps2D>
|
|
|
@ -1,63 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2010 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Sapphire gets 2D all apps view -->
|
|
||||||
<com.android.launcher2.AllApps2D
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
|
|
||||||
android:id="@+id/all_apps_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:padding="2dip"
|
|
||||||
android:background="#FF000000">
|
|
||||||
|
|
||||||
<GridView android:id="@+id/all_apps_2d_grid"
|
|
||||||
android:tag="all_apps_2d_grid"
|
|
||||||
android:scrollbars="none"
|
|
||||||
android:drawSelectorOnTop="false"
|
|
||||||
android:listSelector="@drawable/grid_selector"
|
|
||||||
android:verticalSpacing="10dip"
|
|
||||||
android:numColumns="4"
|
|
||||||
android:fadingEdgeLength="48dip"
|
|
||||||
android:cacheColorHint="#FF000000"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginBottom="@dimen/button_bar_height"
|
|
||||||
android:layout_marginTop="8dip"
|
|
||||||
android:nextFocusDown="@+id/all_apps_2d_home"
|
|
||||||
android:nextFocusUp="@null"
|
|
||||||
android:nextFocusLeft="@null"
|
|
||||||
android:nextFocusRight="@null"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<view
|
|
||||||
class="com.android.launcher2.AllApps2D$HomeButton"
|
|
||||||
android:id="@+id/all_apps_2d_home"
|
|
||||||
android:tag="all_apps_2d_home"
|
|
||||||
android:src="@drawable/home_button"
|
|
||||||
android:background="#FF000000"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/button_bar_height"
|
|
||||||
android:nextFocusUp="@+id/all_apps_2d_grid"
|
|
||||||
android:nextFocusDown="@null"
|
|
||||||
android:nextFocusLeft="@null"
|
|
||||||
android:nextFocusRight="@null"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</com.android.launcher2.AllApps2D>
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2010 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- switch to all_apps_3d on devices that support RenderScript -->
|
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<include layout="@layout/all_apps_2d" />
|
|
||||||
</merge>
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2010 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Replace with AllAppsView to use 2D version -->
|
|
||||||
<com.android.launcher2.AllApps3D
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
|
|
||||||
android:id="@+id/all_apps_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
|
|
||||||
android:scrollbarStyle="outsideInset"
|
|
||||||
android:drawSelectorOnTop="false"
|
|
||||||
android:listSelector="@drawable/grid_selector"
|
|
||||||
android:verticalSpacing="10dip"
|
|
||||||
android:numColumns="4"
|
|
||||||
android:fadingEdgeLength="20dip"
|
|
||||||
android:padding="2dip"
|
|
||||||
android:cacheColorHint="#FF000000"
|
|
||||||
/>
|
|
|
@ -508,6 +508,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||||
@Override
|
@Override
|
||||||
public void syncPageItems(int page) {
|
public void syncPageItems(int page) {
|
||||||
// Ensure that we have the right number of items on the pages
|
// Ensure that we have the right number of items on the pages
|
||||||
|
final int numPages = getPageCount();
|
||||||
final int cellsPerPage = mCellCountX * mCellCountY;
|
final int cellsPerPage = mCellCountX * mCellCountY;
|
||||||
final int startIndex = page * cellsPerPage;
|
final int startIndex = page * cellsPerPage;
|
||||||
final int endIndex = Math.min(startIndex + cellsPerPage, mFilteredApps.size());
|
final int endIndex = Math.min(startIndex + cellsPerPage, mFilteredApps.size());
|
||||||
|
@ -540,6 +541,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||||
|
|
||||||
// Add any necessary items
|
// Add any necessary items
|
||||||
for (int i = curNumPageItems; i < numPageItems; ++i) {
|
for (int i = curNumPageItems; i < numPageItems; ++i) {
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
TextView text = (TextView) mInflater.inflate(
|
TextView text = (TextView) mInflater.inflate(
|
||||||
R.layout.all_apps_paged_view_application, layout, false);
|
R.layout.all_apps_paged_view_application, layout, false);
|
||||||
text.setOnClickListener(this);
|
text.setOnClickListener(this);
|
||||||
|
@ -547,17 +549,17 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||||
text.setOnTouchListener(this);
|
text.setOnTouchListener(this);
|
||||||
|
|
||||||
layout.addViewToCellLayout(text, -1, i,
|
layout.addViewToCellLayout(text, -1, i,
|
||||||
new PagedViewCellLayout.LayoutParams(0, 0, 1, 1));
|
new PagedViewCellLayout.LayoutParams(0, 0, 1, 1), createHolographicOutlines);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually reapply to the existing text views
|
// Actually reapply to the existing text views
|
||||||
final int numPages = getPageCount();
|
|
||||||
for (int i = startIndex; i < endIndex; ++i) {
|
for (int i = startIndex; i < endIndex; ++i) {
|
||||||
final int index = i - startIndex;
|
final int index = i - startIndex;
|
||||||
final ApplicationInfo info = mFilteredApps.get(i);
|
final ApplicationInfo info = mFilteredApps.get(i);
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
PagedViewIcon icon = (PagedViewIcon) layout.getChildOnPageAt(index);
|
PagedViewIcon icon = (PagedViewIcon) layout.getChildOnPageAt(index);
|
||||||
icon.applyFromApplicationInfo(
|
icon.applyFromApplicationInfo(
|
||||||
info, mPageViewIconCache, true, isHardwareAccelerated() && (numPages > 1));
|
info, mPageViewIconCache, true, createHolographicOutlines);
|
||||||
|
|
||||||
PagedViewCellLayout.LayoutParams params =
|
PagedViewCellLayout.LayoutParams params =
|
||||||
(PagedViewCellLayout.LayoutParams) icon.getLayoutParams();
|
(PagedViewCellLayout.LayoutParams) icon.getLayoutParams();
|
||||||
|
@ -579,10 +581,11 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center-align the message
|
// Center-align the message
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
layout.enableCenteredContent(true);
|
layout.enableCenteredContent(true);
|
||||||
layout.removeAllViewsOnPage();
|
layout.removeAllViewsOnPage();
|
||||||
layout.addViewToCellLayout(icon, -1, 0,
|
layout.addViewToCellLayout(icon, -1, 0,
|
||||||
new PagedViewCellLayout.LayoutParams(0, 0, 4, 1));
|
new PagedViewCellLayout.LayoutParams(0, 0, 4, 1), createHolographicOutlines);
|
||||||
}
|
}
|
||||||
layout.createHardwareLayers();
|
layout.createHardwareLayers();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ import android.util.LruCache;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.DecelerateInterpolator;
|
import android.view.animation.DecelerateInterpolator;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
@ -471,17 +472,28 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||||
/*
|
/*
|
||||||
* Apps PagedView implementation
|
* Apps PagedView implementation
|
||||||
*/
|
*/
|
||||||
|
private void setVisibilityOnChildren(ViewGroup layout, int visibility) {
|
||||||
|
int childCount = layout.getChildCount();
|
||||||
|
for (int i = 0; i < childCount; ++i) {
|
||||||
|
layout.getChildAt(i).setVisibility(visibility);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void setupPage(PagedViewCellLayout layout) {
|
private void setupPage(PagedViewCellLayout layout) {
|
||||||
layout.setCellCount(mCellCountX, mCellCountY);
|
layout.setCellCount(mCellCountX, mCellCountY);
|
||||||
layout.setGap(mPageLayoutWidthGap, mPageLayoutHeightGap);
|
layout.setGap(mPageLayoutWidthGap, mPageLayoutHeightGap);
|
||||||
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
|
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
|
||||||
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
|
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
|
||||||
|
|
||||||
// We force a measure here to get around the fact that when we do layout calculations
|
// Note: We force a measure here to get around the fact that when we do layout calculations
|
||||||
// immediately after syncing, we don't have a proper width.
|
// immediately after syncing, we don't have a proper width. That said, we already know the
|
||||||
|
// expected page width, so we can actually optimize by hiding all the TextView-based
|
||||||
|
// children that are expensive to measure, and let that happen naturally later.
|
||||||
|
setVisibilityOnChildren(layout, View.GONE);
|
||||||
int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
|
int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
|
||||||
int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
|
int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
|
||||||
|
layout.setMinimumWidth(getPageContentWidth());
|
||||||
layout.measure(widthSpec, heightSpec);
|
layout.measure(widthSpec, heightSpec);
|
||||||
|
setVisibilityOnChildren(layout, View.VISIBLE);
|
||||||
}
|
}
|
||||||
public void syncAppsPages() {
|
public void syncAppsPages() {
|
||||||
// Ensure that we have the right number of pages
|
// Ensure that we have the right number of pages
|
||||||
|
@ -514,8 +526,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||||
int index = i - startIndex;
|
int index = i - startIndex;
|
||||||
int x = index % mCellCountX;
|
int x = index % mCellCountX;
|
||||||
int y = index / mCellCountX;
|
int y = index / mCellCountX;
|
||||||
setupPage(layout);
|
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1),
|
||||||
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
|
isHardwareAccelerated() && (numPages > 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -525,7 +537,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||||
layout.setGravity(Gravity.LEFT);
|
layout.setGravity(Gravity.LEFT);
|
||||||
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
|
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
|
||||||
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
|
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
|
||||||
|
|
||||||
|
// Note: We force a measure here to get around the fact that when we do layout calculations
|
||||||
|
// immediately after syncing, we don't have a proper width. That said, we already know the
|
||||||
|
// expected page width, so we can actually optimize by hiding all the TextView-based
|
||||||
|
// children that are expensive to measure, and let that happen naturally later.
|
||||||
|
setVisibilityOnChildren(layout, View.GONE);
|
||||||
|
int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
|
||||||
|
int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
|
||||||
layout.setMinimumWidth(getPageContentWidth());
|
layout.setMinimumWidth(getPageContentWidth());
|
||||||
|
layout.measure(widthSpec, heightSpec);
|
||||||
|
setVisibilityOnChildren(layout, View.VISIBLE);
|
||||||
}
|
}
|
||||||
private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h,
|
private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h,
|
||||||
float scaleX, float scaleY) {
|
float scaleX, float scaleY) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class CellLayout extends ViewGroup {
|
||||||
|
|
||||||
// These arrays are used to implement the drag visualization on x-large screens.
|
// These arrays are used to implement the drag visualization on x-large screens.
|
||||||
// They are used as circular arrays, indexed by mDragOutlineCurrent.
|
// They are used as circular arrays, indexed by mDragOutlineCurrent.
|
||||||
private Point[] mDragOutlines = new Point[8];
|
private Point[] mDragOutlines = new Point[4];
|
||||||
private float[] mDragOutlineAlphas = new float[mDragOutlines.length];
|
private float[] mDragOutlineAlphas = new float[mDragOutlines.length];
|
||||||
private InterruptibleInOutAnimator[] mDragOutlineAnims =
|
private InterruptibleInOutAnimator[] mDragOutlineAnims =
|
||||||
new InterruptibleInOutAnimator[mDragOutlines.length];
|
new InterruptibleInOutAnimator[mDragOutlines.length];
|
||||||
|
|
|
@ -929,12 +929,13 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
final int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth,
|
final int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth,
|
||||||
info.minHeight, null);
|
info.minHeight, null);
|
||||||
final FastBitmapDrawable icon = getWidgetPreview(info);
|
final FastBitmapDrawable icon = getWidgetPreview(info);
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
|
|
||||||
PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
|
PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
|
||||||
R.layout.customize_paged_view_widget, layout, false);
|
R.layout.customize_paged_view_widget, layout, false);
|
||||||
|
|
||||||
l.applyFromAppWidgetProviderInfo(info, icon, mMaxWidgetWidth, cellSpans,
|
l.applyFromAppWidgetProviderInfo(info, icon, mMaxWidgetWidth, cellSpans,
|
||||||
mPageViewIconCache, (numPages > 1));
|
mPageViewIconCache, createHolographicOutlines);
|
||||||
l.setTag(createItemInfo);
|
l.setTag(createItemInfo);
|
||||||
l.setOnClickListener(this);
|
l.setOnClickListener(this);
|
||||||
l.setOnTouchListener(this);
|
l.setOnTouchListener(this);
|
||||||
|
@ -975,11 +976,12 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
for (int i = startIndex; i < endIndex; ++i) {
|
for (int i = startIndex; i < endIndex; ++i) {
|
||||||
final ResolveInfo info = mWallpaperList.get(i);
|
final ResolveInfo info = mWallpaperList.get(i);
|
||||||
final FastBitmapDrawable icon = getWallpaperPreview(info);
|
final FastBitmapDrawable icon = getWallpaperPreview(info);
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
|
|
||||||
PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
|
PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
|
||||||
R.layout.customize_paged_view_wallpaper, layout, false);
|
R.layout.customize_paged_view_wallpaper, layout, false);
|
||||||
l.applyFromWallpaperInfo(info, mPackageManager, icon, mMaxWidgetWidth,
|
l.applyFromWallpaperInfo(info, mPackageManager, icon, mMaxWidgetWidth,
|
||||||
mPageViewIconCache, (numPages > 1));
|
mPageViewIconCache, createHolographicOutlines);
|
||||||
l.setTag(info);
|
l.setTag(info);
|
||||||
l.setOnClickListener(this);
|
l.setOnClickListener(this);
|
||||||
|
|
||||||
|
@ -1012,12 +1014,13 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
for (int i = startIndex; i < endIndex; ++i) {
|
for (int i = startIndex; i < endIndex; ++i) {
|
||||||
ResolveInfo info = list.get(i);
|
ResolveInfo info = list.get(i);
|
||||||
PendingAddItemInfo createItemInfo = new PendingAddItemInfo();
|
PendingAddItemInfo createItemInfo = new PendingAddItemInfo();
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
|
|
||||||
PagedViewIcon icon = (PagedViewIcon) mInflater.inflate(
|
PagedViewIcon icon = (PagedViewIcon) mInflater.inflate(
|
||||||
R.layout.customize_paged_view_item, layout, false);
|
R.layout.customize_paged_view_item, layout, false);
|
||||||
icon.applyFromResolveInfo(info, mPackageManager, mPageViewIconCache,
|
icon.applyFromResolveInfo(info, mPackageManager, mPageViewIconCache,
|
||||||
((LauncherApplication) mLauncher.getApplication()).getIconCache(),
|
((LauncherApplication) mLauncher.getApplication()).getIconCache(),
|
||||||
(numPages > 1));
|
createHolographicOutlines);
|
||||||
switch (mCustomizationType) {
|
switch (mCustomizationType) {
|
||||||
case WallpaperCustomization:
|
case WallpaperCustomization:
|
||||||
icon.setOnClickListener(this);
|
icon.setOnClickListener(this);
|
||||||
|
@ -1039,7 +1042,8 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
final int x = index % mCellCountX;
|
final int x = index % mCellCountX;
|
||||||
final int y = index / mCellCountX;
|
final int y = index / mCellCountX;
|
||||||
setupPage(layout);
|
setupPage(layout);
|
||||||
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
|
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1),
|
||||||
|
createHolographicOutlines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1071,10 +1075,11 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
layout.removeAllViewsOnPage();
|
layout.removeAllViewsOnPage();
|
||||||
for (int i = startIndex; i < endIndex; ++i) {
|
for (int i = startIndex; i < endIndex; ++i) {
|
||||||
final ApplicationInfo info = mApps.get(i);
|
final ApplicationInfo info = mApps.get(i);
|
||||||
|
final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1);
|
||||||
PagedViewIcon icon = (PagedViewIcon) mInflater.inflate(
|
PagedViewIcon icon = (PagedViewIcon) mInflater.inflate(
|
||||||
R.layout.all_apps_paged_view_application, layout, false);
|
R.layout.all_apps_paged_view_application, layout, false);
|
||||||
icon.applyFromApplicationInfo(
|
icon.applyFromApplicationInfo(
|
||||||
info, mPageViewIconCache, true, isHardwareAccelerated() && (numPages > 1));
|
info, mPageViewIconCache, true, createHolographicOutlines);
|
||||||
icon.setOnClickListener(this);
|
icon.setOnClickListener(this);
|
||||||
icon.setOnTouchListener(this);
|
icon.setOnTouchListener(this);
|
||||||
icon.setOnLongClickListener(this);
|
icon.setOnLongClickListener(this);
|
||||||
|
@ -1083,7 +1088,8 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
|
||||||
final int x = index % mCellCountX;
|
final int x = index % mCellCountX;
|
||||||
final int y = index / mCellCountX;
|
final int y = index / mCellCountX;
|
||||||
setupPage(layout);
|
setupPage(layout);
|
||||||
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
|
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1),
|
||||||
|
createHolographicOutlines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -896,7 +896,7 @@ public final class Launcher extends Activity
|
||||||
dragLayer.setDragController(dragController);
|
dragLayer.setDragController(dragController);
|
||||||
|
|
||||||
if (LauncherApplication.isScreenXLarge()) {
|
if (LauncherApplication.isScreenXLarge()) {
|
||||||
mAllAppsGrid = (AllAppsView)dragLayer.findViewById(R.id.all_apps_view);
|
mAllAppsGrid = (AllAppsView) dragLayer.findViewById(R.id.all_apps_view);
|
||||||
mAllAppsGrid.setup(this, dragController);
|
mAllAppsGrid.setup(this, dragController);
|
||||||
// We don't want a hole punched in our window.
|
// We don't want a hole punched in our window.
|
||||||
((View) mAllAppsGrid).setWillNotDraw(false);
|
((View) mAllAppsGrid).setWillNotDraw(false);
|
||||||
|
|
|
@ -652,22 +652,6 @@ public class LauncherModel extends BroadcastReceiver {
|
||||||
mLoaderTask = null;
|
mLoaderTask = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger a gc to try to clean up after the stuff is done, since the
|
|
||||||
// renderscript allocations aren't charged to the java heap.
|
|
||||||
if (mStopped) {
|
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
System.gc();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
mHandler.postIdle(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
System.gc();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopLocked() {
|
public void stopLocked() {
|
||||||
|
|
|
@ -531,7 +531,8 @@ public abstract class PagedView extends ViewGroup {
|
||||||
protected void updateAdjacentPagesAlpha() {
|
protected void updateAdjacentPagesAlpha() {
|
||||||
if (mFadeInAdjacentScreens) {
|
if (mFadeInAdjacentScreens) {
|
||||||
if (mDirtyPageAlpha || (mTouchState == TOUCH_STATE_SCROLLING) || !mScroller.isFinished()) {
|
if (mDirtyPageAlpha || (mTouchState == TOUCH_STATE_SCROLLING) || !mScroller.isFinished()) {
|
||||||
int halfScreenSize = getMeasuredWidth() / 2;
|
int screenWidth = getMeasuredWidth();
|
||||||
|
int halfScreenSize = screenWidth / 2;
|
||||||
int screenCenter = mScrollX + halfScreenSize;
|
int screenCenter = mScrollX + halfScreenSize;
|
||||||
final int childCount = getChildCount();
|
final int childCount = getChildCount();
|
||||||
for (int i = 0; i < childCount; ++i) {
|
for (int i = 0; i < childCount; ++i) {
|
||||||
|
@ -544,7 +545,7 @@ public abstract class PagedView extends ViewGroup {
|
||||||
// we should just assume full page width (and calculate the offset according to
|
// we should just assume full page width (and calculate the offset according to
|
||||||
// that).
|
// that).
|
||||||
if (childWidth <= 0) {
|
if (childWidth <= 0) {
|
||||||
childWidth = getMeasuredWidth();
|
childWidth = screenWidth;
|
||||||
childCenter = (i * childWidth) + (childWidth / 2);
|
childCenter = (i * childWidth) + (childWidth / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1203,7 +1204,11 @@ public abstract class PagedView extends ViewGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getChildWidth(int index) {
|
protected int getChildWidth(int index) {
|
||||||
return Math.max(mMinimumWidth, getChildAt(index).getMeasuredWidth());
|
// This functions are called enough times that it actually makes a difference in the
|
||||||
|
// profiler -- so just inline the max() here
|
||||||
|
final int measuredWidth = getChildAt(index).getMeasuredWidth();
|
||||||
|
final int minWidth = mMinimumWidth;
|
||||||
|
return (minWidth > measuredWidth) ? minWidth : measuredWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getRelativeChildOffset(int index) {
|
protected int getRelativeChildOffset(int index) {
|
||||||
|
@ -1222,7 +1227,12 @@ public abstract class PagedView extends ViewGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getScaledMeasuredWidth(View child) {
|
protected int getScaledMeasuredWidth(View child) {
|
||||||
return (int) (Math.max(mMinimumWidth, child.getMeasuredWidth()) * mLayoutScale + 0.5f);
|
// This functions are called enough times that it actually makes a difference in the
|
||||||
|
// profiler -- so just inline the max() here
|
||||||
|
final int measuredWidth = child.getMeasuredWidth();
|
||||||
|
final int minWidth = mMinimumWidth;
|
||||||
|
final int maxWidth = (minWidth > measuredWidth) ? minWidth : measuredWidth;
|
||||||
|
return (int) (maxWidth * mLayoutScale + 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getPageNearestToCenterOfScreen() {
|
int getPageNearestToCenterOfScreen() {
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addViewToCellLayout(View child, int index, int childId,
|
public boolean addViewToCellLayout(View child, int index, int childId,
|
||||||
PagedViewCellLayout.LayoutParams params) {
|
PagedViewCellLayout.LayoutParams params, boolean createHolographicOutlines) {
|
||||||
final PagedViewCellLayout.LayoutParams lp = params;
|
final PagedViewCellLayout.LayoutParams lp = params;
|
||||||
|
|
||||||
// Generate an id for each view, this assumes we have at most 256x256 cells
|
// Generate an id for each view, this assumes we have at most 256x256 cells
|
||||||
|
@ -149,7 +149,10 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
|
||||||
if (mAllowHardwareLayerCreation) {
|
if (mAllowHardwareLayerCreation) {
|
||||||
pagedViewIcon.disableCache();
|
pagedViewIcon.disableCache();
|
||||||
}
|
}
|
||||||
mHolographicChildren.addView(pagedViewIcon.getHolographicOutlineView(), index, lp);
|
if (createHolographicOutlines) {
|
||||||
|
mHolographicChildren.addView(pagedViewIcon.getHolographicOutlineView(),
|
||||||
|
index, lp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
package com.android.launcher2;
|
package com.android.launcher2;
|
||||||
|
|
||||||
import com.android.launcher.R;
|
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -33,8 +31,10 @@ import android.os.HandlerThread;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.Checkable;
|
import android.widget.Checkable;
|
||||||
|
|
||||||
|
import com.android.launcher.R;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
|
||||||
|
|
||||||
private PagedViewIconCache.Key mIconCacheKey;
|
private PagedViewIconCache.Key mIconCacheKey;
|
||||||
private PagedViewIconCache mIconCache;
|
private PagedViewIconCache mIconCache;
|
||||||
|
private String mDimensionsFormatString;
|
||||||
|
|
||||||
private int mAlpha = 255;
|
private int mAlpha = 255;
|
||||||
private int mHolographicAlpha;
|
private int mHolographicAlpha;
|
||||||
|
@ -162,6 +163,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
|
||||||
mCheckedFadeOutDuration =
|
mCheckedFadeOutDuration =
|
||||||
r.getInteger(R.integer.config_dragAppsCustomizeIconFadeOutDuration);
|
r.getInteger(R.integer.config_dragAppsCustomizeIconFadeOutDuration);
|
||||||
}
|
}
|
||||||
|
mDimensionsFormatString = r.getString(R.string.widget_dims_format);
|
||||||
|
|
||||||
setWillNotDraw(false);
|
setWillNotDraw(false);
|
||||||
setClipToPadding(false);
|
setClipToPadding(false);
|
||||||
|
@ -189,7 +191,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
|
||||||
name.setText(info.label);
|
name.setText(info.label);
|
||||||
name.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
name.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
final TextView dims = (TextView) findViewById(R.id.widget_dims);
|
final TextView dims = (TextView) findViewById(R.id.widget_dims);
|
||||||
dims.setText(mContext.getString(R.string.widget_dims_format, cellSpan[0], cellSpan[1]));
|
dims.setText(String.format(mDimensionsFormatString, cellSpan[0], cellSpan[1]));
|
||||||
dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
|
|
||||||
if (createHolographicOutline) {
|
if (createHolographicOutline) {
|
||||||
|
@ -209,7 +211,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
|
||||||
name.setText(info.loadLabel(pm));
|
name.setText(info.loadLabel(pm));
|
||||||
name.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
name.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
final TextView dims = (TextView) findViewById(R.id.widget_dims);
|
final TextView dims = (TextView) findViewById(R.id.widget_dims);
|
||||||
dims.setText(mContext.getString(R.string.widget_dims_format, 1, 1));
|
dims.setText(String.format(mDimensionsFormatString, 1, 1));
|
||||||
dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
|
|
||||||
if (createHolographicOutline) {
|
if (createHolographicOutline) {
|
||||||
|
|
|
@ -1881,7 +1881,14 @@ public class Workspace extends SmoothPagedView
|
||||||
((i == mCurrentPage) && (mShrinkState != ShrinkState.SPRING_LOADED)) ?
|
((i == mCurrentPage) && (mShrinkState != ShrinkState.SPRING_LOADED)) ?
|
||||||
0.0f : 1.0f;
|
0.0f : 1.0f;
|
||||||
|
|
||||||
float translation = getOffsetXForRotation(rotation, cl.getWidth(), cl.getHeight());
|
float translation = 0f;
|
||||||
|
|
||||||
|
// If the screen is not xlarge, then don't rotate the CellLayouts
|
||||||
|
// NOTE: If we don't update the side pages alpha, then we should not hide the side
|
||||||
|
// pages. see unshrink().
|
||||||
|
if (LauncherApplication.isScreenXLarge()) {
|
||||||
|
translation = getOffsetXForRotation(rotation, cl.getWidth(), cl.getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
oldAlphas[i] = cl.getAlpha();
|
oldAlphas[i] = cl.getAlpha();
|
||||||
newAlphas[i] = finalAlphaValue;
|
newAlphas[i] = finalAlphaValue;
|
||||||
|
@ -1951,10 +1958,13 @@ public class Workspace extends SmoothPagedView
|
||||||
ValueAnimator.ofFloat(0f, 1f).setDuration(duration);
|
ValueAnimator.ofFloat(0f, 1f).setDuration(duration);
|
||||||
animWithInterpolator.setInterpolator(mZoomInInterpolator);
|
animWithInterpolator.setInterpolator(mZoomInInterpolator);
|
||||||
|
|
||||||
final float oldHorizontalWallpaperOffset = getHorizontalWallpaperOffset();
|
final float oldHorizontalWallpaperOffset = enableWallpaperEffects ?
|
||||||
final float oldVerticalWallpaperOffset = getVerticalWallpaperOffset();
|
getHorizontalWallpaperOffset() : 0;
|
||||||
final float newHorizontalWallpaperOffset = wallpaperOffsetForCurrentScroll();
|
final float oldVerticalWallpaperOffset = enableWallpaperEffects ?
|
||||||
final float newVerticalWallpaperOffset = 0.5f;
|
getVerticalWallpaperOffset() : 0;
|
||||||
|
final float newHorizontalWallpaperOffset = enableWallpaperEffects ?
|
||||||
|
wallpaperOffsetForCurrentScroll() : 0;
|
||||||
|
final float newVerticalWallpaperOffset = enableWallpaperEffects ? 0.5f : 0;
|
||||||
animWithInterpolator.addUpdateListener(new LauncherAnimatorUpdateListener() {
|
animWithInterpolator.addUpdateListener(new LauncherAnimatorUpdateListener() {
|
||||||
public void onAnimationUpdate(float a, float b) {
|
public void onAnimationUpdate(float a, float b) {
|
||||||
if (b == 0f) {
|
if (b == 0f) {
|
||||||
|
|
Loading…
Reference in New Issue