summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2016-07-18 17:18:02 -0700
committerWinson <winsonc@google.com>2016-07-20 10:17:08 -0700
commit1f06427266c0cb5de4561fc7c620ff542f625300 (patch)
tree59869923b1a0affd0521eda603a85ccb64bbea53 /src/com/android/launcher3/allapps/AllAppsGridAdapter.java
parent5b3ace8e56988eb493a3423f9e25b29909fa50bf (diff)
downloadandroid_packages_apps_Trebuchet-1f06427266c0cb5de4561fc7c620ff542f625300.tar.gz
android_packages_apps_Trebuchet-1f06427266c0cb5de4561fc7c620ff542f625300.tar.bz2
android_packages_apps_Trebuchet-1f06427266c0cb5de4561fc7c620ff542f625300.zip
Initial changes to tweak layout.
- Adding DeviceProfile callback for when the launcher layout changes due to insets. This is necessary since there are now different layouts depending on which side the navigation bar is on - Consolidating hotseat and other layout into the device profile launcher layout logic - Making the all apps icons match the workspace icon height - Tweaking caret drawable to draw to the bounds specified to simplify layout in each orientation - Fixing minor issue with page indicator shifting in landscape - Centering overview buttons to the workspace page Bug: 30021487 Change-Id: I1866bce00b2948f3edd06168c0f88d81207e3f13
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsGridAdapter.java')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsGridAdapter.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
index 0f0c333f4..97c46b163 100644
--- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
+++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
@@ -20,6 +20,7 @@ import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
+import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.support.v4.view.accessibility.AccessibilityEventCompat;
@@ -37,6 +38,8 @@ import android.widget.TextView;
import com.android.launcher3.AppInfo;
import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.CellLayout;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -331,7 +334,9 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
private final boolean mIsRtl;
// Section drawing
+ @Deprecated
private final int mSectionNamesMargin;
+ @Deprecated
private final int mSectionHeaderOffset;
private final Paint mSectionTextPaint;
@@ -452,6 +457,14 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
icon.setLongPressTimeout(ViewConfiguration.get(parent.getContext())
.getLongPressTimeout());
icon.setOnFocusChangeListener(mIconFocusListener);
+
+ // Ensure the all apps icon height matches the workspace icons
+ DeviceProfile profile = mLauncher.getDeviceProfile();
+ Point cellSize = profile.getCellSize();
+ GridLayoutManager.LayoutParams lp =
+ (GridLayoutManager.LayoutParams) icon.getLayoutParams();
+ lp.height = cellSize.y;
+ icon.setLayoutParams(lp);
return new ViewHolder(icon);
}
case VIEW_TYPE_EMPTY_SEARCH: