Skip to content

Commit

Permalink
Merge remote branch 'cm/cm-10.1' into cm-10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
androidarmv6-gerrit committed Dec 31, 2012
2 parents 39386cd + 535ae33 commit c980f1e
Show file tree
Hide file tree
Showing 19 changed files with 153 additions and 108 deletions.
16 changes: 8 additions & 8 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package="com.cyanogenmod.trebuchet"
android:versionName="@string/application_version">

<original-package android:name="com.android.launcher2" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="17" />

<permission
android:name="com.android.launcher.permission.PRELOAD_WORKSPACE"
Expand All @@ -39,19 +39,19 @@
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="dangerous"
android:label="@string/permlab_uninstall_shortcut"
android:description="@string/permdesc_uninstall_shortcut"/>
android:description="@string/permdesc_uninstall_shortcut" />
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_read_settings"
android:description="@string/permdesc_read_settings"/>
android:description="@string/permdesc_read_settings" />
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_write_settings"
android:description="@string/permdesc_write_settings"/>
android:description="@string/permdesc_write_settings" />

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
Expand Down Expand Up @@ -80,7 +80,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>

Expand Down Expand Up @@ -117,7 +117,7 @@
</activity>

<activity android:name="com.cyanogenmod.trebuchet.preference.HiddenAppsActivity"
android:label="@string/hidden_apps_title"/>
android:label="@string/hidden_apps_title" />

<!-- Intent received used to install shortcuts from other applications -->
<receiver
Expand Down Expand Up @@ -145,7 +145,7 @@
<action android:name="android.intent.action.USER_INITIALIZE" />
</intent-filter>
</receiver>

<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
android:name="com.cyanogenmod.trebuchet.LauncherProvider"
Expand All @@ -155,6 +155,6 @@
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />

<meta-data android:name="android.nfc.disable_beam_default"
android:value="true" />
android:value="true" />
</application>
</manifest>
5 changes: 5 additions & 0 deletions res/values-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_land</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_land</dimen>

<dimen name="workspace_left_padding_qsb_hidden">@dimen/workspace_left_padding_land_qsb_hidden</dimen>
<dimen name="workspace_right_padding_hotseat_hidden">@dimen/workspace_right_padding_land_hotseat_hidden</dimen>
<dimen name="workspace_top_padding_qsb_hidden">@dimen/workspace_top_padding_land_qsb_hidden</dimen>
<dimen name="workspace_bottom_padding_hotseat_hidden">@dimen/workspace_bottom_padding_land_hotseat_hidden</dimen>

<dimen name="app_icon_padding_top">6dp</dimen>

<!-- height of the bottom row of controls -->
Expand Down
5 changes: 5 additions & 0 deletions res/values-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_port</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_port</dimen>

<dimen name="workspace_left_padding_qsb_hidden">@dimen/workspace_left_padding_port_qsb_hidden</dimen>
<dimen name="workspace_right_padding_hotseat_hidden">@dimen/workspace_right_padding_port_hotseat_hidden</dimen>
<dimen name="workspace_top_padding_qsb_hidden">@dimen/workspace_top_padding_port_qsb_hidden</dimen>
<dimen name="workspace_bottom_padding_hotseat_hidden">@dimen/workspace_bottom_padding_port_hotseat_hidden</dimen>

<dimen name="workspace_page_spacing">-1dp</dimen>

<!-- AppsCustomize -->
Expand Down
9 changes: 9 additions & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
<dimen name="workspace_bottom_padding_port">@dimen/button_bar_height</dimen>
<dimen name="workspace_bottom_padding_land">0dp</dimen>

<dimen name="workspace_left_padding_port_qsb_hidden">0dp</dimen>
<dimen name="workspace_left_padding_land_qsb_hidden">0dp</dimen>
<dimen name="workspace_top_padding_port_qsb_hidden">0dp</dimen>
<dimen name="workspace_top_padding_land_qsb_hidden">0dp</dimen>
<dimen name="workspace_right_padding_port_hotseat_hidden">0dp</dimen>
<dimen name="workspace_right_padding_land_hotseat_hidden">0dp</dimen>
<dimen name="workspace_bottom_padding_port_hotseat_hidden">0dp</dimen>
<dimen name="workspace_bottom_padding_land_hotseat_hidden">0dp</dimen>

<!-- Workspace cell size -->
<dimen name="workspace_cell_width_land">106dp</dimen>
<dimen name="workspace_cell_width_port">80dp</dimen>
Expand Down
2 changes: 2 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ s -->

