diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2015-07-23 21:24:37 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2015-07-23 21:24:37 -0700 |
commit | 0c0d54637af7109ae22e21a117dba3efdaded4b5 (patch) | |
tree | fe9ed94353b09dda232fceb64691f96dcd5db8d3 /src/com/android/launcher3/ShortcutAndWidgetContainer.java | |
parent | cf51139c6e1d57b57177109f2177edc41edf5bbc (diff) | |
parent | 13ef17a37e683b8ad5800e9f542b411180fbec2f (diff) | |
download | android_packages_apps_Trebuchet-0c0d54637af7109ae22e21a117dba3efdaded4b5.tar.gz android_packages_apps_Trebuchet-0c0d54637af7109ae22e21a117dba3efdaded4b5.tar.bz2 android_packages_apps_Trebuchet-0c0d54637af7109ae22e21a117dba3efdaded4b5.zip |
resolved conflicts for merge of 13ef17a3 to mnc-ub-dev
b/22609402
Change-Id: I80699d985088b9b79211284e710e8a6b8b90860b
Diffstat (limited to 'src/com/android/launcher3/ShortcutAndWidgetContainer.java')
-rw-r--r-- | src/com/android/launcher3/ShortcutAndWidgetContainer.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index bb5601e90..157b48a39 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -23,6 +23,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; +import android.view.ViewGroup.LayoutParams; public class ShortcutAndWidgetContainer extends ViewGroup { static final String TAG = "CellLayoutChildren"; @@ -44,10 +45,13 @@ public class ShortcutAndWidgetContainer extends ViewGroup { private int mCountX; private int mCountY; + private Launcher mLauncher; + private boolean mInvertIfRtl = false; public ShortcutAndWidgetContainer(Context context) { super(context); + mLauncher = (Launcher) context; mWallpaperManager = WallpaperManager.getInstance(context); } @@ -124,22 +128,19 @@ public class ShortcutAndWidgetContainer extends ViewGroup { } int getCellContentWidth() { - final LauncherAppState app = LauncherAppState.getInstance(); - final DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + final DeviceProfile grid = mLauncher.getDeviceProfile(); return Math.min(getMeasuredHeight(), mIsHotseatLayout ? grid.hotseatCellWidthPx: grid.cellWidthPx); } int getCellContentHeight() { - final LauncherAppState app = LauncherAppState.getInstance(); - final DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + final DeviceProfile grid = mLauncher.getDeviceProfile(); return Math.min(getMeasuredHeight(), mIsHotseatLayout ? grid.hotseatCellHeightPx : grid.cellHeightPx); } public void measureChild(View child) { - final LauncherAppState app = LauncherAppState.getInstance(); - final DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + final DeviceProfile grid = mLauncher.getDeviceProfile(); final int cellWidth = mCellWidth; final int cellHeight = mCellHeight; CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams(); @@ -168,12 +169,8 @@ public class ShortcutAndWidgetContainer extends ViewGroup { child.measure(childWidthMeasureSpec, childheightMeasureSpec); } - private boolean invertLayoutHorizontally() { - return mInvertIfRtl && isLayoutRtl(); - } - - public boolean isLayoutRtl() { - return (getLayoutDirection() == LAYOUT_DIRECTION_RTL); + public boolean invertLayoutHorizontally() { + return mInvertIfRtl && Utilities.isRtl(getResources()); } @Override |