From 54f7ac30f2832120faa0c2dd45e5b216ac771efb Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 2 Aug 2010 13:56:46 -0700 Subject: [PATCH] Made some temporary aesthetic improvements - icons in the customization drawer are now much more tightly spaced, and no longer use the default gallery styling - wrapped some >100 char lines - removed "Applications" from the shortcuts customization drawer --- res/layout/home_customization_drawer_item.xml | 8 +++--- .../home_customization_drawer_widget.xml | 24 +++++++++++++++++ src/com/android/launcher2/Launcher.java | 22 +++++++++++----- .../launcher2/ShortcutListAdapter.java | 26 ------------------- .../android/launcher2/WidgetListAdapter.java | 2 +- 5 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 res/layout/home_customization_drawer_widget.xml delete mode 100644 src/com/android/launcher2/ShortcutListAdapter.java diff --git a/res/layout/home_customization_drawer_item.xml b/res/layout/home_customization_drawer_item.xml index 2ef527daa3..4d61dbfb4e 100644 --- a/res/layout/home_customization_drawer_item.xml +++ b/res/layout/home_customization_drawer_item.xml @@ -15,10 +15,10 @@ --> \ No newline at end of file + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="#ffffffff" /> \ No newline at end of file diff --git a/res/layout/home_customization_drawer_widget.xml b/res/layout/home_customization_drawer_widget.xml new file mode 100644 index 0000000000..1581308b66 --- /dev/null +++ b/res/layout/home_customization_drawer_widget.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index feb247e995..1a085a382c 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -778,12 +778,14 @@ public final class Launcher extends Activity widgetChooser.setLauncher(this); FolderChooser folderChooser = (FolderChooser) findViewById(R.id.folder_chooser); - IntentListAdapter folderTypes = new FolderListAdapter(this, LiveFolders.ACTION_CREATE_LIVE_FOLDER); + IntentListAdapter folderTypes = new FolderListAdapter( + this, LiveFolders.ACTION_CREATE_LIVE_FOLDER); folderChooser.setAdapter(folderTypes); folderChooser.setLauncher(this); ShortcutChooser shortcutChooser = (ShortcutChooser) findViewById(R.id.shortcut_chooser); - IntentListAdapter shortcutTypes = new ShortcutListAdapter(this, Intent.ACTION_CREATE_SHORTCUT); + IntentListAdapter shortcutTypes = new IntentListAdapter( + this, Intent.ACTION_CREATE_SHORTCUT); shortcutChooser.setAdapter(shortcutTypes); shortcutChooser.setLauncher(this); } else { @@ -813,7 +815,12 @@ public final class Launcher extends Activity deleteZone.setLauncher(this); deleteZone.setDragController(dragController); - int deleteZoneHandleId = LauncherApplication.isScreenXLarge() ? R.id.add_button : R.id.all_apps_button_cluster; + int deleteZoneHandleId; + if (LauncherApplication.isScreenXLarge()) { + deleteZoneHandleId = R.id.add_button; + } else { + deleteZoneHandleId = R.id.all_apps_button_cluster; + } deleteZone.setHandle(findViewById(deleteZoneHandleId)); dragController.setDragScoller(workspace); @@ -2121,7 +2128,8 @@ public final class Launcher extends Activity } private boolean isCustomizationDrawerVisible() { - return mHomeCustomizationDrawer != null && mHomeCustomizationDrawer.getVisibility() == View.VISIBLE; + return mHomeCustomizationDrawer != null && + mHomeCustomizationDrawer.getVisibility() == View.VISIBLE; } private void showCustomizationDrawer() { @@ -2130,12 +2138,14 @@ public final class Launcher extends Activity closeAllApps(false); } mHomeCustomizationDrawer.setVisibility(View.VISIBLE); - mHomeCustomizationDrawer.startAnimation(AnimationUtils.loadAnimation(this, R.anim.home_customization_drawer_slide_up)); + mHomeCustomizationDrawer.startAnimation( + AnimationUtils.loadAnimation(this, R.anim.home_customization_drawer_slide_up)); } private void hideCustomizationDrawer() { if (isCustomizationDrawerVisible()) { - Animation slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.home_customization_drawer_slide_down); + Animation slideDownAnimation = AnimationUtils.loadAnimation( + this, R.anim.home_customization_drawer_slide_down); slideDownAnimation.setAnimationListener(new Animation.AnimationListener() { public void onAnimationEnd(Animation animation) { mHomeCustomizationDrawer.setVisibility(View.GONE); diff --git a/src/com/android/launcher2/ShortcutListAdapter.java b/src/com/android/launcher2/ShortcutListAdapter.java deleted file mode 100644 index be05ca4bb1..0000000000 --- a/src/com/android/launcher2/ShortcutListAdapter.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.android.launcher2; - -import com.android.launcher.R; - -import android.content.Context; -import android.content.Intent; -import android.content.Intent.ShortcutIconResource; -import android.content.pm.ResolveInfo; - -import java.util.ArrayList; - - -public class ShortcutListAdapter extends IntentListAdapter { - - public ShortcutListAdapter(Context context, String actionFilter) { - super(context, actionFilter); - - // Manually create a separate entry for creating an Application shortcut - ResolveInfo folder = new ResolveInfo(); - - folder.icon = R.drawable.ic_launcher_application; - folder.labelRes = R.string.group_applications; - folder.resolvePackageName = context.getPackageName(); - mIntentList.add(0, folder); - } -} diff --git a/src/com/android/launcher2/WidgetListAdapter.java b/src/com/android/launcher2/WidgetListAdapter.java index 597ecf9470..7ec011296c 100644 --- a/src/com/android/launcher2/WidgetListAdapter.java +++ b/src/com/android/launcher2/WidgetListAdapter.java @@ -73,7 +73,7 @@ public class WidgetListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater)mLauncher.getSystemService(Context.LAYOUT_INFLATER_SERVICE); textView = (TextView) inflater.inflate( - R.layout.home_customization_drawer_item, parent, false); + R.layout.home_customization_drawer_widget, parent, false); } else { textView = (TextView) convertView; }