summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-04-08 19:01:34 -0700
committerHyunyoung Song <hyunyoungs@google.com>2015-04-08 19:01:34 -0700
commit3f471440a8b6b71d4c15501a96befd3b715c9e8f (patch)
treed5da39d089eed5096a4b10204153d5d6bb798624 /src/com/android/launcher3/DeviceProfile.java
parent85e3d4cc5ea4e554639868069f4fd409731f7bbb (diff)
downloadandroid_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.tar.gz
android_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.tar.bz2
android_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.zip
WidgetTray revamp work
- RecyclerView is rendering - Animation is connected - Drag and drop is now handled - UI tweaking: background, margins, more to come. - Flicker and preview not loading issue: fixed height for the horizontal scroll view. - Shortcuts are added - Widget Preview loading should support shortPress for drop - UI tweaks left: overlay of arrow when there are more items to scroll - icons are added in the section header - Sorting of widget sections and widget horizontal list - Adding all the padding constants to dimen.xml file - RecyclerView should only support one view type For items to be addressed in follow up patches OR CLs, TODO is added to the comment. b/19897708 Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java62
1 files changed, 2 insertions, 60 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 331695acc..ea2852080 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -106,8 +106,8 @@ public class DeviceProfile {
public int cellWidthPx;
public int cellHeightPx;
- int iconSizePx;
- int iconTextSizePx;
+ public int iconSizePx;
+ public int iconTextSizePx;
int iconDrawablePaddingPx;
int allAppsIconSizePx;
int allAppsIconTextSizePx;
@@ -803,64 +803,6 @@ public class DeviceProfile {
}
}
- // Layout AllApps
- AppsCustomizeTabHost host = (AppsCustomizeTabHost)
- launcher.findViewById(R.id.apps_customize_pane);
- if (host != null) {
- // Center the all apps page indicator
- int pageIndicatorHeight = (int) (pageIndicatorHeightPx * Math.min(1f,
- (allAppsIconSizePx / DynamicGrid.DEFAULT_ICON_SIZE_PX)));
- pageIndicator = host.findViewById(R.id.apps_customize_page_indicator);
- if (pageIndicator != null) {
- LinearLayout.LayoutParams lllp = (LinearLayout.LayoutParams) pageIndicator.getLayoutParams();
- lllp.width = LayoutParams.WRAP_CONTENT;
- lllp.height = pageIndicatorHeight;
- pageIndicator.setLayoutParams(lllp);
- }
-
- AppsCustomizePagedView pagedView = (AppsCustomizePagedView)
- host.findViewById(R.id.apps_customize_pane_content);
-
- FrameLayout fakePageContainer = (FrameLayout)
- host.findViewById(R.id.fake_page_container);
- FrameLayout fakePage = (FrameLayout) host.findViewById(R.id.fake_page);
-
- padding = new Rect();
- if (pagedView != null) {
- // Constrain the dimensions of all apps so that it does not span the full width
- int paddingLR = (availableWidthPx - (allAppsCellWidthPx * allAppsNumCols)) /
- (2 * (allAppsNumCols + 1));
- int paddingTB = (availableHeightPx - (allAppsCellHeightPx * allAppsNumRows)) /
- (2 * (allAppsNumRows + 1));
- paddingLR = Math.min(paddingLR, (int)((paddingLR + paddingTB) * 0.75f));
- paddingTB = Math.min(paddingTB, (int)((paddingLR + paddingTB) * 0.75f));
- int maxAllAppsWidth = (allAppsNumCols * (allAppsCellWidthPx + 2 * paddingLR));
- int gridPaddingLR = (availableWidthPx - maxAllAppsWidth) / 2;
- // Only adjust the side paddings on landscape phones, or tablets
- if ((isTablet() || isLandscape) && gridPaddingLR > (allAppsCellWidthPx / 4)) {
- padding.left = padding.right = gridPaddingLR;
- }
-
- // The icons are centered, so we can't just offset by the page indicator height
- // because the empty space will actually be pageIndicatorHeight + paddingTB
- padding.bottom = Math.max(0, pageIndicatorHeight - paddingTB);
-
- pagedView.setWidgetsPageIndicatorPadding(pageIndicatorHeight);
- fakePage.setBackground(res.getDrawable(R.drawable.quantum_panel));
-
- // Horizontal padding for the whole paged view
- int pagedFixedViewPadding =
- res.getDimensionPixelSize(R.dimen.apps_customize_horizontal_padding);
-
- padding.left += pagedFixedViewPadding;
- padding.right += pagedFixedViewPadding;
-
- pagedView.setPadding(padding.left, padding.top, padding.right, padding.bottom);
- fakePageContainer.setPadding(padding.left, padding.top, padding.right, padding.bottom);
-
- }
- }
-
// Layout the Overview Mode
ViewGroup overviewMode = launcher.getOverviewPanel();
if (overviewMode != null) {