mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
More code cleanup
This commit is contained in:
parent
f4681a7f37
commit
6b4d8cf6ea
22 changed files with 19 additions and 54 deletions
|
@ -25,7 +25,6 @@ import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
|||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ZoomButton;
|
||||
|
||||
abstract class ButtonsPopupPanel extends PopupPanel implements View.OnClickListener {
|
||||
|
|
|
@ -68,7 +68,7 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
synchronized (myPluginActions) {
|
||||
final FBReaderApp fbReader = (FBReaderApp)FBReaderApp.Instance();
|
||||
int index = 0;
|
||||
for (PluginApi.ActionInfo info : myPluginActions) {
|
||||
while (index < myPluginActions.size()) {
|
||||
fbReader.removeAction(PLUGIN_ACTION_PREFIX + index++);
|
||||
}
|
||||
myPluginActions.addAll(actions);
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.content.Context;
|
||||
import android.view.*;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.widget.*;
|
||||
|
||||
import org.geometerplus.zlibrary.ui.android.R;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import org.geometerplus.zlibrary.ui.android.R;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
package org.geometerplus.android.fbreader.api;
|
||||
|
||||
public class ApiException extends Exception {
|
||||
private static final long serialVersionUID = -6316637693779831867L;
|
||||
|
||||
ApiException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package org.geometerplus.android.fbreader.api;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.*;
|
||||
import android.net.Uri;
|
||||
import android.os.*;
|
||||
|
|
|
@ -34,15 +34,12 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
|||
|
||||
import org.geometerplus.zlibrary.ui.android.R;
|
||||
|
||||
import org.geometerplus.android.util.UIUtil;
|
||||
|
||||
import org.geometerplus.fbreader.library.*;
|
||||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
|
||||
import org.geometerplus.android.util.UIUtil;
|
||||
import org.geometerplus.android.fbreader.FBReader;
|
||||
|
||||
import org.geometerplus.android.fbreader.tree.BaseActivity;
|
||||
import org.geometerplus.android.fbreader.tree.ListAdapter;
|
||||
|
||||
public class LibraryActivity extends BaseActivity implements MenuItem.OnMenuItemClickListener, View.OnCreateContextMenuListener, Library.ChangeListener {
|
||||
public static final String SELECTED_BOOK_PATH_KEY = "SelectedBookPath";
|
||||
|
@ -75,11 +72,11 @@ public class LibraryActivity extends BaseActivity implements MenuItem.OnMenuItem
|
|||
}
|
||||
}
|
||||
|
||||
final ListAdapter adapter = new LibraryListAdapter(this);
|
||||
new LibraryListAdapter(this);
|
||||
|
||||
init(getIntent());
|
||||
|
||||
getListView().setTextFilterEnabled(true);
|
||||
|
||||
getListView().setOnCreateContextMenuListener(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,16 +19,10 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
|
||||
import org.geometerplus.fbreader.network.*;
|
||||
import org.geometerplus.fbreader.network.opds.OPDSCustomNetworkLink;
|
||||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
||||
public class NetworkTopLevelActivity extends NetworkBaseActivity {
|
||||
private volatile Intent myIntent;
|
||||
|
|
|
@ -24,7 +24,6 @@ import android.view.Menu;
|
|||
import android.view.ContextMenu;
|
||||
|
||||
import org.geometerplus.fbreader.network.NetworkTree;
|
||||
import org.geometerplus.fbreader.network.SearchResult;
|
||||
import org.geometerplus.fbreader.network.tree.SearchItemTree;
|
||||
|
||||
class SearchItemActions extends NetworkTreeActions {
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.library;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class AuthorTree extends LibraryTree {
|
||||
public final Author Author;
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.library;
|
||||
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
public class FavoritesTree extends FirstLevelTree {
|
||||
FavoritesTree(RootTree root, String id) {
|
||||
super(root, id);
|
||||
|
|
|
@ -22,20 +22,17 @@ package org.geometerplus.fbreader.library;
|
|||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
public class FirstLevelTree extends LibraryTree {
|
||||
private final Library myLibrary;
|
||||
private final String myId;
|
||||
private final ZLResource myResource;
|
||||
|
||||
FirstLevelTree(RootTree root, int position, String id) {
|
||||
super(root, position);
|
||||
myLibrary = root.getLibrary();
|
||||
myId = id;
|
||||
myResource = Library.resource().getResource(myId);
|
||||
}
|
||||
|
||||
FirstLevelTree(RootTree root, String id) {
|
||||
super(root);
|
||||
myLibrary = root.getLibrary();
|
||||
myId = id;
|
||||
myResource = Library.resource().getResource(myId);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.*;
|
|||
|
||||
import org.geometerplus.zlibrary.core.filesystem.*;
|
||||
import org.geometerplus.zlibrary.core.image.ZLImage;
|
||||
import org.geometerplus.zlibrary.core.util.ZLMiscUtil;
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
|
@ -130,18 +129,18 @@ public final class Library {
|
|||
return ZLResourceFile.createResourceFile("data/help/MiniHelp.en.fb2");
|
||||
}
|
||||
|
||||
private static Book getBook(ZLFile bookFile, FileInfoSet fileInfos, Map<Long,Book> saved, boolean doReadMetaInfo) {
|
||||
Book book = saved.remove(fileInfos.getId(bookFile));
|
||||
if (book == null) {
|
||||
doReadMetaInfo = true;
|
||||
book = new Book(bookFile);
|
||||
}
|
||||
|
||||
if (doReadMetaInfo && !book.readMetaInfo()) {
|
||||
return null;
|
||||
}
|
||||
return book;
|
||||
}
|
||||
// private static Book getBook(ZLFile bookFile, FileInfoSet fileInfos, Map<Long,Book> saved, boolean doReadMetaInfo) {
|
||||
// Book book = saved.remove(fileInfos.getId(bookFile));
|
||||
// if (book == null) {
|
||||
// doReadMetaInfo = true;
|
||||
// book = new Book(bookFile);
|
||||
// }
|
||||
//
|
||||
// if (doReadMetaInfo && !book.readMetaInfo()) {
|
||||
// return null;
|
||||
// }
|
||||
// return book;
|
||||
// }
|
||||
|
||||
private void collectBooks(
|
||||
ZLFile file, FileInfoSet fileInfos,
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.library;
|
||||
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
class RootTree extends LibraryTree {
|
||||
private final Library myLibrary;
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
|||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
import org.geometerplus.fbreader.network.tree.*;
|
||||
import org.geometerplus.fbreader.network.opds.OPDSLinkReader;
|
||||
import org.geometerplus.fbreader.network.urlInfo.*;
|
||||
|
||||
public class NetworkLibrary {
|
||||
private static NetworkLibrary ourInstance;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.network;
|
||||
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
|
||||
|
||||
public class TopUpItem extends NetworkItem {
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.geometerplus.fbreader.network.authentication.litres;
|
|||
import java.util.*;
|
||||
|
||||
import org.geometerplus.zlibrary.core.xml.*;
|
||||
import org.geometerplus.zlibrary.core.util.MimeType;
|
||||
|
||||
import org.geometerplus.fbreader.network.NetworkItem;
|
||||
import org.geometerplus.fbreader.network.opds.OPDSBookItem;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.geometerplus.fbreader.tree;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.geometerplus.zlibrary.core.tree.ZLTree;
|
||||
|
|
|
@ -61,7 +61,7 @@ public abstract class ZLTree<T extends ZLTree<T>> implements Iterable<T> {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
synchronized (mySubTrees) {
|
||||
return new ArrayList(mySubTrees);
|
||||
return new ArrayList<T>(mySubTrees);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,6 @@ class ZLTextSelection implements ZLTextAbstractHighlighting {
|
|||
if (isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
final ZLTextElementAreaVector vector = page.TextElementMap;
|
||||
final ZLTextElementArea firstPageArea = page.TextElementMap.getFirstArea();
|
||||
if (firstPageArea == null) {
|
||||
return false;
|
||||
|
|
|
@ -1052,9 +1052,6 @@ public abstract class ZLTextView extends ZLTextViewBase {
|
|||
--spaceCounter;
|
||||
}
|
||||
} else if (element instanceof ZLTextWord || element instanceof ZLTextImageElement) {
|
||||
if (element instanceof ZLTextWord) {
|
||||
ZLTextWord word = (ZLTextWord)element;
|
||||
}
|
||||
final int height = getElementHeight(element);
|
||||
final int descent = getElementDescent(element);
|
||||
final int length = element instanceof ZLTextWord ? ((ZLTextWord)element).Length : 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue