summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget
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/widget
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/widget')
-rw-r--r--src/com/android/launcher3/widget/WidgetsContainerView.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java
index 8a58d3464..34bee1b47 100644
--- a/src/com/android/launcher3/widget/WidgetsContainerView.java
+++ b/src/com/android/launcher3/widget/WidgetsContainerView.java
@@ -20,7 +20,6 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
-import android.graphics.drawable.InsetDrawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView.State;
import android.util.AttributeSet;
@@ -32,7 +31,6 @@ import android.widget.Toast;
import com.android.launcher3.BaseContainerView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeleteDropTarget;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
import com.android.launcher3.folder.Folder;
@@ -62,6 +60,9 @@ public class WidgetsContainerView extends BaseContainerView
private DragController mDragController;
private IconCache mIconCache;
+ private final Rect mTmpBgPaddingRect = new Rect();
+ private final Rect mTmpRect = new Rect();
+
/* Recycler view related member variables */
private WidgetsRecyclerView mRecyclerView;
private WidgetsListAdapter mAdapter;
@@ -97,18 +98,24 @@ public class WidgetsContainerView extends BaseContainerView
mRecyclerView = (WidgetsRecyclerView) getContentView().findViewById(R.id.widgets_list_view);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+ }
- Rect bgPadding = new Rect();
- getRevealView().getBackground().getPadding(bgPadding);
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ getRevealView().getBackground().getPadding(mTmpBgPaddingRect);
if (Utilities.isRtl(getResources())) {
- getContentView().setPadding(0, bgPadding.top,
- bgPadding.right, bgPadding.bottom);
- mRecyclerView.updateBackgroundPadding(new Rect(bgPadding.left, 0, 0, 0));
+ getContentView().setPadding(0, mTmpBgPaddingRect.top, mTmpBgPaddingRect.right,
+ mTmpBgPaddingRect.bottom);
+ mTmpRect.set(mTmpBgPaddingRect.left, 0, 0, 0);
+ mRecyclerView.updateBackgroundPadding(mTmpRect);
} else {
- getContentView().setPadding(bgPadding.left, bgPadding.top,
- 0, bgPadding.bottom);
- mRecyclerView.updateBackgroundPadding(new Rect(0, 0, bgPadding.right, 0));
+ getContentView().setPadding(mTmpBgPaddingRect.left, mTmpBgPaddingRect.top, 0,
+ mTmpBgPaddingRect.bottom);
+ mTmpRect.set(0, 0, mTmpBgPaddingRect.right, 0);
+ mRecyclerView.updateBackgroundPadding(mTmpRect);
}
+
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
//