mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Converting long item IDs to int
> Items ids were already being typecasted to int when being bound on the UI > Using a consistent type allow better use of platform data-structures > Adding IntArray and IntSet as a replacement for various Collection classes Change-Id: Id3c650ed2420c2bfca3bd7671d2b705b56112371
This commit is contained in:
@@ -76,13 +76,13 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parseContainerAndScreen(XmlResourceParser parser, long[] out) {
|
||||
protected void parseContainerAndScreen(XmlResourceParser parser, int[] out) {
|
||||
out[0] = LauncherSettings.Favorites.CONTAINER_DESKTOP;
|
||||
String strContainer = getAttributeValue(parser, ATTR_CONTAINER);
|
||||
if (strContainer != null) {
|
||||
out[0] = Long.valueOf(strContainer);
|
||||
out[0] = Integer.parseInt(strContainer);
|
||||
}
|
||||
out[1] = Long.parseLong(getAttributeValue(parser, ATTR_SCREEN));
|
||||
out[1] = Integer.parseInt(getAttributeValue(parser, ATTR_SCREEN));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,7 +91,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
public class AppShortcutWithUriParser extends AppShortcutParser {
|
||||
|
||||
@Override
|
||||
protected long invalidPackageOrClass(XmlResourceParser parser) {
|
||||
protected int invalidPackageOrClass(XmlResourceParser parser) {
|
||||
final String uri = getAttributeValue(parser, ATTR_URI);
|
||||
if (TextUtils.isEmpty(uri)) {
|
||||
Log.e(TAG, "Skipping invalid <favorite> with no component or uri");
|
||||
@@ -205,11 +205,11 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
private final AppShortcutWithUriParser mChildParser = new AppShortcutWithUriParser();
|
||||
|
||||
@Override
|
||||
public long parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
public int parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
IOException {
|
||||
final int groupDepth = parser.getDepth();
|
||||
int type;
|
||||
long addedId = -1;
|
||||
int addedId = -1;
|
||||
while ((type = parser.next()) != XmlPullParser.END_TAG ||
|
||||
parser.getDepth() > groupDepth) {
|
||||
if (type != XmlPullParser.START_TAG || addedId > -1) {
|
||||
@@ -233,7 +233,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
@Thunk class PartnerFolderParser implements TagParser {
|
||||
|
||||
@Override
|
||||
public long parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
public int parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
IOException {
|
||||
// Folder contents come from an external XML resource
|
||||
final Partner partner = Partner.get(mPackageManager);
|
||||
@@ -259,7 +259,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
@Thunk class MyFolderParser extends FolderParser {
|
||||
|
||||
@Override
|
||||
public long parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
public int parseAndAdd(XmlResourceParser parser) throws XmlPullParserException,
|
||||
IOException {
|
||||
final int resId = getAttributeResourceValue(parser, ATTR_FOLDER_ITEMS, 0);
|
||||
if (resId != 0) {
|
||||
@@ -277,7 +277,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
protected class AppWidgetParser extends PendingWidgetParser {
|
||||
|
||||
@Override
|
||||
protected long verifyAndInsert(ComponentName cn, Bundle extras) {
|
||||
protected int verifyAndInsert(ComponentName cn, Bundle extras) {
|
||||
try {
|
||||
mPackageManager.getReceiverInfo(cn, 0);
|
||||
} catch (Exception e) {
|
||||
@@ -293,7 +293,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout {
|
||||
}
|
||||
|
||||
final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
|
||||
long insertedId = -1;
|
||||
int insertedId = -1;
|
||||
try {
|
||||
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user