Merge branch 'master' of ssh://github.com/osmandapp/Osmand into TrackerLiveTrack
This commit is contained in:
commit
8e7c4d3043
4 changed files with 6 additions and 13 deletions
|
@ -461,14 +461,7 @@ public class Algorithms {
|
|||
|
||||
public static String gzipToString(byte[] gzip) throws IOException {
|
||||
GZIPInputStream gzipIs = new GZIPInputStream(new ByteArrayInputStream(gzip));
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(gzipIs, "UTF-8"));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String s;
|
||||
while ((s = br.readLine()) != null) {
|
||||
sb.append(s);
|
||||
}
|
||||
br.close();
|
||||
return sb.toString();
|
||||
return readFromInputStream(gzipIs).toString();
|
||||
}
|
||||
|
||||
public static boolean removeAllFiles(File f) {
|
||||
|
|
|
@ -286,11 +286,11 @@ public class WikiArticleHelper {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public static String getPartialContent(String content) {
|
||||
if (content == null) {
|
||||
public static String getPartialContent(String source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String content = source.replaceAll("\\n", "");
|
||||
int firstParagraphStart = content.indexOf(P_OPENED);
|
||||
int firstParagraphEnd = content.indexOf(P_CLOSED);
|
||||
firstParagraphEnd = firstParagraphEnd < firstParagraphStart ? content.indexOf(P_CLOSED, firstParagraphStart) : firstParagraphEnd;
|
||||
|
|
|
@ -425,7 +425,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
|
|||
for (int i = backStackEntryCount - 1; i >= 0; i--) {
|
||||
BackStackEntry entry = fragmentManager.getBackStackEntryAt(i);
|
||||
if (!TAG.equals(entry.getName())) {
|
||||
pop = i;
|
||||
pop = entry.getId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -600,7 +600,7 @@ public class TravelDbHelper {
|
|||
|
||||
res.title = cursor.getString(0);
|
||||
try {
|
||||
res.content = Algorithms.gzipToString(cursor.getBlob(1));
|
||||
res.content = Algorithms.gzipToString(cursor.getBlob(1)).trim();
|
||||
} catch (IOException e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue