mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
navigaion code has been simplified
This commit is contained in:
parent
dfb63f1961
commit
142b5c06eb
7 changed files with 9 additions and 61 deletions
|
@ -47,7 +47,7 @@ import org.geometerplus.fbreader.fbreader.ActionCode;
|
|||
import org.geometerplus.fbreader.library.Library;
|
||||
|
||||
public final class FBReader extends ZLAndroidActivity {
|
||||
static FBReader Instance;
|
||||
public static FBReader Instance;
|
||||
|
||||
private int myFullScreenFlag;
|
||||
|
||||
|
@ -203,31 +203,13 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void navigate() {
|
||||
final ZLTextView textView = (ZLTextView) ZLApplication.Instance().getCurrentView();
|
||||
final ZLTextView textView = (ZLTextView)ZLApplication.Instance().getCurrentView();
|
||||
myNavigatePanel.NavigateDragging = false;
|
||||
myNavigatePanel.StartPosition = new ZLTextFixedPosition(textView.getStartCursor());
|
||||
myNavigatePanel.show(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final boolean canNavigate() {
|
||||
final org.geometerplus.fbreader.fbreader.FBReader fbreader =
|
||||
(org.geometerplus.fbreader.fbreader.FBReader)ZLApplication.Instance();
|
||||
final ZLView view = fbreader.getCurrentView();
|
||||
if (!(view instanceof ZLTextView)) {
|
||||
return false;
|
||||
}
|
||||
final ZLTextModel textModel = ((ZLTextView) view).getModel();
|
||||
if (textModel == null || textModel.getParagraphsNumber() == 0) {
|
||||
return false;
|
||||
}
|
||||
final BookModel bookModel = fbreader.Model;
|
||||
return bookModel != null && bookModel.Book != null;
|
||||
}
|
||||
|
||||
private final void createNavigation(View layout) {
|
||||
final SeekBar slider = (SeekBar) layout.findViewById(R.id.book_position_slider);
|
||||
final TextView text = (TextView) layout.findViewById(R.id.book_position_text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue