1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 02:39:23 +02:00

Warnings cleanup

This commit is contained in:
Vasiliy Bout 2011-05-20 12:19:09 +04:00
parent 3b35072721
commit 08e9c493aa
44 changed files with 60 additions and 105 deletions

View file

@ -22,6 +22,8 @@ public final class ZipFile {
private final InputStreamHolder myStreamHolder; private final InputStreamHolder myStreamHolder;
private final LinkedHashMap<String,LocalFileHeader> myFileHeaders = new LinkedHashMap<String,LocalFileHeader>() { private final LinkedHashMap<String,LocalFileHeader> myFileHeaders = new LinkedHashMap<String,LocalFileHeader>() {
private static final long serialVersionUID = -4412796553514902113L;
@Override @Override
public LocalFileHeader get(Object key) { public LocalFileHeader get(Object key) {
return super.get(((String)key).toLowerCase()); return super.get(((String)key).toLowerCase());

View file

@ -19,8 +19,6 @@
package org.geometerplus.android.fbreader.network; package org.geometerplus.android.fbreader.network;
import java.util.HashMap;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;

View file

@ -19,8 +19,6 @@
package org.geometerplus.android.fbreader.network; package org.geometerplus.android.fbreader.network;
import java.net.*;
import android.app.*; import android.app.*;
import android.os.Bundle; import android.os.Bundle;
import android.view.*; import android.view.*;

View file

@ -302,10 +302,6 @@ class NetworkCatalogActions extends NetworkTreeActions {
myResumeNotLoad = resumeNotLoad; myResumeNotLoad = resumeNotLoad;
} }
public String getResourceKey() {
return "downloadingCatalogs";
}
@Override @Override
public void doBefore() throws ZLNetworkException { public void doBefore() throws ZLNetworkException {
final INetworkLink link = myTree.Item.Link; final INetworkLink link = myTree.Item.Link;

View file

@ -19,7 +19,6 @@
package org.geometerplus.android.fbreader.network; package org.geometerplus.android.fbreader.network;
import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.*; import android.view.*;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
@ -29,12 +28,10 @@ import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials; import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.auth.UsernamePasswordCredentials;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.core.network.ZLNetworkManager; import org.geometerplus.zlibrary.core.network.ZLNetworkManager;
import org.geometerplus.zlibrary.core.options.ZLStringOption; import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager;
import org.geometerplus.fbreader.network.tree.*; import org.geometerplus.fbreader.network.tree.*;
import org.geometerplus.fbreader.tree.FBTree; import org.geometerplus.fbreader.tree.FBTree;

View file

@ -64,10 +64,6 @@ public class NetworkSearchActivity extends Activity {
myPattern = pattern; myPattern = pattern;
} }
public String getResourceKey() {
return "searchingNetwork";
}
@Override @Override
public void doBefore() { public void doBefore() {
} }

View file

@ -19,8 +19,6 @@
package org.geometerplus.android.fbreader.network; package org.geometerplus.android.fbreader.network;
import java.util.HashMap;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;

View file

@ -129,7 +129,7 @@ class AnimationSpeedPreference extends DialogPreference implements ZLPreference
final int max = mySlider.getMax(); final int max = mySlider.getMax();
if (progress >= max / 3) { if (progress >= max / 3) {
final String text = myResource.getResource("slow").getValue(); final String text = myResource.getResource("slow").getValue();
final float textWidth = myOutlinePaint.measureText(text); //final float textWidth = myOutlinePaint.measureText(text);
final float x = 6; final float x = 6;
canvas.drawText(text, x, y, myOutlinePaint); canvas.drawText(text, x, y, myOutlinePaint);
canvas.drawText(text, x, y, myPaint); canvas.drawText(text, x, y, myPaint);

View file

@ -32,7 +32,7 @@ class ZLEnumPreference<T extends Enum<T>> extends ZLStringListPreference {
myOption = option; myOption = option;
final T initialValue = option.getValue(); final T initialValue = option.getValue();
final Enum[] allValues = initialValue.getClass().getEnumConstants(); final T[] allValues = initialValue.getDeclaringClass().getEnumConstants();
final String[] stringValues = new String[allValues.length]; final String[] stringValues = new String[allValues.length];
for (int i = 0; i < stringValues.length; ++i) { for (int i = 0; i < stringValues.length; ++i) {
stringValues[i] = allValues[i].toString(); stringValues[i] = allValues[i].toString();
@ -42,6 +42,6 @@ class ZLEnumPreference<T extends Enum<T>> extends ZLStringListPreference {
} }
public void onAccept() { public void onAccept() {
myOption.setValue((T)Enum.valueOf(myOption.getValue().getClass(), getValue())); myOption.setValue(Enum.valueOf(myOption.getValue().getDeclaringClass(), getValue()));
} }
} }

View file

@ -21,7 +21,6 @@ package org.geometerplus.fbreader.fbreader;
import java.util.*; import java.util.*;
import org.geometerplus.zlibrary.core.application.ZLApplication;
import org.geometerplus.zlibrary.core.util.ZLColor; import org.geometerplus.zlibrary.core.util.ZLColor;
import org.geometerplus.zlibrary.core.library.ZLibrary; import org.geometerplus.zlibrary.core.library.ZLibrary;
import org.geometerplus.zlibrary.core.view.ZLPaintContext; import org.geometerplus.zlibrary.core.view.ZLPaintContext;
@ -505,11 +504,11 @@ public final class FBView extends ZLTextView {
// TODO: remove // TODO: remove
int myGaugeWidth = 1; int myGaugeWidth = 1;
public int getGaugeWidth() { /*public int getGaugeWidth() {
return myGaugeWidth; return myGaugeWidth;
} }*/
public void setProgress(int x) { /*public void setProgress(int x) {
// set progress according to tap coordinate // set progress according to tap coordinate
int gaugeWidth = getGaugeWidth(); int gaugeWidth = getGaugeWidth();
float progress = 1.0f * Math.min(x, gaugeWidth) / gaugeWidth; float progress = 1.0f * Math.min(x, gaugeWidth) / gaugeWidth;
@ -521,7 +520,7 @@ public final class FBView extends ZLTextView {
} }
myReader.getViewWidget().reset(); myReader.getViewWidget().reset();
myReader.getViewWidget().repaint(); myReader.getViewWidget().repaint();
} }*/
} }
private Footer myFooter; private Footer myFooter;

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.fbreader; package org.geometerplus.fbreader.fbreader;
import org.geometerplus.zlibrary.text.view.ZLTextWordCursor;
class TurnPageAction extends FBAction { class TurnPageAction extends FBAction {
private final boolean myForward; private final boolean myForward;

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.fbreader; package org.geometerplus.fbreader.fbreader;
import org.geometerplus.zlibrary.text.view.ZLTextWordCursor;
class VolumeKeyTurnPageAction extends FBAction { class VolumeKeyTurnPageAction extends FBAction {
private final boolean myForward; private final boolean myForward;

View file

@ -209,7 +209,7 @@ public final class Library {
} }
} }
private final ArrayList myNullList = new ArrayList(1); private final ArrayList<?> myNullList = new ArrayList<Object>(1);
{ {
myNullList.add(null); myNullList.add(null);
} }

View file

@ -21,7 +21,6 @@ package org.geometerplus.fbreader.network;
import java.util.*; import java.util.*;
import org.geometerplus.zlibrary.core.util.ZLMiscUtil;
import org.geometerplus.zlibrary.core.options.ZLStringListOption; import org.geometerplus.zlibrary.core.options.ZLStringListOption;
import org.geometerplus.fbreader.network.urlInfo.*; import org.geometerplus.fbreader.network.urlInfo.*;

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.network; package org.geometerplus.fbreader.network;
import java.util.HashMap;
import org.geometerplus.zlibrary.core.network.ZLNetworkException; import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.fbreader.network.urlInfo.*; import org.geometerplus.fbreader.network.urlInfo.*;

View file

@ -97,7 +97,7 @@ public class NetworkBookItem extends NetworkItem {
public NetworkBookItem(INetworkLink link, String id, int index, public NetworkBookItem(INetworkLink link, String id, int index,
CharSequence title, CharSequence summary, /*String language, String date,*/ CharSequence title, CharSequence summary, /*String language, String date,*/
List<AuthorData> authors, List<String> tags, String seriesTitle, float indexInSeries, List<AuthorData> authors, List<String> tags, String seriesTitle, float indexInSeries,
UrlInfoCollection urls) { UrlInfoCollection<?> urls) {
super(link, title, summary, urls); super(link, title, summary, urls);
Index = index; Index = index;
Id = id; Id = id;

View file

@ -64,7 +64,7 @@ public abstract class NetworkCatalogItem extends NetworkItem {
* in the network library view. * in the network library view.
* @param flags describes how to show book items inside this catalog * @param flags describes how to show book items inside this catalog
*/ */
public NetworkCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Accessibility accessibility, int flags) { public NetworkCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Accessibility accessibility, int flags) {
super(link, title, summary, urls); super(link, title, summary, urls);
myAccessibility = accessibility; myAccessibility = accessibility;
Flags = flags; Flags = flags;

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.network; package org.geometerplus.fbreader.network;
import java.util.Map;
import org.geometerplus.fbreader.network.urlInfo.*; import org.geometerplus.fbreader.network.urlInfo.*;
public abstract class NetworkDatabase { public abstract class NetworkDatabase {

View file

@ -29,7 +29,7 @@ public abstract class NetworkItem {
public final CharSequence Title; public final CharSequence Title;
private CharSequence mySummary; private CharSequence mySummary;
private final UrlInfoCollection myURLs; private final UrlInfoCollection<UrlInfo> myURLs;
/** /**
* Creates new NetworkItem instance. * Creates new NetworkItem instance.
@ -39,12 +39,12 @@ public abstract class NetworkItem {
* @param summary description of this library item. Can be <code>null</code>. * @param summary description of this library item. Can be <code>null</code>.
* @param urls collection of item-related urls (like icon link, opds catalog link, etc. Can be <code>null</code>. * @param urls collection of item-related urls (like icon link, opds catalog link, etc. Can be <code>null</code>.
*/ */
protected NetworkItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls) { protected NetworkItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls) {
Link = link; Link = link;
Title = title != null ? title : ""; Title = title != null ? title : "";
setSummary(summary); setSummary(summary);
if (urls != null && !urls.isEmpty()) { if (urls != null && !urls.isEmpty()) {
myURLs = new UrlInfoCollection(urls); myURLs = new UrlInfoCollection<UrlInfo>(urls);
} else { } else {
myURLs = null; myURLs = null;
} }
@ -58,7 +58,7 @@ public abstract class NetworkItem {
return mySummary; return mySummary;
} }
protected void addUrls(UrlInfoCollection urls) { protected void addUrls(UrlInfoCollection<?> urls) {
myURLs.upgrade(urls); myURLs.upgrade(urls);
} }

View file

@ -35,7 +35,7 @@ public abstract class NetworkURLCatalogItem extends NetworkCatalogItem {
* @param summary description of this library item. Can be <code>null</code>. * @param summary description of this library item. Can be <code>null</code>.
* @param urls collection of item-related URLs. Can be <code>null</code>. * @param urls collection of item-related URLs. Can be <code>null</code>.
*/ */
public NetworkURLCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls) { public NetworkURLCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls) {
this(link, title, summary, urls, Accessibility.ALWAYS, FLAGS_DEFAULT); this(link, title, summary, urls, Accessibility.ALWAYS, FLAGS_DEFAULT);
} }
@ -50,7 +50,7 @@ public abstract class NetworkURLCatalogItem extends NetworkCatalogItem {
* in the network library view. * in the network library view.
* @param flags value defines how to show book items in this catalog. * @param flags value defines how to show book items in this catalog.
*/ */
public NetworkURLCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Accessibility accessibility, int flags) { public NetworkURLCatalogItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Accessibility accessibility, int flags) {
super(link, title, summary, urls, accessibility, flags); super(link, title, summary, urls, accessibility, flags);
} }

View file

@ -24,7 +24,7 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection; import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
public class TopUpItem extends NetworkItem { public class TopUpItem extends NetworkItem {
public TopUpItem(INetworkLink link, UrlInfoCollection urls) { public TopUpItem(INetworkLink link, UrlInfoCollection<?> urls) {
super( super(
link, link,
ZLResource.resource("networkView").getResource("topupTitle").getValue(), ZLResource.resource("networkView").getResource("topupTitle").getValue(),

View file

@ -26,7 +26,7 @@ import org.geometerplus.zlibrary.core.util.MimeType;
import org.geometerplus.zlibrary.core.xml.ZLStringMap; import org.geometerplus.zlibrary.core.xml.ZLStringMap;
import org.geometerplus.zlibrary.core.xml.ZLXMLReaderAdapter; import org.geometerplus.zlibrary.core.xml.ZLXMLReaderAdapter;
public class ATOMXMLReader extends ZLXMLReaderAdapter { public abstract class ATOMXMLReader<T1 extends ATOMFeedMetadata, T2 extends ATOMEntry> extends ZLXMLReaderAdapter {
public static String intern(String str) { public static String intern(String str) {
if (str == null || str.length() == 0) { if (str == null || str.length() == 0) {
return null; return null;
@ -34,10 +34,10 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
return str.intern(); return str.intern();
} }
private final ATOMFeedHandler myFeedHandler; private final ATOMFeedHandler<T1, T2> myFeedHandler;
private ATOMFeedMetadata myFeed; private T1 myFeed;
private ATOMEntry myEntry; private T2 myEntry;
private ATOMAuthor myAuthor; private ATOMAuthor myAuthor;
private ATOMId myId; private ATOMId myId;
private ATOMLink myLink; private ATOMLink myLink;
@ -99,20 +99,20 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
protected final FormattedBuffer myFormattedBuffer = new FormattedBuffer(); protected final FormattedBuffer myFormattedBuffer = new FormattedBuffer();
protected boolean myFeedMetadataProcessed; protected boolean myFeedMetadataProcessed;
public ATOMXMLReader(ATOMFeedHandler handler, boolean readEntryNotFeed) { public ATOMXMLReader(ATOMFeedHandler<T1, T2> handler, boolean readEntryNotFeed) {
myFeedHandler = handler; myFeedHandler = handler;
myState = readEntryNotFeed ? FEED : START; myState = readEntryNotFeed ? FEED : START;
} }
protected final ATOMFeedHandler getATOMFeedHandler() { protected final ATOMFeedHandler<T1, T2> getATOMFeedHandler() {
return myFeedHandler; return myFeedHandler;
} }
protected final ATOMFeedMetadata getATOMFeed() { protected final T1 getATOMFeed() {
return myFeed; return myFeed;
} }
protected final ATOMEntry getATOMEntry() { protected final T2 getATOMEntry() {
return myEntry; return myEntry;
} }
@ -175,17 +175,13 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
return new String(bufferContentArray); return new String(bufferContentArray);
} }
protected ATOMFeedMetadata createFeed(ZLStringMap attributes) { protected abstract T1 createFeed(ZLStringMap attributes);
return new ATOMFeedMetadata(attributes); protected abstract T2 createEntry(ZLStringMap attributes);
}
protected ATOMLink createLink(ZLStringMap attributes) { protected ATOMLink createLink(ZLStringMap attributes) {
return new ATOMLink(attributes); return new ATOMLink(attributes);
} }
protected ATOMEntry createEntry(ZLStringMap attributes) {
return new ATOMEntry(attributes);
}
public boolean startElementHandler( public boolean startElementHandler(
final String ns, final String tag, final String ns, final String tag,

View file

@ -21,10 +21,7 @@ package org.geometerplus.fbreader.network.atom;
import org.geometerplus.zlibrary.core.xml.ZLStringMap; import org.geometerplus.zlibrary.core.xml.ZLStringMap;
import org.geometerplus.fbreader.formats.xhtml.XHTMLReader;
import org.geometerplus.fbreader.network.NetworkLibrary;
import org.geometerplus.fbreader.network.HtmlUtil; import org.geometerplus.fbreader.network.HtmlUtil;
import org.geometerplus.fbreader.network.atom.ATOMConstants;
public class FormattedBuffer { public class FormattedBuffer {
public static enum Type { public static enum Type {

View file

@ -161,7 +161,7 @@ class BySeriesCatalogItem extends SortedCatalogItem {
public class LitResBookshelfItem extends NetworkURLCatalogItem { public class LitResBookshelfItem extends NetworkURLCatalogItem {
private boolean myForceReload; private boolean myForceReload;
public LitResBookshelfItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Accessibility accessibility) { public LitResBookshelfItem(INetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Accessibility accessibility) {
super(link, title, summary, urls, accessibility, FLAGS_DEFAULT); super(link, title, summary, urls, accessibility, FLAGS_DEFAULT);
} }

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.network.authentication.litres; package org.geometerplus.fbreader.network.authentication.litres;
import java.util.*;
import java.io.InputStream; import java.io.InputStream;
import java.io.IOException; import java.io.IOException;

View file

@ -27,7 +27,7 @@ import org.geometerplus.fbreader.network.opds.OPDSNetworkLink;
import org.geometerplus.fbreader.network.urlInfo.*; import org.geometerplus.fbreader.network.urlInfo.*;
public class LitResRecommendationsItem extends OPDSCatalogItem { public class LitResRecommendationsItem extends OPDSCatalogItem {
public LitResRecommendationsItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Accessibility accessibility) { public LitResRecommendationsItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Accessibility accessibility) {
super(link, title, summary, urls, accessibility, FLAGS_DEFAULT & ~FLAGS_GROUP); super(link, title, summary, urls, accessibility, FLAGS_DEFAULT & ~FLAGS_GROUP);
} }

View file

@ -21,7 +21,6 @@ package org.geometerplus.fbreader.network.authentication.litres;
import java.util.*; import java.util.*;
import org.geometerplus.zlibrary.core.util.MimeType;
import org.geometerplus.zlibrary.core.xml.*; import org.geometerplus.zlibrary.core.xml.*;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
@ -43,7 +42,7 @@ class LitResXMLReader extends LitResAuthenticationXMLReader {
private CharSequence mySummary; private CharSequence mySummary;
private final UrlInfoCollection myUrls = new UrlInfoCollection(); private final UrlInfoCollection<UrlInfo> myUrls = new UrlInfoCollection<UrlInfo>();
private String myAuthorFirstName; private String myAuthorFirstName;
private String myAuthorMiddleName; private String myAuthorMiddleName;

View file

@ -25,7 +25,7 @@ import org.geometerplus.fbreader.network.urlInfo.UrlInfo;
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection; import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
public class BasketItem extends OPDSCatalogItem { public class BasketItem extends OPDSCatalogItem {
BasketItem(OPDSNetworkLink link, String title, String summary, UrlInfoCollection urls, Accessibility accessibility) { BasketItem(OPDSNetworkLink link, String title, String summary, UrlInfoCollection<?> urls, Accessibility accessibility) {
super(link, title, summary, urls, accessibility, FLAGS_DEFAULT & ~FLAGS_GROUP); super(link, title, summary, urls, accessibility, FLAGS_DEFAULT & ~FLAGS_GROUP);
link.setSupportsBasket(); link.setSupportsBasket();
} }

View file

@ -88,8 +88,8 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
return tags; return tags;
} }
private static UrlInfoCollection getUrls(OPDSNetworkLink networkLink, OPDSEntry entry, String baseUrl) { private static UrlInfoCollection<UrlInfo> getUrls(OPDSNetworkLink networkLink, OPDSEntry entry, String baseUrl) {
final UrlInfoCollection urls = new UrlInfoCollection(); final UrlInfoCollection<UrlInfo> urls = new UrlInfoCollection<UrlInfo>();
for (ATOMLink link: entry.Links) { for (ATOMLink link: entry.Links) {
final String href = ZLNetworkUtil.url(baseUrl, link.getHref()); final String href = ZLNetworkUtil.url(baseUrl, link.getHref());
final MimeType type = MimeType.get(link.getType()); final MimeType type = MimeType.get(link.getType());
@ -166,7 +166,7 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
} }
private static void collectReferences( private static void collectReferences(
UrlInfoCollection urls, UrlInfoCollection<UrlInfo> urls,
OPDSLink opdsLink, OPDSLink opdsLink,
String href, String href,
UrlInfo.Type type, UrlInfo.Type type,

View file

@ -39,18 +39,18 @@ public class OPDSCatalogItem extends NetworkURLCatalogItem {
private State myLoadingState; private State myLoadingState;
private final Map<String,String> myExtraData; private final Map<String,String> myExtraData;
OPDSCatalogItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Map<String,String> extraData) { OPDSCatalogItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Map<String,String> extraData) {
super(link, title, summary, urls); super(link, title, summary, urls);
myExtraData = extraData; myExtraData = extraData;
} }
protected OPDSCatalogItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection urls, Accessibility accessibility, int flags) { protected OPDSCatalogItem(OPDSNetworkLink link, CharSequence title, CharSequence summary, UrlInfoCollection<?> urls, Accessibility accessibility, int flags) {
super(link, title, summary, urls, accessibility, flags); super(link, title, summary, urls, accessibility, flags);
myExtraData = null; myExtraData = null;
} }
private static UrlInfoCollection createSimpleCollection(String url) { private static UrlInfoCollection<UrlInfo> createSimpleCollection(String url) {
final UrlInfoCollection collection = new UrlInfoCollection(); final UrlInfoCollection<UrlInfo> collection = new UrlInfoCollection<UrlInfo>();
collection.addInfo(new UrlInfo(UrlInfo.Type.Catalog, url)); collection.addInfo(new UrlInfo(UrlInfo.Type.Catalog, url));
return collection; return collection;
} }

View file

@ -19,8 +19,6 @@
package org.geometerplus.fbreader.network.opds; package org.geometerplus.fbreader.network.opds;
import java.util.*;
import org.geometerplus.zlibrary.core.util.MimeType; import org.geometerplus.zlibrary.core.util.MimeType;
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil; import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
@ -188,7 +186,7 @@ class OPDSFeedHandler implements ATOMFeedHandler<OPDSFeedMetadata,OPDSEntry>, OP
private NetworkItem readCatalogItem(OPDSEntry entry) { private NetworkItem readCatalogItem(OPDSEntry entry) {
final OPDSNetworkLink opdsLink = (OPDSNetworkLink)myData.Link; final OPDSNetworkLink opdsLink = (OPDSNetworkLink)myData.Link;
final UrlInfoCollection urlMap = new UrlInfoCollection(); final UrlInfoCollection<UrlInfo> urlMap = new UrlInfoCollection<UrlInfo>();
boolean urlIsAlternate = false; boolean urlIsAlternate = false;
String litresRel = null; String litresRel = null;

View file

@ -24,7 +24,6 @@ import java.util.*;
import org.geometerplus.zlibrary.core.constants.XMLNamespaces; import org.geometerplus.zlibrary.core.constants.XMLNamespaces;
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile; import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
import org.geometerplus.zlibrary.core.util.MimeType; import org.geometerplus.zlibrary.core.util.MimeType;
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
import org.geometerplus.zlibrary.core.xml.ZLStringMap; import org.geometerplus.zlibrary.core.xml.ZLStringMap;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;

View file

@ -26,7 +26,6 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import org.geometerplus.zlibrary.core.util.MimeType; import org.geometerplus.zlibrary.core.util.MimeType;
import org.geometerplus.zlibrary.core.util.ZLMiscUtil;
import org.geometerplus.zlibrary.core.network.ZLNetworkException; import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.core.network.ZLNetworkRequest; import org.geometerplus.zlibrary.core.network.ZLNetworkRequest;
@ -134,7 +133,7 @@ public class OPDSNetworkLink extends AbstractNetworkLink {
} }
public NetworkCatalogItem libraryItem() { public NetworkCatalogItem libraryItem() {
final UrlInfoCollection urlMap = new UrlInfoCollection(); final UrlInfoCollection<UrlInfo> urlMap = new UrlInfoCollection<UrlInfo>();
urlMap.addInfo(getUrlInfo(UrlInfo.Type.Catalog)); urlMap.addInfo(getUrlInfo(UrlInfo.Type.Catalog));
urlMap.addInfo(getUrlInfo(UrlInfo.Type.Image)); urlMap.addInfo(getUrlInfo(UrlInfo.Type.Image));
urlMap.addInfo(getUrlInfo(UrlInfo.Type.Thumbnail)); urlMap.addInfo(getUrlInfo(UrlInfo.Type.Thumbnail));

View file

@ -19,14 +19,12 @@
package org.geometerplus.fbreader.network.opds; package org.geometerplus.fbreader.network.opds;
import java.util.*;
import org.geometerplus.zlibrary.core.constants.XMLNamespaces; import org.geometerplus.zlibrary.core.constants.XMLNamespaces;
import org.geometerplus.zlibrary.core.xml.*; import org.geometerplus.zlibrary.core.xml.*;
import org.geometerplus.fbreader.network.atom.*; import org.geometerplus.fbreader.network.atom.*;
public class OPDSXMLReader extends ATOMXMLReader { public class OPDSXMLReader extends ATOMXMLReader<OPDSFeedMetadata, OPDSEntry> {
public static final String KEY_PRICE = "price"; public static final String KEY_PRICE = "price";
private DCDate myDCIssued; private DCDate myDCIssued;
@ -37,11 +35,11 @@ public class OPDSXMLReader extends ATOMXMLReader {
} }
protected final OPDSFeedMetadata getOPDSFeed() { protected final OPDSFeedMetadata getOPDSFeed() {
return (OPDSFeedMetadata)getATOMFeed(); return getATOMFeed();
} }
protected final OPDSEntry getOPDSEntry() { protected final OPDSEntry getOPDSEntry() {
return (OPDSEntry)getATOMEntry(); return getATOMEntry();
} }
protected final OPDSLink getOPDSLink() { protected final OPDSLink getOPDSLink() {

View file

@ -20,6 +20,8 @@
package org.geometerplus.fbreader.network.urlInfo; package org.geometerplus.fbreader.network.urlInfo;
public class BookBuyUrlInfo extends BookUrlInfo { public class BookBuyUrlInfo extends BookUrlInfo {
private static final long serialVersionUID = 7877935250896069650L;
public final String Price; public final String Price;
public BookBuyUrlInfo(Type type, int format, String url, String price) { public BookBuyUrlInfo(Type type, int format, String url, String price) {

View file

@ -20,6 +20,8 @@
package org.geometerplus.fbreader.network.urlInfo; package org.geometerplus.fbreader.network.urlInfo;
public class DecoratedBookUrlInfo extends BookUrlInfo { public class DecoratedBookUrlInfo extends BookUrlInfo {
private static final long serialVersionUID = 8558634525845586904L;
private final String myCleanUrl; private final String myCleanUrl;
public DecoratedBookUrlInfo(BookUrlInfo base, String url) { public DecoratedBookUrlInfo(BookUrlInfo base, String url) {

View file

@ -30,11 +30,11 @@ public class UrlInfoCollection<T extends UrlInfo> implements Serializable {
public UrlInfoCollection() { public UrlInfoCollection() {
} }
public UrlInfoCollection(UrlInfoCollection other) { public UrlInfoCollection(UrlInfoCollection<? extends T> other) {
myInfos.addAll(other.myInfos); myInfos.addAll(other.myInfos);
} }
public void upgrade(UrlInfoCollection other) { public void upgrade(UrlInfoCollection<? extends T> other) {
myInfos.removeAll(other.myInfos); myInfos.removeAll(other.myInfos);
myInfos.addAll(other.myInfos); myInfos.addAll(other.myInfos);
} }

View file

@ -20,7 +20,6 @@
package org.geometerplus.fbreader.network.urlInfo; package org.geometerplus.fbreader.network.urlInfo;
import java.util.Date; import java.util.Date;
import java.io.Serializable;
import org.geometerplus.zlibrary.core.util.ZLMiscUtil; import org.geometerplus.zlibrary.core.util.ZLMiscUtil;

View file

@ -19,7 +19,6 @@
package org.geometerplus.zlibrary.core.application; package org.geometerplus.zlibrary.core.application;
import org.geometerplus.zlibrary.core.view.ZLView;
import org.geometerplus.zlibrary.core.view.ZLViewWidget; import org.geometerplus.zlibrary.core.view.ZLViewWidget;
abstract public class ZLApplicationWindow { abstract public class ZLApplicationWindow {

View file

@ -23,13 +23,11 @@ import java.util.*;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import java.io.*; import java.io.*;
import java.net.*; import java.net.*;
import javax.net.ssl.*;
import org.apache.http.*; import org.apache.http.*;
import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials; import org.apache.http.auth.Credentials;
import org.apache.http.client.CookieStore; import org.apache.http.client.CookieStore;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*; import org.apache.http.client.methods.*;
import org.apache.http.client.protocol.ClientContext; import org.apache.http.client.protocol.ClientContext;
@ -42,7 +40,6 @@ import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.BasicHttpContext;
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil; import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
public class ZLNetworkManager { public class ZLNetworkManager {
private static ZLNetworkManager ourManager; private static ZLNetworkManager ourManager;
@ -124,10 +121,10 @@ public class ZLNetworkManager {
myHttpContext.setAttribute(ClientContext.COOKIE_STORE, myCookieStore); myHttpContext.setAttribute(ClientContext.COOKIE_STORE, myCookieStore);
} }
private void setCommonHTTPOptions(HttpMessage request) throws ZLNetworkException { /*private void setCommonHTTPOptions(HttpMessage request) throws ZLNetworkException {
//httpConnection.setInstanceFollowRedirects(true); httpConnection.setInstanceFollowRedirects(true);
//httpConnection.setAllowUserInteraction(true); httpConnection.setAllowUserInteraction(true);
} }*/
public void setCredentialsCreator(CredentialsCreator creator) { public void setCredentialsCreator(CredentialsCreator creator) {
myCredentialsCreator = creator; myCredentialsCreator = creator;

View file

@ -23,7 +23,6 @@ import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.io.InputStream; import java.io.InputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URLConnection;
public abstract class ZLNetworkRequest { public abstract class ZLNetworkRequest {
String URL; String URL;

View file

@ -34,7 +34,7 @@ public final class ZLEnumOption<T extends Enum<T>> extends ZLOption {
final String value = getConfigValue(null); final String value = getConfigValue(null);
if (value != null) { if (value != null) {
try { try {
myValue = (T)T.valueOf(myDefaultValue.getClass(), value); myValue = T.valueOf(myDefaultValue.getDeclaringClass(), value);
} catch (Throwable t) { } catch (Throwable t) {
} }
} }

View file

@ -27,10 +27,8 @@ import android.view.MenuItem;
import org.geometerplus.zlibrary.core.application.ZLApplication; import org.geometerplus.zlibrary.core.application.ZLApplication;
import org.geometerplus.zlibrary.core.application.ZLApplicationWindow; import org.geometerplus.zlibrary.core.application.ZLApplicationWindow;
import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.view.ZLView;
import org.geometerplus.zlibrary.core.view.ZLViewWidget; import org.geometerplus.zlibrary.core.view.ZLViewWidget;
import org.geometerplus.zlibrary.ui.android.view.ZLAndroidWidget;
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidLibrary; import org.geometerplus.zlibrary.ui.android.library.ZLAndroidLibrary;
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidApplication; import org.geometerplus.zlibrary.ui.android.library.ZLAndroidApplication;

View file

@ -80,8 +80,8 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
} }
super.onDraw(canvas); super.onDraw(canvas);
final int w = getWidth(); // final int w = getWidth();
final int h = getMainAreaHeight(); // final int h = getMainAreaHeight();
if (getAnimationProvider().inProgress()) { if (getAnimationProvider().inProgress()) {
onDrawInScrolling(canvas); onDrawInScrolling(canvas);
@ -118,8 +118,8 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
private void onDrawInScrolling(Canvas canvas) { private void onDrawInScrolling(Canvas canvas) {
final ZLView view = ZLApplication.Instance().getCurrentView(); final ZLView view = ZLApplication.Instance().getCurrentView();
final int w = getWidth(); // final int w = getWidth();
final int h = getMainAreaHeight(); // final int h = getMainAreaHeight();
final AnimationProvider animator = getAnimationProvider(); final AnimationProvider animator = getAnimationProvider();
final AnimationProvider.Mode oldMode = animator.getMode(); final AnimationProvider.Mode oldMode = animator.getMode();