summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values-fr/strings.xml12
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/preferences.xml11
-rw-r--r--src/com/cyanogenmod/trebuchet/AllAppsButtonInfo.java35
-rw-r--r--src/com/cyanogenmod/trebuchet/DeleteDropTarget.java7
-rw-r--r--src/com/cyanogenmod/trebuchet/DragController.java10
-rw-r--r--src/com/cyanogenmod/trebuchet/Hotseat.java37
-rw-r--r--src/com/cyanogenmod/trebuchet/ItemInfo.java1
-rw-r--r--src/com/cyanogenmod/trebuchet/Launcher.java2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherModel.java13
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherSettings.java5
-rw-r--r--src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java10
-rw-r--r--src/com/cyanogenmod/trebuchet/Workspace.java23
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/Preferences.java4
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java14
15 files changed, 164 insertions, 22 deletions
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index b34b58e..961cee4 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -28,7 +28,7 @@
<string name="activity_not_found" msgid="217823393239365967">"L\'application n\'est pas installée."</string>
<string name="widgets_tab_label" msgid="9145860100000983599">"Widgets"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Appuyez de manière prolongée pour ajouter widget."</string>
- <string name="market" msgid="2652226429823445833">"Acheter"</string>
+ <string name="market" msgid="2652226429823445833">"Google Play Store"</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Impossible de déposer élément sur écran d\'accueil."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Sélectionnez le widget à créer"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nom du dossier"</string>
@@ -54,6 +54,7 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Supprimer"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Désinstaller"</string>
<string name="delete_target_label" msgid="665300185123139530">"Supprimer"</string>
+ <string name="cancel_target_label">"Annuler"</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Désinstaller"</string>
<string name="info_target_label" msgid="4019495079517426980">"Informations sur l\'application"</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Rechercher"</string>
@@ -67,7 +68,10 @@
<string name="menu_search" msgid="4826514464423239041">"Rechercher"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Notifications"</string>
<string name="menu_settings" msgid="3946232973327980394">"Paramètres système"</string>
+ <string name="menu_preferences">"Paramètres de Trebuchet"</string>
<string name="menu_help" msgid="4901160661634590633">"Aide"</string>
+ <string name="menu_apps_sort_title">"Nom"</string>
+ <string name="menu_apps_sort_install_date">"Date d\'installation"</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Désinstaller l\'application"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Détails de l\'application"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 application sélectionnée."</string>
@@ -96,6 +100,8 @@
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Pour voir toutes vos applications, appuyez sur le cercle."</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"Sélectionner des applications"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Pour ajouter une application à votre écran d\'accueil, appuyez dessus de manière prolongée."</string>
+ <string name="all_apps_sort_cling_title">"Triez vos applications"</string>
+ <string name="all_apps_sort_cling_add_item">"Appuyez de manière prolongée sur l\'onglet Application pour sélectionner votre méthode de tri"</string>
<string name="folder_cling_title" msgid="4308949882377840953">"Organisez vos applications en dossiers"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"Pour déplacer une application, appuyez dessus de manière prolongée."</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Pour créer un dossier sur votre écran d\'accueil, superposez les applications les unes sur les autres."</string>
@@ -138,7 +144,7 @@
<string name="preferences_interface_homescreen_general_screen_padding_horizontal_title">Marge horizontale</string>
<string name="preferences_interface_homescreen_general_screen_padding_horizontal_summary">Espacement supplémentaire horizontal</string>
<string name="preferences_interface_homescreen_general_search_summary">Activer la barre de recherche persistante</string>
- <string name="preferences_interface_homescreen_general_resize_any_widget_title">Redimensionner tout les widgets</string>
+ <string name="preferences_interface_homescreen_general_resize_any_widget_title">Redimensionner tous les widgets</string>
<string name="preferences_interface_homescreen_general_resize_any_widget_summary">Permet de redimensionner les widgets qui normalement n\'en sont pas capables</string>
<string name="preferences_interface_homescreen_general_hide_icon_labels_title">Sans libellés</string>
<string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Cacher le libellé des icônes de l\'écran d\'accueil</string>
@@ -166,6 +172,8 @@
<!-- Dock -->
<string name="preferences_interface_dock_title">Barre de Dock</string>
+ <string name="preferences_interface_dock_size_title">Icônes du dock</string>
+ <string name="preferences_interface_dock_size_summary">Définir le nombre d\'icône du dock</string>
<!-- Icons -->
<string name="preferences_interface_icons_title">Icônes</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a866a0e..300364a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -345,6 +345,8 @@ s -->
<!-- Dock -->
<string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_size_title">Dock icons</string>
+ <string name="preferences_interface_dock_size_summary">Choose the number of icons in the dock</string>
<!-- Icons -->
<string name="preferences_interface_icons_title">Icons</string>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index 5ec6a95..3023f60 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -115,10 +115,15 @@
</PreferenceScreen>
<!-- Dock -->
- <!-- <PreferenceScreen android:key="ui_dock"
+ <PreferenceScreen android:key="ui_dock"
android:title="@string/preferences_interface_dock_title">
-
- </PreferenceScreen> -->
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_hotseat_size"
+ android:title="@string/preferences_interface_dock_size_title"
+ android:summary="@string/preferences_interface_dock_size_summary"
+ android:defaultValue="@integer/hotseat_cell_count"
+ launcher:max="9"
+ launcher:min="1" />
+ </PreferenceScreen>
<!-- Icons -->
<!-- <PreferenceScreen android:key="ui_icons"
diff --git a/src/com/cyanogenmod/trebuchet/AllAppsButtonInfo.java b/src/com/cyanogenmod/trebuchet/AllAppsButtonInfo.java
new file mode 100644
index 0000000..b4ebe10
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/AllAppsButtonInfo.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+package com.cyanogenmod.trebuchet;
+
+/**
+ * Represents the AllApps button in hotseat
+ */
+class AllAppsButtonInfo extends ItemInfo {
+
+ AllAppsButtonInfo() {
+ itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_ALLAPPS;
+ }
+
+ @Override
+ public String toString() {
+ return "AllAppsButtonInfo(id=" + this.id + " type=" + this.itemType
+ + " container=" + this.container + " screen=" + screen
+ + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX + " spanY=" + spanY
+ + " isGesture=" + isGesture + " dropPos=" + dropPos + ")";
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
index 2cc872a..c4bacfe 100644
--- a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
@@ -131,6 +131,9 @@ public class DeleteDropTarget extends ButtonDropTarget {
private boolean isWorkspaceFolder(DragSource source, Object info) {
return (source instanceof Workspace) && (info instanceof FolderInfo);
}
+ private boolean isAllAppsButton(Object info) {
+ return (info instanceof AllAppsButtonInfo);
+ }
private void setHoverColor() {
setTextColor(mHoverColor);
@@ -147,6 +150,10 @@ public class DeleteDropTarget extends ButtonDropTarget {
@Override
public void onDragStart(DragSource source, Object info, int dragAction) {
+ // If it's the AllApps button, from Hotseat, don't do anything.
+ if (isAllAppsButton(info)) {
+ return;
+ }
boolean isUninstall = false;
// If we are dragging an application from AppsCustomize, only show the uninstall control if we
diff --git a/src/com/cyanogenmod/trebuchet/DragController.java b/src/com/cyanogenmod/trebuchet/DragController.java
index cdb5060..ba41780 100644
--- a/src/com/cyanogenmod/trebuchet/DragController.java
+++ b/src/com/cyanogenmod/trebuchet/DragController.java
@@ -34,6 +34,7 @@ import android.view.ViewConfiguration;
import android.view.inputmethod.InputMethodManager;
import com.cyanogenmod.trebuchet.R;
+import com.cyanogenmod.trebuchet.DropTarget.DragObject;
import java.util.ArrayList;
@@ -442,7 +443,7 @@ public class DragController {
case MotionEvent.ACTION_UP:
mLastTouchUpTime = System.currentTimeMillis();
if (mDragging) {
- PointF vec = isFlingingToDelete(mDragObject.dragSource);
+ PointF vec = isFlingingToDelete(mDragObject);
if (vec != null) {
dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
} else {
@@ -584,7 +585,7 @@ public class DragController {
mHandler.removeCallbacks(mScrollRunnable);
if (mDragging) {
- PointF vec = isFlingingToDelete(mDragObject.dragSource);
+ PointF vec = isFlingingToDelete(mDragObject);
if (vec != null) {
dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
} else {
@@ -607,9 +608,10 @@ public class DragController {
*
* @return the vector at which the item was flung, or null if no fling was detected.
*/
- private PointF isFlingingToDelete(DragSource source) {
+ private PointF isFlingingToDelete(DragObject object) {
if (mFlingToDeleteDropTarget == null) return null;
- if (!source.supportsFlingToDelete()) return null;
+ if (!object.dragSource.supportsFlingToDelete()) return null;
+ if (object.dragInfo instanceof AllAppsButtonInfo) return null;
ViewConfiguration config = ViewConfiguration.get(mLauncher);
mVelocityTracker.computeCurrentVelocity(1000, config.getScaledMaximumFlingVelocity());
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java
index 7463d65..ce2e0fa 100644
--- a/src/com/cyanogenmod/trebuchet/Hotseat.java
+++ b/src/com/cyanogenmod/trebuchet/Hotseat.java
@@ -26,6 +26,8 @@ import android.view.View;
import android.widget.FrameLayout;
import com.cyanogenmod.trebuchet.R;
+import com.cyanogenmod.trebuchet.preference.Preferences;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
public class Hotseat extends FrameLayout {
@SuppressWarnings("unused")
@@ -55,11 +57,26 @@ public class Hotseat extends FrameLayout {
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.Hotseat, defStyle, 0);
- mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
- mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
- mAllAppsButtonRank = context.getResources().getInteger(R.integer.hotseat_all_apps_index);
+
+ int numberHotseatIcons = PreferencesProvider.Interface.Dock.getNumberHotseatIcons(context);
+ int defaultHotseatIcon = PreferencesProvider.Interface.Dock.getDefaultHotseatIcon(context,
+ context.getResources().getInteger(R.integer.hotseat_all_apps_index));
+ if (defaultHotseatIcon >= numberHotseatIcons) {
+ defaultHotseatIcon = numberHotseatIcons - 1;
+ PreferencesProvider.Interface.Dock.setDefaultHotseatIcon(context, defaultHotseatIcon);
+ }
+
mIsLandscape = context.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
+
+ if (mIsLandscape) {
+ mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
+ mCellCountY = numberHotseatIcons;
+ } else {
+ mCellCountX = numberHotseatIcons;
+ mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
+ }
+ mAllAppsButtonRank = defaultHotseatIcon;
}
public void setup(Launcher launcher) {
@@ -129,10 +146,24 @@ public class Hotseat extends FrameLayout {
}
});
+ allAppsButton.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ if (mLauncher != null) {
+ return mLauncher.onLongClick(v);
+ }
+ return false;
+ }
+ });
+
// Note: We do this to ensure that the hotseat is always laid out in the orientation of
// the hotseat in order regardless of which orientation they were added
int x = getCellXFromOrder(mAllAppsButtonRank);
int y = getCellYFromOrder(mAllAppsButtonRank);
+ AllAppsButtonInfo allAppsButtonInfo = new AllAppsButtonInfo();
+ allAppsButtonInfo.cellX = x;
+ allAppsButtonInfo.cellY = y;
+ allAppsButton.setTag(allAppsButtonInfo);
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(x,y,1,1);
lp.canReorder = false;
mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true);
diff --git a/src/com/cyanogenmod/trebuchet/ItemInfo.java b/src/com/cyanogenmod/trebuchet/ItemInfo.java
index c76108f..75d0578 100644
--- a/src/com/cyanogenmod/trebuchet/ItemInfo.java
+++ b/src/com/cyanogenmod/trebuchet/ItemInfo.java
@@ -39,6 +39,7 @@ class ItemInfo {
/**
* One of {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION},
* {@link LauncherSettings.Favorites#ITEM_TYPE_SHORTCUT},
+ * {@link LauncherSettings.Favorites#ITEM_TYPE_ALLAPPS},
* {@link LauncherSettings.Favorites#ITEM_TYPE_FOLDER}, or
* {@link LauncherSettings.Favorites#ITEM_TYPE_APPWIDGET}.
*/
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index f32b11c..da1778a 100644
--- a/src/com/cyanogenmod/trebuchet/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -2379,7 +2379,7 @@ public final class Launcher extends Activity
}
public boolean isAllAppsButtonRank(int rank) {
- return mHotseat.isAllAppsButtonRank(rank);
+ return (mHotseat != null) ? mHotseat.isAllAppsButtonRank(rank) : false;
}
// AllAppsView.Watcher
diff --git a/src/com/cyanogenmod/trebuchet/LauncherModel.java b/src/com/cyanogenmod/trebuchet/LauncherModel.java
index 6ada4de..e49c191 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherModel.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherModel.java
@@ -49,6 +49,7 @@ import android.util.Log;
import com.cyanogenmod.trebuchet.R;
import com.cyanogenmod.trebuchet.InstallWidgetReceiver.WidgetMimeTypeHandlerData;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
@@ -1059,13 +1060,15 @@ public class LauncherModel extends BroadcastReceiver {
// We use the last index to refer to the hotseat and the screen as the rank, so
// test and update the occupied state accordingly
- if (occupied[Launcher.MAX_SCREEN_COUNT][item.screen][0] != null) {
+ if (occupied[PreferencesProvider.Interface.Homescreen.getNumberHomescreens(mContext)]
+ [item.screen][0] != null) {
Log.e(TAG, "Error loading shortcut into hotseat " + item
+ " into position (" + item.screen + ":" + item.cellX + "," + item.cellY
+ ") occupied by " + occupied[Launcher.MAX_SCREEN_COUNT][item.screen][0]);
return false;
} else {
- occupied[Launcher.MAX_SCREEN_COUNT][item.screen][0] = item;
+ occupied[PreferencesProvider.Interface.Homescreen.getNumberHomescreens(mContext)]
+ [item.screen][0] = item;
return true;
}
} else if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
@@ -1114,8 +1117,10 @@ public class LauncherModel extends BroadcastReceiver {
sBgItemsIdMap.clear();
sBgDbIconCache.clear();
+ int numberHotseatIcons = PreferencesProvider.Interface.Dock.getNumberHotseatIcons(mContext);
final ItemInfo occupied[][][] =
- new ItemInfo[Launcher.MAX_SCREEN_COUNT + 1][mCellCountX + 1][mCellCountY + 1];
+ new ItemInfo[PreferencesProvider.Interface.Homescreen.getNumberHomescreens(mContext) + 1]
+ [Math.max(mCellCountX, numberHotseatIcons)][mCellCountY];
final ArrayList<Long> itemsToRemove = new ArrayList<Long>();
@@ -1208,6 +1213,8 @@ public class LauncherModel extends BroadcastReceiver {
// check & update map of what's occupied
if (!checkItemPlacement(occupied, info)) {
+ id = c.getLong(idIndex);
+ itemsToRemove.add(id);
break;
}
diff --git a/src/com/cyanogenmod/trebuchet/LauncherSettings.java b/src/com/cyanogenmod/trebuchet/LauncherSettings.java
index 361dd69..1cc1303 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherSettings.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherSettings.java
@@ -56,6 +56,11 @@ class LauncherSettings {
static final int ITEM_TYPE_SHORTCUT = 1;
/**
+ * The gesture is the All Apps button
+ */
+ static final int ITEM_TYPE_ALLAPPS = 5;
+
+ /**
* The icon type.
* <P>Type: INTEGER</P>
*/
diff --git a/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java b/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java
index 7811255..2a96517 100644
--- a/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java
+++ b/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java
@@ -188,11 +188,21 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
return sTransitionOutDuration;
}
+ private boolean isAllAppsButton(Object info) {
+ return (info instanceof AllAppsButtonInfo);
+ }
+
/*
* DragController.DragListener implementation
*/
@Override
public void onDragStart(DragSource source, Object info, int dragAction) {
+ // If it's the AllApps button, from Hotseat, don't do anything.
+ if (isAllAppsButton(info)) {
+ deferOnDragEnd();
+ return;
+ }
+
// Animate out the QSB search bar, and animate in the drop target bar
prepareStartAnimation(mDropTargetBar);
mDropTargetBarAnim.start();
diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java
index cfe7912..363e474 100644
--- a/src/com/cyanogenmod/trebuchet/Workspace.java
+++ b/src/com/cyanogenmod/trebuchet/Workspace.java
@@ -2394,8 +2394,17 @@ public class Workspace extends SmoothPagedView
}
}
- LauncherModel.moveItemInDatabase(mLauncher, info, container, screen, lp.cellX,
- lp.cellY);
+ // No_id check required as the AllApps button doesn't have an item info id
+ if (info.id != ItemInfo.NO_ID) {
+ LauncherModel.moveItemInDatabase(mLauncher, info, container, screen, lp.cellX,
+ lp.cellY);
+ } else if (info instanceof AllAppsButtonInfo) {
+ if (!LauncherApplication.isScreenLandscape(getContext())) {
+ PreferencesProvider.Interface.Dock.setDefaultHotseatIcon(getContext(), lp.cellX);
+ } else {
+ PreferencesProvider.Interface.Dock.setDefaultHotseatIcon(getContext(), lp.cellY);
+ }
+ }
} else {
// If we can't find a drop location, we return the item to its original position
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) cell.getLayoutParams();
@@ -2845,6 +2854,10 @@ public class Workspace extends SmoothPagedView
return d.dragSource != this && isDragWidget(d);
}
+ private boolean isDragAllAppsButton(DragObject d) {
+ return (d.dragInfo instanceof AllAppsButtonInfo);
+ }
+
public void onDragOver(DragObject d) {
// Skip drag over events while we are dragging over side pages
if (mInScrollArea || mIsSwitchingState || mState == State.SMALL) return;
@@ -2888,7 +2901,7 @@ public class Workspace extends SmoothPagedView
// Test to see if we are over the hotseat otherwise just use the current page
if (mLauncher.getHotseat() != null && !isDragWidget(d)) {
mLauncher.getHotseat().getHitRect(r);
- if (r.contains(d.x, d.y)) {
+ if (r.contains(d.x, d.y) || isDragAllAppsButton(d)) {
layout = mLauncher.getHotseat().getLayout();
}
}
@@ -3494,8 +3507,8 @@ public class Workspace extends SmoothPagedView
for (int i = 0; i < count; i++) {
View v = cl.getShortcutsAndWidgets().getChildAt(i);
ItemInfo info = (ItemInfo) v.getTag();
- // Null check required as the AllApps button doesn't have an item info
- if (info != null) {
+ // No_id check required as the AllApps button doesn't have an item info id
+ if (info.id != ItemInfo.NO_ID) {
LauncherModel.modifyItemInDatabase(mLauncher, info, container, screen, info.cellX,
info.cellY, info.spanX, info.spanY);
}
diff --git a/src/com/cyanogenmod/trebuchet/preference/Preferences.java b/src/com/cyanogenmod/trebuchet/preference/Preferences.java
index 8f90c4f..a4e806f 100644
--- a/src/com/cyanogenmod/trebuchet/preference/Preferences.java
+++ b/src/com/cyanogenmod/trebuchet/preference/Preferences.java
@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
+import com.cyanogenmod.trebuchet.LauncherApplication;
import com.cyanogenmod.trebuchet.R;
public class Preferences extends PreferenceActivity
@@ -35,6 +36,9 @@ public class Preferences extends PreferenceActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
+ if (LauncherApplication.isScreenLarge()) {
+ findPreference("ui_dock").setEnabled(false);
+ }
mPrefs = getSharedPreferences(PreferencesProvider.PREFERENCES_KEY,
Context.MODE_PRIVATE);
diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
index e12bf00..b4228c3 100644
--- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
+++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import com.cyanogenmod.trebuchet.LauncherApplication;
+import com.cyanogenmod.trebuchet.R;
import com.cyanogenmod.trebuchet.Workspace;
import com.cyanogenmod.trebuchet.AppsCustomizePagedView;
@@ -117,7 +118,18 @@ public final class PreferencesProvider {
}
public static class Dock {
-
+ public static int getNumberHotseatIcons(Context context) {
+ final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0);
+ return preferences.getInt("ui_dock_hotseat_size", context.getResources().getInteger(R.integer.hotseat_cell_count));
+ }
+ public static int getDefaultHotseatIcon(Context context, int def) {
+ final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0);
+ return preferences.getInt("ui_dock_hotseat_apps_index", def);
+ }
+ public static void setDefaultHotseatIcon(Context context, int val) {
+ final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0);
+ preferences.edit().putInt("ui_dock_hotseat_apps_index", val).apply();
+ }
}
public static class Icons {