summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-09-18 02:59:19 (GMT)
committerMatt Garnes <matt@cyngn.com>2015-01-15 08:07:27 (GMT)
commit661e34a1b64e22dfd1ce05c2bf87e86647973666 (patch)
tree0620a7ecf055ec2834e4d6770175a2eb052183c2
parent657097fd0f4e28f597f15547ee70e3e8ef90c388 (diff)
downloadandroid_packages_apps_Trebuchet-661e34a1b64e22dfd1ce05c2bf87e86647973666.zip
android_packages_apps_Trebuchet-661e34a1b64e22dfd1ce05c2bf87e86647973666.tar.gz
android_packages_apps_Trebuchet-661e34a1b64e22dfd1ce05c2bf87e86647973666.tar.bz2
Trebuchet: Customize features for regional package
- Customize default launcher workspace for India. - Add Smartfren customize workspace layout. - micromax_default_workspace.xml and smartfren_default_workspace.xml is - copied from res/xml/default_workspace.xml Change-Id: I6598869a6b6f29fbad05b4c470e980141e4cbf61
-rw-r--r--res/values/config.xml2
-rw-r--r--res/values/customize.xml37
-rw-r--r--res/xml/micromax_default_workspace.xml125
-rw-r--r--res/xml/smartfren_default_workspace.xml125
-rw-r--r--src/com/android/launcher3/DynamicGrid.java4
-rw-r--r--src/com/android/launcher3/LauncherApplication.java6
6 files changed, 299 insertions, 0 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 59b7c05..36f719d 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -123,4 +123,6 @@
<bool name="config_launcher_shortcut">false</bool>
<bool name="config_launcher_show_unread_number">true</bool>
<bool name="config_launcher_show_backup_shortcut">false</bool>
+ <bool name="config_micromax_enabled">false</bool>
+ <bool name="config_smartfren_enabled">false</bool>
</resources>
diff --git a/res/values/customize.xml b/res/values/customize.xml
new file mode 100644
index 0000000..8faa03e
--- /dev/null
+++ b/res/values/customize.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (c) 2014, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<resources>
+ <!-- customize the default launcher wallpaper dim ,default value is 0 -->
+ <integer name="def_launcher_wallpaper_dim">0</integer>
+
+ <string name="foldname_smartworld">Smart World</string>
+ <string name="foldname_music">Music</string>
+ <string name="foldname_google">Google</string>
+</resources>
diff --git a/res/xml/micromax_default_workspace.xml b/res/xml/micromax_default_workspace.xml
new file mode 100644
index 0000000..21389b6
--- /dev/null
+++ b/res/xml/micromax_default_workspace.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ Not a Contribution.
+
+ Copyright (C) 2009 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.
+-->
+
+<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
+ <!-- Far-left screen [0] -->
+
+ <!-- Left screen [1] -->
+ <appwidget
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
+ launcher:screen="1"
+ launcher:x="0"
+ launcher:y="3"
+ launcher:spanX="4"
+ launcher:spanY="1" />
+
+ <!-- Middle screen [2] -->
+ <appwidget
+ launcher:packageName="com.android.deskclock"
+ launcher:className="com.android.alarmclock.AnalogAppWidgetProvider"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="0"
+ launcher:spanX="2"
+ launcher:spanY="2" />
+
+ <!--UX_Enhance_Middle screen [2]-->
+ <favorite
+ launcher:packageName="com.android.email"
+ launcher:className="com.android.email.activity.Welcome"
+ launcher:screen="2"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.calendar"
+ launcher:className="com.android.calendar.AllInOneActivity"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.Settings"
+ launcher:screen="2"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.vending"
+ launcher:className="com.google.android.finsky.activities.MainActivity"
+ launcher:screen="2"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- UX_Enhance_screen [3] -->
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.camera.Camera"
+ launcher:screen="3"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.gallery3d.app.Gallery"
+ launcher:screen="3"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.VideoBrowserActivity"
+ launcher:screen="3"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.MusicBrowserActivity"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+ <favorite
+ launcher:packageName="com.android.dialer"
+ launcher:className="com.android.dialer.DialtactsActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.contacts"
+ launcher:className="com.android.contacts.activities.PeopleActivity"
+ launcher:container="-101"
+ launcher:screen="1"
+ launcher:x="1"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.mms"
+ launcher:className="com.android.mms.ui.ConversationList"
+ launcher:container="-101"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.browser"
+ launcher:className="com.android.browser.BrowserActivity"
+ launcher:container="-101"
+ launcher:screen="4"
+ launcher:x="4"
+ launcher:y="0" />
+</favorites>
diff --git a/res/xml/smartfren_default_workspace.xml b/res/xml/smartfren_default_workspace.xml
new file mode 100644
index 0000000..21389b6
--- /dev/null
+++ b/res/xml/smartfren_default_workspace.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ Not a Contribution.
+
+ Copyright (C) 2009 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.
+-->
+
+<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
+ <!-- Far-left screen [0] -->
+
+ <!-- Left screen [1] -->
+ <appwidget
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
+ launcher:screen="1"
+ launcher:x="0"
+ launcher:y="3"
+ launcher:spanX="4"
+ launcher:spanY="1" />
+
+ <!-- Middle screen [2] -->
+ <appwidget
+ launcher:packageName="com.android.deskclock"
+ launcher:className="com.android.alarmclock.AnalogAppWidgetProvider"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="0"
+ launcher:spanX="2"
+ launcher:spanY="2" />
+
+ <!--UX_Enhance_Middle screen [2]-->
+ <favorite
+ launcher:packageName="com.android.email"
+ launcher:className="com.android.email.activity.Welcome"
+ launcher:screen="2"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.calendar"
+ launcher:className="com.android.calendar.AllInOneActivity"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.Settings"
+ launcher:screen="2"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.vending"
+ launcher:className="com.google.android.finsky.activities.MainActivity"
+ launcher:screen="2"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- UX_Enhance_screen [3] -->
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.camera.Camera"
+ launcher:screen="3"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.gallery3d.app.Gallery"
+ launcher:screen="3"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.VideoBrowserActivity"
+ launcher:screen="3"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.MusicBrowserActivity"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+ <favorite
+ launcher:packageName="com.android.dialer"
+ launcher:className="com.android.dialer.DialtactsActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.contacts"
+ launcher:className="com.android.contacts.activities.PeopleActivity"
+ launcher:container="-101"
+ launcher:screen="1"
+ launcher:x="1"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.mms"
+ launcher:className="com.android.mms.ui.ConversationList"
+ launcher:container="-101"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.browser"
+ launcher:className="com.android.browser.BrowserActivity"
+ launcher:container="-101"
+ launcher:screen="4"
+ launcher:x="4"
+ launcher:y="0" />
+</favorites>
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 1bf9afb..fe0897c 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -67,6 +67,10 @@ public class DynamicGrid {
fourByFourDefaultLayout = R.xml.ct_default_workspace_4x4;
} else if (LauncherApplication.LAUNCHER_BACKUP_SHORTCUT_ENABLED) {
fourByFourDefaultLayout = R.xml.cm_with_backup_default_workspace;
+ } else if (LauncherApplication.LAUNCHER_MMX_SHORTCUT_ENABLED) {
+ fourByFourDefaultLayout = R.xml.micromax_default_workspace;
+ } else if (LauncherApplication.LAUNCHER_SFR_SHORTCUT_ENABLED) {
+ fourByFourDefaultLayout = R.xml.smartfren_default_workspace;
}
DEFAULT_ICON_SIZE_PX = pxFromDp(DEFAULT_ICON_SIZE_DP, dm);
diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java
index 56ca326..689f54d 100644
--- a/src/com/android/launcher3/LauncherApplication.java
+++ b/src/com/android/launcher3/LauncherApplication.java
@@ -23,6 +23,8 @@ public class LauncherApplication extends Application {
public static boolean LAUNCHER_SHORTCUT_ENABLED;
public static boolean SHOW_CTAPP_FEATURE;
public static boolean LAUNCHER_BACKUP_SHORTCUT_ENABLED;
+ public static boolean LAUNCHER_MMX_SHORTCUT_ENABLED;
+ public static boolean LAUNCHER_SFR_SHORTCUT_ENABLED;
@Override
public void onCreate() {
@@ -34,6 +36,10 @@ public class LauncherApplication extends Application {
SHOW_CTAPP_FEATURE = getResources().getBoolean(R.bool.config_launcher_page);
LAUNCHER_BACKUP_SHORTCUT_ENABLED =
getResources().getBoolean(R.bool.config_launcher_show_backup_shortcut);
+ LAUNCHER_MMX_SHORTCUT_ENABLED =
+ getResources().getBoolean(R.bool.config_micromax_enabled);
+ LAUNCHER_SFR_SHORTCUT_ENABLED =
+ getResources().getBoolean(R.bool.config_smartfren_enabled);
LauncherAppState.setApplicationContext(this);
LauncherAppState.getInstance();
}