1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

synchronization with 'selection' branch

This commit is contained in:
Nikolay Pultsin 2011-06-10 05:58:33 +02:00
parent 6b81ed09e2
commit 8badfdeeb9

View file

@ -82,6 +82,9 @@ public final class FBReader extends ZLAndroidActivity {
if (fbReader.getPopupById(NavigationPopup.ID) == null) { if (fbReader.getPopupById(NavigationPopup.ID) == null) {
new NavigationPopup(fbReader); new NavigationPopup(fbReader);
} }
if (fbReader.getPopupById(SelectionPopup.ID) == null) {
new SelectionPopup(fbReader);
}
fbReader.addAction(ActionCode.SHOW_LIBRARY, new ShowLibraryAction(this, fbReader)); fbReader.addAction(ActionCode.SHOW_LIBRARY, new ShowLibraryAction(this, fbReader));
fbReader.addAction(ActionCode.SHOW_PREFERENCES, new ShowPreferencesAction(this, fbReader)); fbReader.addAction(ActionCode.SHOW_PREFERENCES, new ShowPreferencesAction(this, fbReader));
@ -175,6 +178,7 @@ public final class FBReader extends ZLAndroidActivity {
final RelativeLayout root = (RelativeLayout)findViewById(R.id.root_view); final RelativeLayout root = (RelativeLayout)findViewById(R.id.root_view);
((PopupPanel)fbReader.getPopupById(TextSearchPopup.ID)).createControlPanel(this, root, PopupWindow.Location.Bottom); ((PopupPanel)fbReader.getPopupById(TextSearchPopup.ID)).createControlPanel(this, root, PopupWindow.Location.Bottom);
((PopupPanel)fbReader.getPopupById(NavigationPopup.ID)).createControlPanel(this, root, PopupWindow.Location.Bottom); ((PopupPanel)fbReader.getPopupById(NavigationPopup.ID)).createControlPanel(this, root, PopupWindow.Location.Bottom);
((PopupPanel)fbReader.getPopupById(SelectionPopup.ID)).createControlPanel(this, root, PopupWindow.Location.Floating);
} }
@Override @Override
@ -220,13 +224,19 @@ public final class FBReader extends ZLAndroidActivity {
} }
public void showSelectionPanel() { public void showSelectionPanel() {
final ZLTextView view = ((FBReaderApp)FBReaderApp.Instance()).getTextView(); final FBReaderApp fbReader = (FBReaderApp)FBReaderApp.Instance();
//ourSelectionPanel.move(view.getSelectionStartY(), view.getSelectionEndY()); final ZLTextView view = fbReader.getTextView();
//ourSelectionPanel.show(true); ((SelectionPopup)fbReader.getPopupById(SelectionPopup.ID))
.move(view.getSelectionStartY(), view.getSelectionEndY());
fbReader.showPopup(SelectionPopup.ID);
} }
public void hideSelectionPanel() { public void hideSelectionPanel() {
//ourSelectionPanel.hide(); final FBReaderApp fbReader = (FBReaderApp)FBReaderApp.Instance();
final FBReaderApp.PopupPanel popup = fbReader.getActivePopup();
if (popup != null && popup.getId() == SelectionPopup.ID) {
FBReaderApp.Instance().hideActivePopup();
}
} }
@Override @Override