mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Moving some utilities methods to separate class
Change-Id: I5094b22ddc77c45590cea1a5f5dead0dc7580abf
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Copy of the platform hidden implementation of android.util.IntArray.
|
||||
@@ -248,6 +249,17 @@ public class IntArray implements Cloneable {
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public static IntArray fromConcatString(String concatString) {
|
||||
StringTokenizer tokenizer = new StringTokenizer(concatString, ",");
|
||||
int[] array = new int[tokenizer.countTokens()];
|
||||
int count = 0;
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
array[count] = Integer.parseInt(tokenizer.nextToken().trim());
|
||||
count++;
|
||||
}
|
||||
return new IntArray(array, array.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws {@link ArrayIndexOutOfBoundsException} if the index is out of bounds.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user