summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Android Automerger <android-build@android.com>2010-06-03 16:21:09 -0700
committerThe Android Automerger <android-build@android.com>2010-06-03 16:21:09 -0700
commit059fe0c70e054af8703daa92330e8c59505aa8b5 (patch)
tree09ec952bbfe8de97b01efadf5cfde31b472e8a1f
parent02fcd9bec1a08057aeae8088d23b0176d6491290 (diff)
parent6662645a670b3197fb99df202a4650b946b867be (diff)
downloadandroid_packages_apps_Trebuchet-059fe0c70e054af8703daa92330e8c59505aa8b5.tar.gz
android_packages_apps_Trebuchet-059fe0c70e054af8703daa92330e8c59505aa8b5.tar.bz2
android_packages_apps_Trebuchet-059fe0c70e054af8703daa92330e8c59505aa8b5.zip
Merge branch 'froyo' into froyo-release
-rw-r--r--res/layout-land/all_apps_2d.xml63
-rw-r--r--res/layout-port/all_apps_2d.xml (renamed from res/layout/all_apps_2d.xml)4
-rw-r--r--res/values/dimens.xml4
-rw-r--r--src/com/android/launcher2/AllApps2D.java13
-rw-r--r--src/com/android/launcher2/LauncherModel.java4
5 files changed, 85 insertions, 3 deletions
diff --git a/res/layout-land/all_apps_2d.xml b/res/layout-land/all_apps_2d.xml
new file mode 100644
index 000000000..a253b937b
--- /dev/null
+++ b/res/layout-land/all_apps_2d.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Sapphire gets 2D all apps view -->
+<com.android.launcher2.AllApps2D
+ xmlns:android="http://schemas.android.com/apk/res/android"
+
+ android:id="@+id/all_apps_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="2dip"
+ >
+
+ <GridView android:id="@+id/all_apps_2d_grid"
+ android:tag="all_apps_2d_grid"
+ android:scrollbars="none"
+ android:drawSelectorOnTop="false"
+ android:listSelector="@drawable/grid_selector"
+ android:verticalSpacing="10dip"
+ android:numColumns="6"
+ android:fadingEdgeLength="48dip"
+ android:cacheColorHint="#FF000000"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="@dimen/button_bar_height_portrait"
+ android:nextFocusRight="@+id/all_apps_2d_home"
+ android:nextFocusUp="@null"
+ android:nextFocusLeft="@null"
+ android:nextFocusDown="@null"
+ />
+
+ <view
+ class="com.android.launcher2.AllApps2D$HomeButton"
+ android:id="@+id/all_apps_2d_home"
+ android:tag="all_apps_2d_home"
+ android:src="@drawable/home_button"
+ android:background="#FF000000"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:layout_height="wrap_content"
+ android:layout_width="@dimen/button_bar_height_portrait"
+ android:paddingBottom="@dimen/status_bar_height"
+ android:nextFocusLeft="@+id/all_apps_2d_grid"
+ android:nextFocusDown="@null"
+ android:nextFocusUp="@null"
+ android:nextFocusRight="@null"
+ />
+
+</com.android.launcher2.AllApps2D>
diff --git a/res/layout/all_apps_2d.xml b/res/layout-port/all_apps_2d.xml
index 7bbfa91e7..0607d62cc 100644
--- a/res/layout/all_apps_2d.xml
+++ b/res/layout-port/all_apps_2d.xml
@@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
- android:layout_marginBottom="28dip"
+ android:layout_marginBottom="@dimen/button_bar_height"
android:layout_marginTop="8dip"
android:nextFocusDown="@+id/all_apps_2d_home"
android:nextFocusUp="@null"
@@ -49,7 +49,7 @@
android:id="@+id/all_apps_2d_home"
android:tag="all_apps_2d_home"
android:src="@drawable/home_button"
- android:background="#00000000"
+ android:background="#FF000000"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 26cb7e630..790f83599 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -24,6 +24,10 @@
button_bar_height changes -->
<dimen name="button_bar_height_portrait">56dip</dimen>
+ <!-- roughly a status bar (for vertically centering the all apps
+ home icon in landscape) -->
+ <dimen name="status_bar_height">25dip</dimen>
+
<!-- roughly half a status bar (for vertically centering the right-hand
button cluster in landscape) -->
<dimen name="half_status_bar_height">12dip</dimen>
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java
index 90c87fb18..86571cfc7 100644
--- a/src/com/android/launcher2/AllApps2D.java
+++ b/src/com/android/launcher2/AllApps2D.java
@@ -20,6 +20,8 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
+import android.graphics.Bitmap;
+import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
@@ -49,6 +51,7 @@ public class AllApps2D
DragSource {
private static final String TAG = "Launcher.AllApps2D";
+ private static final boolean DEBUG = false;
private Launcher mLauncher;
private DragController mDragController;
@@ -100,7 +103,13 @@ public class AllApps2D
// }
final TextView textView = (TextView) convertView;
+ if (DEBUG) {
+ Log.d(TAG, "icon bitmap = " + info.iconBitmap
+ + " density = " + info.iconBitmap.getDensity());
+ }
+ info.iconBitmap.setDensity(Bitmap.DENSITY_NONE);
textView.setCompoundDrawablesWithIntrinsicBounds(null, new BitmapDrawable(info.iconBitmap), null, null);
+ textView.setBackgroundColor(Color.BLACK);
textView.setText(info.title);
return convertView;
@@ -118,13 +127,15 @@ public class AllApps2D
@Override
protected void onFinishInflate() {
- setBackgroundColor(0xFF000000);
+ setBackgroundColor(Color.BLACK);
try {
mGrid = (GridView)findViewWithTag("all_apps_2d_grid");
if (mGrid == null) throw new Resources.NotFoundException();
mGrid.setOnItemClickListener(this);
mGrid.setOnItemLongClickListener(this);
+ mGrid.setBackgroundColor(Color.BLACK);
+ mGrid.setCacheColorHint(Color.BLACK);
ImageButton homeButton = (ImageButton) findViewWithTag("all_apps_2d_home");
if (homeButton == null) throw new Resources.NotFoundException();
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 26671ad2c..d2cebc0d4 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -672,6 +672,10 @@ public class LauncherModel extends BroadcastReceiver {
// check & update map of what's occupied; used to discard overlapping/invalid items
private boolean checkItemPlacement(ItemInfo occupied[][][], ItemInfo item) {
+ if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+ return true;
+ }
+
for (int x = item.cellX; x < (item.cellX+item.spanX); x++) {
for (int y = item.cellY; y < (item.cellY+item.spanY); y++) {
if (occupied[item.screen][x][y] != null) {