mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
formatting + @Override annotations
This commit is contained in:
parent
0f5fd75544
commit
cf76b17a70
3 changed files with 19 additions and 6 deletions
|
@ -59,7 +59,6 @@ public class BookDownloaderService extends Service {
|
|||
int ALL = 0x0003;
|
||||
}
|
||||
|
||||
|
||||
private Set<String> myDownloadingURLs = Collections.synchronizedSet(new HashSet<String>());
|
||||
private Set<Integer> myOngoingNotifications = new HashSet<Integer>();
|
||||
|
||||
|
@ -91,7 +90,7 @@ public class BookDownloaderService extends Service {
|
|||
@Override
|
||||
public void onDestroy() {
|
||||
final NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
for (int notificationId: myOngoingNotifications) {
|
||||
for (int notificationId : myOngoingNotifications) {
|
||||
notificationManager.cancel(notificationId);
|
||||
}
|
||||
myOngoingNotifications.clear();
|
||||
|
@ -250,7 +249,7 @@ public class BookDownloaderService extends Service {
|
|||
final int notificationId = NetworkNotifications.Instance().getBookDownloadingId();
|
||||
final Notification progressNotification = createDownloadProgressNotification(title);
|
||||
|
||||
final NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
final NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
|
||||
myOngoingNotifications.add(Integer.valueOf(notificationId));
|
||||
notificationManager.notify(notificationId, progressNotification);
|
||||
|
||||
|
|
|
@ -75,9 +75,9 @@ class ZLAndroidImageLoader {
|
|||
private class ImageSynchronizedHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(Message message) {
|
||||
final String imageUrl = (String) message.obj;
|
||||
final String imageUrl = (String)message.obj;
|
||||
final LinkedList<Runnable> runables = myOnImageSyncRunnables.remove(imageUrl);
|
||||
for (Runnable runnable: runables) {
|
||||
for (Runnable runnable : runables) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,20 +147,24 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
myBitmapManager.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repaint() {
|
||||
postInvalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startManualScrolling(int x, int y, ZLView.Direction direction) {
|
||||
final AnimationProvider animator = getAnimationProvider();
|
||||
animator.setup(direction, getWidth(), getMainAreaHeight());
|
||||
animator.startManualScrolling(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollManuallyTo(int x, int y) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
final AnimationProvider animator = getAnimationProvider();
|
||||
|
@ -170,6 +174,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAnimatedScrolling(ZLView.PageIndex pageIndex, int x, int y, ZLView.Direction direction, int speed) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
if (pageIndex == ZLView.PageIndex.current || !view.canScroll(pageIndex)) {
|
||||
|
@ -183,6 +188,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAnimatedScrolling(ZLView.PageIndex pageIndex, ZLView.Direction direction, int speed) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
if (pageIndex == ZLView.PageIndex.current || !view.canScroll(pageIndex)) {
|
||||
|
@ -196,6 +202,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAnimatedScrolling(int x, int y, int speed) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
final AnimationProvider animator = getAnimationProvider();
|
||||
|
@ -278,8 +285,8 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
private class LongClickRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
if (performLongClick()) {
|
||||
myLongClickPerformed = true;
|
||||
|
@ -299,6 +306,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
|
||||
private class ShortClickRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
view.onFingerSingleTap(myPressedX, myPressedY);
|
||||
|
@ -394,6 +402,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
return view.onFingerLongPress(myPressedX, myPressedY);
|
||||
|
@ -402,6 +411,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
private int myKeyUnderTracking = -1;
|
||||
private long myTrackingStartTime;
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
final ZLApplication application = ZLApplication.Instance();
|
||||
|
||||
|
@ -426,6 +436,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (myKeyUnderTracking != -1) {
|
||||
if (myKeyUnderTracking == keyCode) {
|
||||
|
@ -443,6 +454,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int computeVerticalScrollExtent() {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
if (!view.isScrollbarShown()) {
|
||||
|
@ -459,6 +471,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int computeVerticalScrollOffset() {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
if (!view.isScrollbarShown()) {
|
||||
|
@ -475,6 +488,7 @@ public class ZLAndroidWidget extends View implements ZLViewWidget, View.OnLongCl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int computeVerticalScrollRange() {
|
||||
final ZLView view = ZLApplication.Instance().getCurrentView();
|
||||
if (!view.isScrollbarShown()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue