mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-07 22:31:17 -04:00
Fix lint errors in ChunkUtils
Supress "SpellCheckingInspection" warns on ALPHABET field Add locale to String.Format() calls Related to https://github.com/kiwix/kiwix-android/issues/98
This commit is contained in:
parent
6362b04a35
commit
a97c88409c
@ -21,9 +21,11 @@ import org.kiwix.kiwixmobile.utils.StorageUtils;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class ChunkUtils {
|
public class ChunkUtils {
|
||||||
|
|
||||||
|
@SuppressWarnings("SpellCheckingInspection")
|
||||||
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
||||||
public static final String ZIM_EXTENSION = ".zim";
|
public static final String ZIM_EXTENSION = ".zim";
|
||||||
public static final String PART = ".part.part";
|
public static final String PART = ".part.part";
|
||||||
@ -42,11 +44,11 @@ public class ChunkUtils {
|
|||||||
for (String zim : fileNames) {
|
for (String zim : fileNames) {
|
||||||
String range;
|
String range;
|
||||||
if (currentRange + CHUNK_SIZE >= contentLength) {
|
if (currentRange + CHUNK_SIZE >= contentLength) {
|
||||||
range = String.format("%d-", currentRange);
|
range = String.format(Locale.US, "%d-", currentRange);
|
||||||
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength));
|
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength));
|
||||||
currentRange += CHUNK_SIZE + 1;
|
currentRange += CHUNK_SIZE + 1;
|
||||||
} else {
|
} else {
|
||||||
range = String.format("%d-%d", currentRange, currentRange + CHUNK_SIZE);
|
range = String.format(Locale.US, "%d-%d", currentRange, currentRange + CHUNK_SIZE);
|
||||||
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, currentRange + CHUNK_SIZE));
|
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, currentRange + CHUNK_SIZE));
|
||||||
currentRange += CHUNK_SIZE + 1;
|
currentRange += CHUNK_SIZE + 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user