question: @ Override public int compareTo ( DbEntry another ) { if ( itemType == LauncherSettings . Favorites . ITEM_TYPE_APPWIDGET ) { if ( another . itemType == LauncherSettings . Favorites . ITEM_TYPE_APPWIDGET ) { return another . spanY * another . spanX - spanX * spanY ; } else { return - 1 ; } } else if ( another . itemType == LauncherSettings . Favorites . ITEM_TYPE_APPWIDGET ) { return 1 ; } else { return Float . compare ( another . weight , weight ) ; } }
target:  Comparator such that larger widgets come first,  followed by all 1x1 items based on their weights.