Merge "7" launcher changes." into jb-dev
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
@@ -13,9 +13,8 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/SearchDropTargetBar"
|
||||
android:layout_width="@dimen/qsb_bar_height"
|
||||
android:layout_height="match_parent">
|
||||
<!-- Global search icon -->
|
||||
@@ -24,6 +23,7 @@
|
||||
android:id="@+id/search_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@drawable/ic_home_search_normal_holo"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onClickSearchButton"
|
||||
@@ -31,24 +31,17 @@
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/accessibility_search_button" />
|
||||
|
||||
<ImageView
|
||||
style="@style/SearchButtonDivider"
|
||||
android:id="@+id/search_divider"
|
||||
android:src="@drawable/divider_launcher_holo"
|
||||
android:onClick="onClickSearchButton"
|
||||
android:focusable="false"
|
||||
android:clickable="true" />
|
||||
|
||||
<!-- Voice search icon -->
|
||||
<com.android.launcher2.HolographicImageView
|
||||
style="@style/SearchButton"
|
||||
android:id="@+id/voice_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/ic_home_voice_search_holo"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onClickVoiceButton"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/accessibility_voice_search_button" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -17,22 +17,18 @@
|
||||
<resources>
|
||||
<dimen name="app_icon_padding_top">0dp</dimen>
|
||||
<dimen name="app_icon_drawable_padding_land">0dp</dimen>
|
||||
<integer name="app_icon_scale_percent">90</integer>
|
||||
|
||||
<!-- Hotseat -->
|
||||
<dimen name="hotseat_cell_width">75dp</dimen>
|
||||
<dimen name="hotseat_cell_height">75dp</dimen>
|
||||
<dimen name="workspace_icon_text_size">11sp</dimen>
|
||||
|
||||
<!-- Folders -->
|
||||
<!-- The size of the image which sits behind the preview of the folder contents -->
|
||||
<dimen name="folder_preview_size">70dp</dimen>
|
||||
<dimen name="folder_cell_width">86dp</dimen>
|
||||
<dimen name="folder_cell_height">86dp</dimen>
|
||||
<!-- Hotseat -->
|
||||
<dimen name="button_bar_width_left_padding">14dp</dimen>
|
||||
<dimen name="button_bar_width_right_padding">14dp</dimen>
|
||||
|
||||
<!-- AppsCustomize -->
|
||||
<dimen name="apps_customize_pageLayoutWidthGap">36dp</dimen>
|
||||
<dimen name="apps_customize_pageLayoutHeightGap">8dp</dimen>
|
||||
<dimen name="apps_customize_pageLayoutPaddingTop">20dp</dimen>
|
||||
<dimen name="apps_customize_pageLayoutPaddingBottom">14dp</dimen>
|
||||
|
||||
<!-- QSB -->
|
||||
<dimen name="qsb_bar_height">82dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Workspace -->
|
||||
<integer name="app_icon_scale_percent">-1</integer>
|
||||
|
||||
<!-- AppsCustomize -->
|
||||
<dimen name="apps_customize_cell_width">96dp</dimen>
|
||||
<dimen name="apps_customize_cell_height">96dp</dimen>
|
||||
@@ -26,8 +23,6 @@
|
||||
<dimen name="apps_customize_pageLayoutPaddingTop">25dp</dimen>
|
||||
<dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
|
||||
|
||||
<!-- Hotseat -->
|
||||
<dimen name="hotseat_cell_width">75dp</dimen>
|
||||
<dimen name="hotseat_cell_height">75dp</dimen>
|
||||
|
||||
<!-- QSB -->
|
||||
<dimen name="qsb_bar_height">54dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -15,26 +15,27 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="app_icon_size">72dp</dimen>
|
||||
<integer name="app_icon_hotseat_scale_percent">75</integer>
|
||||
<dimen name="app_icon_size">54dp</dimen>
|
||||
<dimen name="app_icon_drawable_padding">3dp</dimen>
|
||||
<dimen name="app_icon_padding_top">4dp</dimen>
|
||||
|
||||
<!-- Hotseat -->
|
||||
<dimen name="hotseat_cell_width">70dp</dimen>
|
||||
<dimen name="hotseat_cell_height">70dp</dimen>
|
||||
<dimen name="hotseat_width_gap">-1dp</dimen>
|
||||
<dimen name="hotseat_height_gap">-1dp</dimen>
|
||||
<dimen name="button_bar_height">82dip</dimen>
|
||||
<dimen name="button_bar_height_bottom_padding">0dp</dimen>
|
||||
<dimen name="button_bar_height_top_padding">0dp</dimen>
|
||||
<dimen name="button_bar_height_bottom_padding">10dp</dimen>
|
||||
<dimen name="button_bar_height_top_padding">20dp</dimen>
|
||||
<dimen name="button_bar_width_left_padding">33dp</dimen>
|
||||
<dimen name="button_bar_width_right_padding">33dp</dimen>
|
||||
<dimen name="button_bar_height_plus_padding">82dp</dimen>
|
||||
<dimen name="button_bar_height_plus_padding">92dp</dimen>
|
||||
|
||||
<!-- Folders -->
|
||||
<!-- The size of the image which sits behind the preview of the folder contents -->
|
||||
<dimen name="folder_preview_size">72dp</dimen>
|
||||
<dimen name="folder_cell_width">96dp</dimen>
|
||||
<dimen name="folder_cell_height">96dp</dimen>
|
||||
<dimen name="folder_preview_size">60dp</dimen>
|
||||
<dimen name="folder_cell_width">84dp</dimen>
|
||||
<dimen name="folder_cell_height">93dp</dimen>
|
||||
|
||||
<!-- AppsCustomize -->
|
||||
<dimen name="apps_customize_cell_width">96dp</dimen>
|
||||
@@ -47,10 +48,10 @@
|
||||
<dimen name="apps_customize_widget_cell_height_gap">36dp</dimen>
|
||||
|
||||
<!-- Workspace cell size -->
|
||||
<dimen name="workspace_cell_width_land">96dp</dimen>
|
||||
<dimen name="workspace_cell_width_port">96dp</dimen>
|
||||
<dimen name="workspace_cell_height_land">86dp</dimen>
|
||||
<dimen name="workspace_cell_height_port">96dp</dimen>
|
||||
<dimen name="workspace_cell_width_land">82dp</dimen>
|
||||
<dimen name="workspace_cell_width_port">82dp</dimen>
|
||||
<dimen name="workspace_cell_height_land">82dp</dimen>
|
||||
<dimen name="workspace_cell_height_port">82dp</dimen>
|
||||
<dimen name="workspace_width_gap_land">32dp</dimen>
|
||||
<dimen name="workspace_width_gap_port">0dp</dimen>
|
||||
<dimen name="workspace_height_gap_land">0dp</dimen>
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
<dimen name="app_widget_preview_padding_left">0dp</dimen>
|
||||
<dimen name="app_widget_preview_padding_top">10dp</dimen>
|
||||
|
||||
<!-- Size of icons in workspace -->
|
||||
<integer name="app_icon_scale_percent">-1</integer>
|
||||
<integer name="app_icon_hotseat_scale_percent">-1</integer>
|
||||
|
||||
<dimen name="all_apps_button_vertical_padding">4dip</dimen>
|
||||
|
||||
<!-- roughly a status bar (for determining how many rows of icons are in home) -->
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
<dimen name="apps_customize_tab_bar_height">52dp</dimen>
|
||||
<dimen name="apps_customize_tab_bar_margin_top">0dp</dimen>
|
||||
<dimen name="app_icon_size">48dp</dimen>
|
||||
<integer name="app_icon_scale_percent">-1</integer>
|
||||
<integer name="app_icon_hotseat_scale_percent">-1</integer>
|
||||
<!-- The width can be 72dp because we don't have L/R padding -->
|
||||
<dimen name="apps_customize_cell_width">74dp</dimen>
|
||||
<dimen name="apps_customize_cell_height">82dp</dimen>
|
||||
|
||||
@@ -136,8 +136,6 @@ public class CellLayout extends ViewGroup {
|
||||
private ShortcutAndWidgetContainer mShortcutsAndWidgets;
|
||||
|
||||
private boolean mIsHotseat = false;
|
||||
private float mChildScale = 1f;
|
||||
private float mHotseatChildScale = 1f;
|
||||
|
||||
public static final int MODE_DRAG_OVER = 0;
|
||||
public static final int MODE_ON_DROP = 1;
|
||||
@@ -214,15 +212,6 @@ public class CellLayout extends ViewGroup {
|
||||
mNormalBackground.setFilterBitmap(true);
|
||||
mActiveGlowBackground.setFilterBitmap(true);
|
||||
|
||||
int iconScale = res.getInteger(R.integer.app_icon_scale_percent);
|
||||
if (iconScale >= 0) {
|
||||
mChildScale = iconScale / 100f;
|
||||
}
|
||||
int hotseatIconScale = res.getInteger(R.integer.app_icon_hotseat_scale_percent);
|
||||
if (hotseatIconScale >= 0) {
|
||||
mHotseatChildScale = hotseatIconScale / 100f;
|
||||
}
|
||||
|
||||
// Initialize the data structures used for the drag visualization.
|
||||
|
||||
mEaseOutInterpolator = new DecelerateInterpolator(2.5f); // Quint ease out
|
||||
@@ -571,52 +560,19 @@ public class CellLayout extends ViewGroup {
|
||||
mIsHotseat = isHotseat;
|
||||
}
|
||||
|
||||
public float getChildrenScale() {
|
||||
return mIsHotseat ? mHotseatChildScale : mChildScale;
|
||||
}
|
||||
|
||||
|
||||
private void scaleChild(BubbleTextView bubbleChild, float scale) {
|
||||
// If we haven't measured the child yet, do it now
|
||||
// (this happens if we're being dropped from all-apps
|
||||
if (bubbleChild.getLayoutParams() instanceof LayoutParams &&
|
||||
(bubbleChild.getMeasuredWidth() | bubbleChild.getMeasuredHeight()) == 0) {
|
||||
getShortcutsAndWidgets().measureChild(bubbleChild);
|
||||
}
|
||||
|
||||
bubbleChild.setScaleX(scale);
|
||||
bubbleChild.setScaleY(scale);
|
||||
}
|
||||
|
||||
private void resetChild(BubbleTextView bubbleChild) {
|
||||
bubbleChild.setScaleX(1f);
|
||||
bubbleChild.setScaleY(1f);
|
||||
|
||||
bubbleChild.setTextColor(getResources().getColor(R.color.workspace_icon_text_color));
|
||||
}
|
||||
|
||||
public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
|
||||
boolean markCells) {
|
||||
final LayoutParams lp = params;
|
||||
|
||||
// Hotseat icons - scale down and remove text
|
||||
// Don't scale the all apps button
|
||||
// scale percent set to -1 means do not scale
|
||||
// Only scale BubbleTextViews
|
||||
// Hotseat icons - remove text
|
||||
if (child instanceof BubbleTextView) {
|
||||
BubbleTextView bubbleChild = (BubbleTextView) child;
|
||||
|
||||
// Start the child with 100% scale and visible text
|
||||
resetChild(bubbleChild);
|
||||
|
||||
if (mIsHotseat && mHotseatChildScale >= 0) {
|
||||
// Scale/make transparent for a hotseat
|
||||
scaleChild(bubbleChild, mHotseatChildScale);
|
||||
|
||||
bubbleChild.setTextColor(getResources().getColor(android.R.color.transparent));
|
||||
} else if (mChildScale >= 0) {
|
||||
// Else possibly still scale it if we need to for smaller icons
|
||||
scaleChild(bubbleChild, mChildScale);
|
||||
Resources res = getResources();
|
||||
if (mIsHotseat) {
|
||||
bubbleChild.setTextColor(res.getColor(android.R.color.transparent));
|
||||
} else {
|
||||
bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -462,20 +462,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||
float scale = getDescendantCoordRelativeToSelf((View) child.getParent(), coord);
|
||||
int toX = coord[0];
|
||||
int toY = coord[1];
|
||||
if (child instanceof TextView) {
|
||||
float childrenScale = parent.getChildrenScale();
|
||||
TextView tv = (TextView) child;
|
||||
|
||||
// The child may be scaled (always about the center of the view) so to account for it,
|
||||
// we have to offset the position by the scaled size. Once we do that, we can center
|
||||
// the drag view about the scaled child view.
|
||||
toY += Math.round(((1f - childrenScale) * child.getMeasuredHeight()) / 2 +
|
||||
scale * childrenScale * tv.getPaddingTop());
|
||||
toY -= dragView.getMeasuredHeight() * (1 - scale * childrenScale) / 2;
|
||||
toX -= (dragView.getMeasuredWidth() - Math.round(scale * child.getMeasuredWidth())) / 2;
|
||||
|
||||
scale *= childrenScale;
|
||||
} else if (child instanceof FolderIcon) {
|
||||
if (child instanceof FolderIcon) {
|
||||
// Account for holographic blur padding on the drag view
|
||||
toY -= Workspace.DRAG_BITMAP_PADDING / 2;
|
||||
// Center in the x coordinate about the target's drawable
|
||||
|
||||