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

formatting cleanup

This commit is contained in:
Nikolay Pultsin 2012-04-18 03:27:07 +01:00
parent 6aa822b126
commit 9db7ec0a18
11 changed files with 47 additions and 47 deletions

View file

@ -106,7 +106,7 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte
if (!Intent.ACTION_SEARCH.equals(intent.getAction())) {
return;
}
String pattern = intent.getStringExtra(SearchManager.QUERY);
String pattern = intent.getStringExtra(SearchManager.QUERY);
myBookmarkSearchPatternOption.setValue(pattern);
final LinkedList<Bookmark> bookmarks = new LinkedList<Bookmark>();
@ -192,8 +192,8 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte
gotoBookmark(bookmark);
return true;
case EDIT_ITEM_ID:
final Intent intent = new Intent(this, BookmarkEditActivity.class);
startActivityForResult(intent, 1);
final Intent intent = new Intent(this, BookmarkEditActivity.class);
startActivityForResult(intent, 1);
// TODO: implement
return true;
case DELETE_ITEM_ID:

View file

@ -33,7 +33,7 @@ public class SelectionBookmarkAction extends FBAndroidAction {
}
@Override
protected void run(Object ... params) {
protected void run(Object ... params) {
final FBView fbview = Reader.getTextView();
final String text = fbview.getSelectedText();
@ -44,7 +44,7 @@ public class SelectionBookmarkAction extends FBAndroidAction {
text,
true
).save();
fbview.clearSelection();
fbview.clearSelection();
UIUtil.showMessageText(
BaseActivity,

View file

@ -46,26 +46,26 @@ class SelectionPopup extends ButtonsPopupPanel {
myWindow = new PopupWindow(activity, root, PopupWindow.Location.Floating, false);
addButton(ActionCode.SELECTION_COPY_TO_CLIPBOARD, true, R.drawable.selection_copy);
addButton(ActionCode.SELECTION_SHARE, true, R.drawable.selection_share);
addButton(ActionCode.SELECTION_TRANSLATE, true, R.drawable.selection_translate);
addButton(ActionCode.SELECTION_BOOKMARK, true, R.drawable.selection_bookmark);
addButton(ActionCode.SELECTION_CLEAR, true, R.drawable.selection_close);
}
addButton(ActionCode.SELECTION_COPY_TO_CLIPBOARD, true, R.drawable.selection_copy);
addButton(ActionCode.SELECTION_SHARE, true, R.drawable.selection_share);
addButton(ActionCode.SELECTION_TRANSLATE, true, R.drawable.selection_translate);
addButton(ActionCode.SELECTION_BOOKMARK, true, R.drawable.selection_bookmark);
addButton(ActionCode.SELECTION_CLEAR, true, R.drawable.selection_close);
}
public void move(int selectionStartY, int selectionEndY) {
public void move(int selectionStartY, int selectionEndY) {
if (myWindow == null) {
return;
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
RelativeLayout.LayoutParams.WRAP_CONTENT
);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
final int verticalPosition;
final int screenHeight = ((View)myWindow.getParent()).getHeight();
final int verticalPosition;
final int screenHeight = ((View)myWindow.getParent()).getHeight();
final int diffTop = screenHeight - selectionEndY;
final int diffBottom = selectionStartY;
if (diffTop > diffBottom) {
@ -76,7 +76,7 @@ class SelectionPopup extends ButtonsPopupPanel {
? RelativeLayout.ALIGN_PARENT_TOP : RelativeLayout.CENTER_VERTICAL;
}
layoutParams.addRule(verticalPosition);
myWindow.setLayoutParams(layoutParams);
}
layoutParams.addRule(verticalPosition);
myWindow.setLayoutParams(layoutParams);
}
}

View file

@ -23,20 +23,20 @@ import org.geometerplus.fbreader.fbreader.FBReaderApp;
import org.geometerplus.fbreader.fbreader.FBView;
public class SelectionTranslateAction extends FBAndroidAction {
SelectionTranslateAction(FBReader baseActivity, FBReaderApp fbreader) {
super(baseActivity, fbreader);
}
SelectionTranslateAction(FBReader baseActivity, FBReaderApp fbreader) {
super(baseActivity, fbreader);
}
@Override
protected void run(Object ... params) {
final FBView fbview = Reader.getTextView();
DictionaryUtil.openTextInDictionary(
protected void run(Object ... params) {
final FBView fbview = Reader.getTextView();
DictionaryUtil.openTextInDictionary(
BaseActivity,
fbview.getSelectedText(),
fbview.getSelectedText(),
fbview.getCountOfSelectedWords() == 1,
fbview.getSelectionStartY(),
fbview.getSelectionStartY(),
fbview.getSelectionEndY()
);
fbview.clearSelection();
}
fbview.clearSelection();
}
}