mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
Warnings cleanup
This commit is contained in:
parent
3b35072721
commit
08e9c493aa
44 changed files with 60 additions and 105 deletions
|
@ -22,6 +22,8 @@ public final class ZipFile {
|
|||
|
||||
private final InputStreamHolder myStreamHolder;
|
||||
private final LinkedHashMap<String,LocalFileHeader> myFileHeaders = new LinkedHashMap<String,LocalFileHeader>() {
|
||||
private static final long serialVersionUID = -4412796553514902113L;
|
||||
|
||||
@Override
|
||||
public LocalFileHeader get(Object key) {
|
||||
return super.get(((String)key).toLowerCase());
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import java.net.*;
|
||||
|
||||
import android.app.*;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
|
|
|
@ -302,10 +302,6 @@ class NetworkCatalogActions extends NetworkTreeActions {
|
|||
myResumeNotLoad = resumeNotLoad;
|
||||
}
|
||||
|
||||
public String getResourceKey() {
|
||||
return "downloadingCatalogs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doBefore() throws ZLNetworkException {
|
||||
final INetworkLink link = myTree.Item.Link;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
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.UsernamePasswordCredentials;
|
||||
|
||||
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
|
||||
import org.geometerplus.zlibrary.core.network.ZLNetworkManager;
|
||||
import org.geometerplus.zlibrary.core.options.ZLStringOption;
|
||||
|
||||
import org.geometerplus.fbreader.network.*;
|
||||
import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager;
|
||||
import org.geometerplus.fbreader.network.tree.*;
|
||||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
|
||||
|
|
|
@ -64,10 +64,6 @@ public class NetworkSearchActivity extends Activity {
|
|||
myPattern = pattern;
|
||||
}
|
||||
|
||||
public String getResourceKey() {
|
||||
return "searchingNetwork";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doBefore() {
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
|
|
@ -129,7 +129,7 @@ class AnimationSpeedPreference extends DialogPreference implements ZLPreference
|
|||
final int max = mySlider.getMax();
|
||||
if (progress >= max / 3) {
|
||||
final String text = myResource.getResource("slow").getValue();
|
||||
final float textWidth = myOutlinePaint.measureText(text);
|
||||
//final float textWidth = myOutlinePaint.measureText(text);
|
||||
final float x = 6;
|
||||
canvas.drawText(text, x, y, myOutlinePaint);
|
||||
canvas.drawText(text, x, y, myPaint);
|
||||
|
|
|
@ -32,7 +32,7 @@ class ZLEnumPreference<T extends Enum<T>> extends ZLStringListPreference {
|
|||
myOption = option;
|
||||
|
||||
final T initialValue = option.getValue();
|
||||
final Enum[] allValues = initialValue.getClass().getEnumConstants();
|
||||
final T[] allValues = initialValue.getDeclaringClass().getEnumConstants();
|
||||
final String[] stringValues = new String[allValues.length];
|
||||
for (int i = 0; i < stringValues.length; ++i) {
|
||||
stringValues[i] = allValues[i].toString();
|
||||
|
@ -42,6 +42,6 @@ class ZLEnumPreference<T extends Enum<T>> extends ZLStringListPreference {
|
|||
}
|
||||
|
||||
public void onAccept() {
|
||||
myOption.setValue((T)Enum.valueOf(myOption.getValue().getClass(), getValue()));
|
||||
myOption.setValue(Enum.valueOf(myOption.getValue().getDeclaringClass(), getValue()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.geometerplus.fbreader.fbreader;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.application.ZLApplication;
|
||||
import org.geometerplus.zlibrary.core.util.ZLColor;
|
||||
import org.geometerplus.zlibrary.core.library.ZLibrary;
|
||||
import org.geometerplus.zlibrary.core.view.ZLPaintContext;
|
||||
|
@ -505,11 +504,11 @@ public final class FBView extends ZLTextView {
|
|||
|
||||
// TODO: remove
|
||||
int myGaugeWidth = 1;
|
||||
public int getGaugeWidth() {
|
||||
/*public int getGaugeWidth() {
|
||||
return myGaugeWidth;
|
||||
}
|
||||
}*/
|
||||
|
||||
public void setProgress(int x) {
|
||||
/*public void setProgress(int x) {
|
||||
// set progress according to tap coordinate
|
||||
int gaugeWidth = getGaugeWidth();
|
||||
float progress = 1.0f * Math.min(x, gaugeWidth) / gaugeWidth;
|
||||
|
@ -521,7 +520,7 @@ public final class FBView extends ZLTextView {
|
|||
}
|
||||
myReader.getViewWidget().reset();
|
||||
myReader.getViewWidget().repaint();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private Footer myFooter;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.fbreader;
|
||||
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextWordCursor;
|
||||
|
||||
class TurnPageAction extends FBAction {
|
||||
private final boolean myForward;
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.fbreader;
|
||||
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextWordCursor;
|
||||
|
||||
class VolumeKeyTurnPageAction extends FBAction {
|
||||
private final boolean myForward;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.geometerplus.fbreader.network;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.util.ZLMiscUtil;
|
||||
import org.geometerplus.zlibrary.core.options.ZLStringListOption;
|
||||
|
||||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.network;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
|
||||
|
||||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
|
|
@ -97,7 +97,7 @@ public class NetworkBookItem extends NetworkItem {
|
|||
public NetworkBookItem(INetworkLink link, String id, int index,
|
||||
CharSequence title, CharSequence summary, /*String language, String date,*/
|
||||
List<AuthorData> authors, List<String> tags, String seriesTitle, float indexInSeries,
|
||||
UrlInfoCollection urls) {
|
||||
UrlInfoCollection<?> urls) {
|
||||
super(link, title, summary, urls);
|
||||
Index = index;
|
||||
Id = id;
|
||||
|
|
|
@ -64,7 +64,7 @@ public abstract class NetworkCatalogItem extends NetworkItem {
|
|||
* in the network library view.
|
||||
* @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);
|
||||
myAccessibility = accessibility;
|
||||
Flags = flags;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.network;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
||||
public abstract class NetworkDatabase {
|
||||
|
|
|
@ -29,7 +29,7 @@ public abstract class NetworkItem {
|
|||
public final CharSequence Title;
|
||||
|
||||
private CharSequence mySummary;
|
||||
private final UrlInfoCollection myURLs;
|
||||
private final UrlInfoCollection<UrlInfo> myURLs;
|
||||
|
||||
/**
|
||||
* 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 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;
|
||||
Title = title != null ? title : "";
|
||||
setSummary(summary);
|
||||
if (urls != null && !urls.isEmpty()) {
|
||||
myURLs = new UrlInfoCollection(urls);
|
||||
myURLs = new UrlInfoCollection<UrlInfo>(urls);
|
||||
} else {
|
||||
myURLs = null;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public abstract class NetworkItem {
|
|||
return mySummary;
|
||||
}
|
||||
|
||||
protected void addUrls(UrlInfoCollection urls) {
|
||||
protected void addUrls(UrlInfoCollection<?> urls) {
|
||||
myURLs.upgrade(urls);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class NetworkURLCatalogItem extends NetworkCatalogItem {
|
|||
* @param summary description of this library item. 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);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public abstract class NetworkURLCatalogItem extends NetworkCatalogItem {
|
|||
* in the network library view.
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
|||
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
|
||||
|
||||
public class TopUpItem extends NetworkItem {
|
||||
public TopUpItem(INetworkLink link, UrlInfoCollection urls) {
|
||||
public TopUpItem(INetworkLink link, UrlInfoCollection<?> urls) {
|
||||
super(
|
||||
link,
|
||||
ZLResource.resource("networkView").getResource("topupTitle").getValue(),
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.geometerplus.zlibrary.core.util.MimeType;
|
|||
import org.geometerplus.zlibrary.core.xml.ZLStringMap;
|
||||
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) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return null;
|
||||
|
@ -34,10 +34,10 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
|
|||
return str.intern();
|
||||
}
|
||||
|
||||
private final ATOMFeedHandler myFeedHandler;
|
||||
private final ATOMFeedHandler<T1, T2> myFeedHandler;
|
||||
|
||||
private ATOMFeedMetadata myFeed;
|
||||
private ATOMEntry myEntry;
|
||||
private T1 myFeed;
|
||||
private T2 myEntry;
|
||||
private ATOMAuthor myAuthor;
|
||||
private ATOMId myId;
|
||||
private ATOMLink myLink;
|
||||
|
@ -99,20 +99,20 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
|
|||
protected final FormattedBuffer myFormattedBuffer = new FormattedBuffer();
|
||||
protected boolean myFeedMetadataProcessed;
|
||||
|
||||
public ATOMXMLReader(ATOMFeedHandler handler, boolean readEntryNotFeed) {
|
||||
public ATOMXMLReader(ATOMFeedHandler<T1, T2> handler, boolean readEntryNotFeed) {
|
||||
myFeedHandler = handler;
|
||||
myState = readEntryNotFeed ? FEED : START;
|
||||
}
|
||||
|
||||
protected final ATOMFeedHandler getATOMFeedHandler() {
|
||||
protected final ATOMFeedHandler<T1, T2> getATOMFeedHandler() {
|
||||
return myFeedHandler;
|
||||
}
|
||||
|
||||
protected final ATOMFeedMetadata getATOMFeed() {
|
||||
protected final T1 getATOMFeed() {
|
||||
return myFeed;
|
||||
}
|
||||
|
||||
protected final ATOMEntry getATOMEntry() {
|
||||
protected final T2 getATOMEntry() {
|
||||
return myEntry;
|
||||
}
|
||||
|
||||
|
@ -175,17 +175,13 @@ public class ATOMXMLReader extends ZLXMLReaderAdapter {
|
|||
return new String(bufferContentArray);
|
||||
}
|
||||
|
||||
protected ATOMFeedMetadata createFeed(ZLStringMap attributes) {
|
||||
return new ATOMFeedMetadata(attributes);
|
||||
}
|
||||
protected abstract T1 createFeed(ZLStringMap attributes);
|
||||
protected abstract T2 createEntry(ZLStringMap attributes);
|
||||
|
||||
protected ATOMLink createLink(ZLStringMap attributes) {
|
||||
return new ATOMLink(attributes);
|
||||
}
|
||||
|
||||
protected ATOMEntry createEntry(ZLStringMap attributes) {
|
||||
return new ATOMEntry(attributes);
|
||||
}
|
||||
|
||||
public boolean startElementHandler(
|
||||
final String ns, final String tag,
|
||||
|
|
|
@ -21,10 +21,7 @@ package org.geometerplus.fbreader.network.atom;
|
|||
|
||||
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.atom.ATOMConstants;
|
||||
|
||||
public class FormattedBuffer {
|
||||
public static enum Type {
|
||||
|
|
|
@ -161,7 +161,7 @@ class BySeriesCatalogItem extends SortedCatalogItem {
|
|||
public class LitResBookshelfItem extends NetworkURLCatalogItem {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.network.authentication.litres;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.geometerplus.fbreader.network.opds.OPDSNetworkLink;
|
|||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.geometerplus.fbreader.network.authentication.litres;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.util.MimeType;
|
||||
import org.geometerplus.zlibrary.core.xml.*;
|
||||
|
||||
import org.geometerplus.fbreader.network.*;
|
||||
|
@ -43,7 +42,7 @@ class LitResXMLReader extends LitResAuthenticationXMLReader {
|
|||
|
||||
private CharSequence mySummary;
|
||||
|
||||
private final UrlInfoCollection myUrls = new UrlInfoCollection();
|
||||
private final UrlInfoCollection<UrlInfo> myUrls = new UrlInfoCollection<UrlInfo>();
|
||||
|
||||
private String myAuthorFirstName;
|
||||
private String myAuthorMiddleName;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.geometerplus.fbreader.network.urlInfo.UrlInfo;
|
|||
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
|
||||
|
||||
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);
|
||||
link.setSupportsBasket();
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
|
|||
return tags;
|
||||
}
|
||||
|
||||
private static UrlInfoCollection getUrls(OPDSNetworkLink networkLink, OPDSEntry entry, String baseUrl) {
|
||||
final UrlInfoCollection urls = new UrlInfoCollection();
|
||||
private static UrlInfoCollection<UrlInfo> getUrls(OPDSNetworkLink networkLink, OPDSEntry entry, String baseUrl) {
|
||||
final UrlInfoCollection<UrlInfo> urls = new UrlInfoCollection<UrlInfo>();
|
||||
for (ATOMLink link: entry.Links) {
|
||||
final String href = ZLNetworkUtil.url(baseUrl, link.getHref());
|
||||
final MimeType type = MimeType.get(link.getType());
|
||||
|
@ -166,7 +166,7 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
|
|||
}
|
||||
|
||||
private static void collectReferences(
|
||||
UrlInfoCollection urls,
|
||||
UrlInfoCollection<UrlInfo> urls,
|
||||
OPDSLink opdsLink,
|
||||
String href,
|
||||
UrlInfo.Type type,
|
||||
|
|
|
@ -39,18 +39,18 @@ public class OPDSCatalogItem extends NetworkURLCatalogItem {
|
|||
private State myLoadingState;
|
||||
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);
|
||||
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);
|
||||
myExtraData = null;
|
||||
}
|
||||
|
||||
private static UrlInfoCollection createSimpleCollection(String url) {
|
||||
final UrlInfoCollection collection = new UrlInfoCollection();
|
||||
private static UrlInfoCollection<UrlInfo> createSimpleCollection(String url) {
|
||||
final UrlInfoCollection<UrlInfo> collection = new UrlInfoCollection<UrlInfo>();
|
||||
collection.addInfo(new UrlInfo(UrlInfo.Type.Catalog, url));
|
||||
return collection;
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.network.opds;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.util.MimeType;
|
||||
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
|
||||
|
||||
|
@ -188,7 +186,7 @@ class OPDSFeedHandler implements ATOMFeedHandler<OPDSFeedMetadata,OPDSEntry>, OP
|
|||
|
||||
private NetworkItem readCatalogItem(OPDSEntry entry) {
|
||||
final OPDSNetworkLink opdsLink = (OPDSNetworkLink)myData.Link;
|
||||
final UrlInfoCollection urlMap = new UrlInfoCollection();
|
||||
final UrlInfoCollection<UrlInfo> urlMap = new UrlInfoCollection<UrlInfo>();
|
||||
|
||||
boolean urlIsAlternate = false;
|
||||
String litresRel = null;
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.*;
|
|||
import org.geometerplus.zlibrary.core.constants.XMLNamespaces;
|
||||
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
|
||||
import org.geometerplus.zlibrary.core.util.MimeType;
|
||||
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
|
||||
import org.geometerplus.zlibrary.core.xml.ZLStringMap;
|
||||
|
||||
import org.geometerplus.fbreader.network.*;
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.io.IOException;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
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.ZLNetworkRequest;
|
||||
|
||||
|
@ -134,7 +133,7 @@ public class OPDSNetworkLink extends AbstractNetworkLink {
|
|||
}
|
||||
|
||||
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.Image));
|
||||
urlMap.addInfo(getUrlInfo(UrlInfo.Type.Thumbnail));
|
||||
|
|
|
@ -19,14 +19,12 @@
|
|||
|
||||
package org.geometerplus.fbreader.network.opds;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.constants.XMLNamespaces;
|
||||
import org.geometerplus.zlibrary.core.xml.*;
|
||||
|
||||
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";
|
||||
|
||||
private DCDate myDCIssued;
|
||||
|
@ -37,11 +35,11 @@ public class OPDSXMLReader extends ATOMXMLReader {
|
|||
}
|
||||
|
||||
protected final OPDSFeedMetadata getOPDSFeed() {
|
||||
return (OPDSFeedMetadata)getATOMFeed();
|
||||
return getATOMFeed();
|
||||
}
|
||||
|
||||
protected final OPDSEntry getOPDSEntry() {
|
||||
return (OPDSEntry)getATOMEntry();
|
||||
return getATOMEntry();
|
||||
}
|
||||
|
||||
protected final OPDSLink getOPDSLink() {
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
package org.geometerplus.fbreader.network.urlInfo;
|
||||
|
||||
public class BookBuyUrlInfo extends BookUrlInfo {
|
||||
private static final long serialVersionUID = 7877935250896069650L;
|
||||
|
||||
public final String Price;
|
||||
|
||||
public BookBuyUrlInfo(Type type, int format, String url, String price) {
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
package org.geometerplus.fbreader.network.urlInfo;
|
||||
|
||||
public class DecoratedBookUrlInfo extends BookUrlInfo {
|
||||
private static final long serialVersionUID = 8558634525845586904L;
|
||||
|
||||
private final String myCleanUrl;
|
||||
|
||||
public DecoratedBookUrlInfo(BookUrlInfo base, String url) {
|
||||
|
|
|
@ -30,11 +30,11 @@ public class UrlInfoCollection<T extends UrlInfo> implements Serializable {
|
|||
public UrlInfoCollection() {
|
||||
}
|
||||
|
||||
public UrlInfoCollection(UrlInfoCollection other) {
|
||||
public UrlInfoCollection(UrlInfoCollection<? extends T> other) {
|
||||
myInfos.addAll(other.myInfos);
|
||||
}
|
||||
|
||||
public void upgrade(UrlInfoCollection other) {
|
||||
public void upgrade(UrlInfoCollection<? extends T> other) {
|
||||
myInfos.removeAll(other.myInfos);
|
||||
myInfos.addAll(other.myInfos);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.geometerplus.fbreader.network.urlInfo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.geometerplus.zlibrary.core.util.ZLMiscUtil;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.geometerplus.zlibrary.core.application;
|
||||
|
||||
import org.geometerplus.zlibrary.core.view.ZLView;
|
||||
import org.geometerplus.zlibrary.core.view.ZLViewWidget;
|
||||
|
||||
abstract public class ZLApplicationWindow {
|
||||
|
|
|
@ -23,13 +23,11 @@ import java.util.*;
|
|||
import java.util.zip.GZIPInputStream;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import javax.net.ssl.*;
|
||||
|
||||
import org.apache.http.*;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.Credentials;
|
||||
import org.apache.http.client.CookieStore;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.*;
|
||||
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.geometerplus.zlibrary.core.util.ZLNetworkUtil;
|
||||
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
|
||||
|
||||
public class ZLNetworkManager {
|
||||
private static ZLNetworkManager ourManager;
|
||||
|
@ -124,10 +121,10 @@ public class ZLNetworkManager {
|
|||
myHttpContext.setAttribute(ClientContext.COOKIE_STORE, myCookieStore);
|
||||
}
|
||||
|
||||
private void setCommonHTTPOptions(HttpMessage request) throws ZLNetworkException {
|
||||
//httpConnection.setInstanceFollowRedirects(true);
|
||||
//httpConnection.setAllowUserInteraction(true);
|
||||
}
|
||||
/*private void setCommonHTTPOptions(HttpMessage request) throws ZLNetworkException {
|
||||
httpConnection.setInstanceFollowRedirects(true);
|
||||
httpConnection.setAllowUserInteraction(true);
|
||||
}*/
|
||||
|
||||
public void setCredentialsCreator(CredentialsCreator creator) {
|
||||
myCredentialsCreator = creator;
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Map;
|
|||
import java.util.HashMap;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLConnection;
|
||||
|
||||
public abstract class ZLNetworkRequest {
|
||||
String URL;
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class ZLEnumOption<T extends Enum<T>> extends ZLOption {
|
|||
final String value = getConfigValue(null);
|
||||
if (value != null) {
|
||||
try {
|
||||
myValue = (T)T.valueOf(myDefaultValue.getClass(), value);
|
||||
myValue = T.valueOf(myDefaultValue.getDeclaringClass(), value);
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,10 +27,8 @@ import android.view.MenuItem;
|
|||
import org.geometerplus.zlibrary.core.application.ZLApplication;
|
||||
import org.geometerplus.zlibrary.core.application.ZLApplicationWindow;
|
||||
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.ui.android.view.ZLAndroidWidget;
|
||||
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidLibrary;
|
||||
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidApplication;
|
||||
|
||||
|
|
|
@ -80,8 +80,8 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
super.onDraw(canvas);
|
||||
|
||||
final int w = getWidth();
|
||||
final int h = getMainAreaHeight();
|
||||
// final int w = getWidth();
|
||||
// final int h = getMainAreaHeight();
|
||||
|
||||
if (getAnimationProvider().inProgress()) {
|
||||
onDrawInScrolling(canvas);
|
||||
|
@ -118,8 +118,8 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
private void onDrawInScrolling(Canvas canvas) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
|
||||
final int w = getWidth();
|
||||
final int h = getMainAreaHeight();
|
||||
// final int w = getWidth();
|
||||
// final int h = getMainAreaHeight();
|
||||
|
||||
final AnimationProvider animator = getAnimationProvider();
|
||||
final AnimationProvider.Mode oldMode = animator.getMode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue