mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
list of cancel actions
This commit is contained in:
parent
a2bd14443e
commit
b638a3f431
6 changed files with 140 additions and 19 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import android.app.SearchManager;
|
||||
|
@ -58,6 +59,7 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
public static final String BOOK_PATH_KEY = "BookPath";
|
||||
|
||||
final static int REPAINT_CODE = 1;
|
||||
final static int CANCEL_CODE = 2;
|
||||
|
||||
private int myFullScreenFlag;
|
||||
|
||||
|
@ -252,6 +254,9 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
return true;
|
||||
}
|
||||
|
||||
final ArrayList<CancelAction.Description> CancelActionsList =
|
||||
new ArrayList<CancelAction.Description>(5);
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
|
@ -270,6 +275,14 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
fbreader.repaintView();
|
||||
break;
|
||||
}
|
||||
case CANCEL_CODE:
|
||||
if (resultCode >= 0 && resultCode < CancelActionsList.size()) {
|
||||
final CancelAction.Description description = CancelActionsList.get(resultCode);
|
||||
if (description.Type == CancelAction.Type.CLOSE) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue