diff options
author | cretin45 <cretin45@gmail.com> | 2015-11-13 16:51:43 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-11-23 12:10:32 -0800 |
commit | acab44fc939b4083ab7ec889b0c6d4fe0db00cca (patch) | |
tree | 6d7dd6d411404b804814ec4091e007f05dfd4ae5 /src/com/android/launcher3/DeviceProfile.java | |
parent | 35614fdc7d13179ba9cbc80f15eca6d63cf3229d (diff) | |
download | android_packages_apps_Trebuchet-acab44fc939b4083ab7ec889b0c6d4fe0db00cca.tar.gz android_packages_apps_Trebuchet-acab44fc939b4083ab7ec889b0c6d4fe0db00cca.tar.bz2 android_packages_apps_Trebuchet-acab44fc939b4083ab7ec889b0c6d4fe0db00cca.zip |
Reimplement the CM scrubber against the new Launcher
PS4: Implement RTL support
Change-Id: I4456d54b5924913d1b36e1cfa9a2269150f6fb3e
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 774594fe2..f77b34862 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -33,6 +33,8 @@ import android.view.ViewGroup.MarginLayoutParams; import android.widget.FrameLayout; import android.widget.LinearLayout; +import com.android.launcher3.allapps.AllAppsContainerView; + public class DeviceProfile { public final InvariantDeviceProfile inv; @@ -225,11 +227,13 @@ public class DeviceProfile { /** * @param recyclerViewWidth the available width of the AllAppsRecyclerView */ - public void updateAppsViewNumCols(Resources res, int recyclerViewWidth) { - int appsViewLeftMarginPx = - res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin); - int allAppsCellWidthGap = - res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap); + public void updateAppsViewNumCols(Resources res, int recyclerViewWidth, int gridStrategy) { + int appsViewLeftMarginPx = gridStrategy == AllAppsContainerView.SECTION_STRATEGY_GRID ? + res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin) : + res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin_with_sections); + int allAppsCellWidthGap = gridStrategy == AllAppsContainerView.SECTION_STRATEGY_GRID ? + res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap) : + res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap_with_sections); int availableAppsWidthPx = (recyclerViewWidth > 0) ? recyclerViewWidth : availableWidthPx; int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) / (allAppsIconSizePx + allAppsCellWidthGap); |