summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-19 02:19:31 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-19 02:20:34 +0000
commit50d4e62972f51be99a00aeae38aab9ea4dd065f3 (patch)
tree78e42c580240d002f96b20bd5ea7a3a916d0c18f
parentcdb1e61ac246649e6bb6049e969ff1414e13e650 (diff)
downloadpackages_apps_trebuchet-50d4e62972f51be99a00aeae38aab9ea4dd065f3.zip
packages_apps_trebuchet-50d4e62972f51be99a00aeae38aab9ea4dd065f3.tar.gz
packages_apps_trebuchet-50d4e62972f51be99a00aeae38aab9ea4dd065f3.tar.bz2
Fix post-merge breakage from the new 4.2 stuff
-rw-r--r--Android.mk1
-rw-r--r--res/layout-sw720dp/hotseat.xml8
-rw-r--r--res/layout-sw720dp/launcher.xml3
-rw-r--r--res/layout-sw720dp/search_bar.xml4
-rw-r--r--res/layout/custom_workspace_cling.xml6
-rw-r--r--res/values-sw720dp/dimens.xml3
-rw-r--r--res/values/dimens.xml4
-rw-r--r--src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java8
-rw-r--r--src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java3
-rw-r--r--src/com/cyanogenmod/trebuchet/CellLayout.java5
-rw-r--r--src/com/cyanogenmod/trebuchet/DeleteDropTarget.java1
-rw-r--r--src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java (renamed from src/com/android/launcher2/HideFromAccessibilityHelper.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java (renamed from src/com/android/launcher2/LauncherAnimUtils.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherModel.java2
-rw-r--r--src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java (renamed from src/com/android/launcher2/UserInitializeReceiver.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/Workspace.java1
16 files changed, 33 insertions, 28 deletions
diff --git a/Android.mk b/Android.mk
index 24e924f..2a427c2 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,7 +22,6 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := android-common android-support-v13
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
-LOCAL_SDK_VERSION := current
LOCAL_PACKAGE_NAME := Trebuchet
LOCAL_CERTIFICATE := shared
diff --git a/res/layout-sw720dp/hotseat.xml b/res/layout-sw720dp/hotseat.xml
index bcd5b9d..a6f636a 100644
--- a/res/layout-sw720dp/hotseat.xml
+++ b/res/layout-sw720dp/hotseat.xml
@@ -13,12 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Hotseat
+<com.cyanogenmod.trebuchet.Hotseat
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:cellCountX="@integer/hotseat_cell_count"
launcher:cellCountY="1">
- <com.android.launcher2.CellLayout
+ <com.cyanogenmod.trebuchet.CellLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -33,4 +33,4 @@
launcher:widthGap="@dimen/hotseat_width_gap"
launcher:heightGap="@dimen/hotseat_height_gap"
launcher:maxGap="@dimen/hotseat_width_gap" />
-</com.android.launcher2.Hotseat>
+</com.cyanogenmod.trebuchet.Hotseat>
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 2397612..fa946e0 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -16,7 +16,7 @@
<com.cyanogenmod.trebuchet.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:id="@+id/drag_layer"
android:background="@drawable/workspace_bg"
@@ -49,7 +49,6 @@
android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
- launcher:defaultScreen="2"
launcher:cellCountX="@integer/cell_count_x"
launcher:cellCountY="@integer/cell_count_y"
launcher:pageSpacing="@dimen/workspace_page_spacing"
diff --git a/res/layout-sw720dp/search_bar.xml b/res/layout-sw720dp/search_bar.xml
index ba0ff38..e979eac 100644
--- a/res/layout-sw720dp/search_bar.xml
+++ b/res/layout-sw720dp/search_bar.xml
@@ -15,7 +15,7 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
style="@style/SearchDropTargetBar"
android:layout_width="match_parent"
android:layout_height="@dimen/search_bar_height"
@@ -43,7 +43,7 @@
android:layout_height="match_parent"
android:src="@drawable/ic_home_search_normal_holo"
android:adjustViewBounds="true" />
- </com.android.launcher2.HolographicLinearLayout>
+ </com.cyanogenmod.trebuchet.HolographicLinearLayout>
<!-- Voice search icon -->
<com.cyanogenmod.trebuchet.HolographicLinearLayout
diff --git a/res/layout/custom_workspace_cling.xml b/res/layout/custom_workspace_cling.xml
index 0fdb575..8072343 100644
--- a/res/layout/custom_workspace_cling.xml
+++ b/res/layout/custom_workspace_cling.xml
@@ -14,9 +14,9 @@
limitations under the License.
-->
<!-- dummy layout, to be replaced in overlays -->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_custom">
@@ -29,4 +29,4 @@
android:gravity="left"
android:layout_gravity="bottom|left"
/>
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 439709a..80d4b3b 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -49,6 +49,9 @@
<integer name="apps_customize_maxCellCountY">-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) -->
+ <dimen name="status_bar_height">48dip</dimen>
+
<!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
<dimen name="wallpaper_chooser_grid_width">196dp</dimen>
<dimen name="wallpaper_chooser_grid_height">140dp</dimen>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 2afcdef..eb4e2cd 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -91,6 +91,10 @@
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">14dp</dimen>
+ <!-- roughly a status bar (for vertically centering the all apps
+ home icon in landscape) -->
+ <dimen name="status_bar_height">25dip</dimen>
+
<!-- Dragging -->
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
diff --git a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
index b951b8f..ad16d90 100644
--- a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
@@ -1899,7 +1899,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mSortMode = sortMode;
if (mSortMode == SortMode.Title) {
- Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
+ Collections.sort(mApps, LauncherModel.getAppNameComparator());
} else if (mSortMode == SortMode.InstallDate) {
Collections.sort(mApps, LauncherModel.APP_INSTALL_TIME_COMPARATOR);
}
@@ -1920,7 +1920,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
public void setApps(ArrayList<ApplicationInfo> list) {
mApps = list;
if (mSortMode == SortMode.Title) {
- Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
+ Collections.sort(mApps, LauncherModel.getAppNameComparator());
} else if (mSortMode == SortMode.InstallDate) {
Collections.sort(mApps, LauncherModel.APP_INSTALL_TIME_COMPARATOR);
}
@@ -2122,7 +2122,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
count = mNumWidgetPages;
}
- return String.format(mContext.getString(stringId), page + 1, count);
+ return String.format(getContext().getString(stringId), page + 1, count);
} else {
switch (mContentType) {
case Applications:
@@ -2132,7 +2132,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
stringId = R.string.apps_customize_widgets_scroll_format;
break;
}
- return String.format(mContext.getString(stringId), page + 1, getChildCount());
+ return String.format(getContext().getString(stringId), page + 1, getChildCount());
}
}
}
diff --git a/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java b/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java
index 63eb013..6e0d147 100644
--- a/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java
@@ -71,8 +71,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
};
- mLauncher = (Launcher) context;
-
// Preferences
mJoinWidgetsApps = PreferencesProvider.Interface.Drawer.getJoinWidgetsApps(context);
mFadeScrollingIndicator = PreferencesProvider.Interface.Drawer.Indicator.getFadeScrollingIndicator(context);
@@ -135,7 +133,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
tabView.setContentDescription(label);
tabView.setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
- mLauncher.onLongClickAppsTab(v);
return true;
}
});
diff --git a/src/com/cyanogenmod/trebuchet/CellLayout.java b/src/com/cyanogenmod/trebuchet/CellLayout.java
index b4b6b2e..63e98ad 100644
--- a/src/com/cyanogenmod/trebuchet/CellLayout.java
+++ b/src/com/cyanogenmod/trebuchet/CellLayout.java
@@ -975,8 +975,9 @@ public class CellLayout extends ViewGroup {
int numHeightGaps = mCountY - 1;
if (!LauncherApplication.isScreenLarge()){
- mCellWidth = (widthSpecSize - mPaddingLeft - mPaddingRight) / mCountX;
- mCellHeight = (heightSpecSize - mPaddingTop - mPaddingBottom) / mCountY;
+ Resources res = getResources();
+ mCellWidth = (widthSpecSize - res.getDimensionPixelSize(R.dimen.cell_layout_left_padding_land) - res.getDimensionPixelSize(R.dimen.cell_layout_right_padding_land) ) / mCountX;
+ mCellHeight = (heightSpecSize - res.getDimensionPixelSize(R.dimen.cell_layout_top_padding_land) - res.getDimensionPixelSize(R.dimen.cell_layout_bottom_padding_land) ) / mCountY;
}
if (mOriginalWidthGap < 0 || mOriginalHeightGap < 0) {
diff --git a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
index 860ada8..2cc872a 100644
--- a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
@@ -27,6 +27,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
diff --git a/src/com/android/launcher2/HideFromAccessibilityHelper.java b/src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java
index 0b2ce5b..e3c198d 100644
--- a/src/com/android/launcher2/HideFromAccessibilityHelper.java
+++ b/src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.view.View;
import android.view.ViewGroup;
@@ -110,4 +110,4 @@ public class HideFromAccessibilityHelper implements OnHierarchyChangeListener {
(v.getParent() instanceof ViewGroup &&
hasAncestorOfType((ViewGroup) v.getParent(), c)));
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/launcher2/LauncherAnimUtils.java b/src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java
index 9317c31..456c3c0 100644
--- a/src/com/android/launcher2/LauncherAnimUtils.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorSet;
diff --git a/src/com/cyanogenmod/trebuchet/LauncherModel.java b/src/com/cyanogenmod/trebuchet/LauncherModel.java
index 095b907..73b654e 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherModel.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherModel.java
@@ -1469,7 +1469,7 @@ public class LauncherModel extends BroadcastReceiver {
Log.d(TAG, "workspace layout: ");
for (int y = 0; y < mCellCountY; y++) {
String line = "";
- for (int s = 0; s < Launcher.SCREEN_COUNT; s++) {
+ for (int s = 0; s < Launcher.MAX_SCREEN_COUNT; s++) {
if (s > 0) {
line += " | ";
}
diff --git a/src/com/android/launcher2/UserInitializeReceiver.java b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
index bf3330a..db20ae9 100644
--- a/src/com/android/launcher2/UserInitializeReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.io.IOException;
import java.util.ArrayList;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
@@ -36,7 +36,7 @@ public class UserInitializeReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
final Resources resources = context.getResources();
// Context.getPackageName() may return the "original" package name,
- // com.android.launcher2; Resources needs the real package name,
+ // com.cyanogenmod.trebuchet; Resources needs the real package name,
// com.android.launcher. So we ask Resources for what it thinks the
// package name should be.
final String packageName = resources.getResourcePackageName(R.array.wallpapers);
diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java
index ab065b5..d8b39de 100644
--- a/src/com/cyanogenmod/trebuchet/Workspace.java
+++ b/src/com/cyanogenmod/trebuchet/Workspace.java
@@ -45,6 +45,7 @@ import android.os.Build;
import android.os.IBinder;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;