<!-- Dock -->
<string name="preferences_interface_dock_title">Dock</string>
<string name="preferences_interface_dock_enabled_title">Show dock</string>
<string name="preferences_interface_dock_enabled_summary">Show the dock underneath the homescreen</string>
<string name="preferences_interface_dock_pages_title">Pages</string>
<string name="preferences_interface_dock_pages_summary">Number of pages in the dock</string>
<string name="preferences_interface_dock_default_page_title">Default page</string>
Expand Down
9 changes: 9 additions & 0 deletions res/xml/preferences_dock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,42 @@
xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:key="ui_dock"
android:title="@string/preferences_interface_dock_title">
<!--<CheckBoxPreference android:key="ui_dock_enabled"
android:title="@string/preferences_interface_dock_enabled_title"
android:summary="@string/preferences_interface_dock_enabled_summary"
android:defaultValue="true" />-->
<com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_pages"
android:title="@string/preferences_interface_dock_pages_title"
android:summary="@string/preferences_interface_dock_pages_summary"
android:defaultValue="1"
launcher:max="3"
launcher:min="1" />
<!-- android:dependency="ui_dock_enabled" /-->
<com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_default_page"
android:title="@string/preferences_interface_dock_default_page_title"
android:summary="@string/preferences_interface_dock_default_page_summary"
android:defaultValue="1"
launcher:maxExternal="ui_dock_pages"
launcher:max="3"
launcher:min="1" />
<!-- android:dependency="ui_dock_enabled" /-->
<com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_icons"
android:title="@string/preferences_interface_dock_icons_title"
android:summary="@string/preferences_interface_dock_icons_summary"
android:defaultValue="@integer/hotseat_cell_count"
launcher:max="@integer/hotseat_cell_count"
launcher:min="3" />
<!-- android:dependency="ui_dock_enabled" /-->
<com.cyanogenmod.trebuchet.preference.SeekBarDialogPreference android:key="ui_dock_icon_scale"
android:title="@string/preferences_interface_dock_icon_scale_title"
android:summary="@string/preferences_interface_dock_icon_scale_summary"
launcher:min="80"
launcher:max="100"
android:defaultValue="@integer/hotseat_item_scale_percentage" />
<!-- android:dependency="ui_dock_enabled" /-->
<CheckBoxPreference android:key="ui_dock_divider"
android:title="@string/preferences_interface_dock_divider_title"
android:summary="@string/preferences_interface_dock_divider_summary"
android:defaultValue="true" />
<!-- android:dependency="ui_dock_enabled" /-->
</PreferenceScreen>
12 changes: 6 additions & 6 deletions src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ protected void onDataReady(int width, int height) {
int maxCellCountX = Integer.MAX_VALUE;
int maxCellCountY = Integer.MAX_VALUE;
if (LauncherApplication.isScreenLarge()) {
maxCellCountX = (isLandscape ? LauncherModel.getCellCountX() :
LauncherModel.getCellCountY());
maxCellCountY = (isLandscape ? LauncherModel.getCellCountY() :
LauncherModel.getCellCountX());
maxCellCountX = (isLandscape ? LauncherModel.getWorkspaceCellCountX() :
LauncherModel.getWorkspaceCellCountY());
maxCellCountY = (isLandscape ? LauncherModel.getWorkspaceCellCountY() :
LauncherModel.getWorkspaceCellCountX());
}
if (mMaxAppCellCountX > -1) {
maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX);
Expand Down Expand Up @@ -653,8 +653,8 @@ public void onPackagesUpdated() {
int[] minSpanXY = Launcher.getMinSpanForWidget(mLauncher, widget);
int minSpanX = Math.min(spanXY[0], minSpanXY[0]);
int minSpanY = Math.min(spanXY[1], minSpanXY[1]);
if (minSpanX <= LauncherModel.getCellCountX() &&
minSpanY <= LauncherModel.getCellCountY()) {
if (minSpanX <= LauncherModel.getWorkspaceCellCountX() &&
minSpanY <= LauncherModel.getWorkspaceCellCountY()) {
mWidgets.add(widget);
} else {
Log.e(TAG, "Widget " + widget.provider + " can not fit on this device (" +
Expand Down
5 changes: 2 additions & 3 deletions src/com/cyanogenmod/trebuchet/CellLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public CellLayout(Context context, AttributeSet attrs, int defStyle) {
mWidthGap = mOriginalWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, 0);
mHeightGap = mOriginalHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, 0);
mMaxGap = a.getDimensionPixelSize(R.styleable.CellLayout_maxGap, 0);
mCountX = LauncherModel.getCellCountX();
mCountY = LauncherModel.getCellCountY();
mCountX = LauncherModel.getWorkspaceCellCountX();
mCountY = LauncherModel.getWorkspaceCellCountY();
mOccupied = new boolean[mCountX][mCountY];
mTmpOccupied = new boolean[mCountX][mCountY];
mPreviousReorderDirection[0] = INVALID_DIRECTION;
Expand Down Expand Up @@ -614,7 +614,6 @@ public boolean addViewToCellLayout(View child, int index, int childId, LayoutPar
boolean markCells) {
final LayoutParams lp = params;

// Hotseat icons - remove text
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;

Expand Down
22 changes: 0 additions & 22 deletions src/com/cyanogenmod/trebuchet/DragLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -702,28 +702,6 @@ private void updateChildIndices() {
}
}

@Override
protected int getChildDrawingOrder(int childCount, int i) {
// TODO: We have turned off this custom drawing order because it now effects touch
// dispatch order. We need to sort that issue out and then decide how to go about this.
if (true || LauncherApplication.isScreenLandscape(getContext()) ||
mWorkspaceIndex == -1 || mQsbIndex == -1 ||
mLauncher.getWorkspace().isDrawingBackgroundGradient()) {
return i;
}

// This ensures that the workspace is drawn above the hotseat and qsb,
// except when the workspace is drawing a background gradient, in which
// case we want the workspace to stay behind these elements.
if (i == mQsbIndex) {
return mWorkspaceIndex;
} else if (i == mWorkspaceIndex) {
return mQsbIndex;
} else {
return i;
}
}

private boolean mInScrollArea;
private Drawable mLeftHoverDrawable;
private Drawable mRightHoverDrawable;
Expand Down
5 changes: 2 additions & 3 deletions src/com/cyanogenmod/trebuchet/Folder.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cyanogenmod.trebuchet.R;
import com.cyanogenmod.trebuchet.FolderInfo.FolderListener;
import com.cyanogenmod.trebuchet.preference.PreferencesProvider;

Expand Down Expand Up @@ -128,8 +127,8 @@ public Folder(Context context, AttributeSet attrs) {
mMaxCountY = res.getInteger(R.integer.folder_max_count_y);
mMaxNumItems = res.getInteger(R.integer.folder_max_num_items);
if (mMaxCountX < 0 || mMaxCountY < 0 || mMaxNumItems < 0) {
mMaxCountX = LauncherModel.getCellCountX();
mMaxCountY = LauncherModel.getCellCountY();
mMaxCountX = LauncherModel.getWorkspaceCellCountX();
mMaxCountY = LauncherModel.getWorkspaceCellCountY();
mMaxNumItems = mMaxCountX * mMaxCountY;
}

Expand Down
10 changes: 2 additions & 8 deletions src/com/cyanogenmod/trebuchet/Hotseat.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public Hotseat(Context context, AttributeSet attrs, int defStyle) {
mCellCount = a.getInt(R.styleable.Hotseat_cellCount, DEFAULT_CELL_COUNT);
mCellCount = PreferencesProvider.Interface.Dock.getNumberIcons(mCellCount);

LauncherModel.updateHotseatLayoutCells(mCellCount);

mVertical = hasVerticalHotseat();


Expand Down Expand Up @@ -214,14 +216,6 @@ public void setChildrenOutlineAlpha(float alpha) {
}
}

/**
* Return the current {@link CellLayout}, correctly picking the destination
* screen while a scroll is in progress.
*/
public CellLayout getCurrentDropLayout() {
return (CellLayout) getChildAt(getNextPage());
}

@Override
protected void onFinishInflate() {
super.onFinishInflate();
Expand Down
13 changes: 6 additions & 7 deletions src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import android.content.pm.PackageManager;
import android.widget.Toast;

import com.cyanogenmod.trebuchet.R;
import com.cyanogenmod.trebuchet.preference.PreferencesProvider;

import java.util.ArrayList;
Expand Down Expand Up @@ -92,8 +91,8 @@ public void onReceive(Context context, Intent data) {
}
}
// Queue the item up for adding if launcher has not loaded properly yet
boolean launcherNotLoaded = LauncherModel.getCellCountX() <= 0 ||
LauncherModel.getCellCountY() <= 0;
boolean launcherNotLoaded = LauncherModel.getWorkspaceCellCountX() <= 0 ||
LauncherModel.getWorkspaceCellCountY() <= 0;

PendingInstallShortcutInfo info = new PendingInstallShortcutInfo(data, name, intent);
if (mUseInstallQueue || launcherNotLoaded) {
Expand Down Expand Up @@ -167,7 +166,7 @@ private static boolean installShortcut(Context context, Intent data, ArrayList<I
String name, Intent intent, final int screen, boolean shortcutExists,
final SharedPreferences sharedPrefs, int[] result) {
int[] tmpCoordinates = new int[2];
if (findEmptyCell(context, items, tmpCoordinates, screen)) {
if (findEmptyCell(items, tmpCoordinates, screen)) {
if (intent != null) {
if (intent.getAction() == null) {
intent.setAction(Intent.ACTION_VIEW);
Expand Down Expand Up @@ -225,10 +224,10 @@ public void run() {
return false;
}

private static boolean findEmptyCell(Context context, ArrayList<ItemInfo> items, int[] xy,
private static boolean findEmptyCell(ArrayList<ItemInfo> items, int[] xy,
int screen) {
final int xCount = LauncherModel.getCellCountX();
final int yCount = LauncherModel.getCellCountY();
final int xCount = LauncherModel.getWorkspaceCellCountX();
final int yCount = LauncherModel.getWorkspaceCellCountY();
boolean[][] occupied = new boolean[xCount][yCount];

int cellX, cellY, spanX, spanY;
Expand Down
Loading

0 comments on commit c980f1e

Please sign in to comment.