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

single NetworkLibraryActivity instance is now used

This commit is contained in:
Nikolay Pultsin 2011-08-15 02:13:52 +01:00
parent 364e191be1
commit 469525664d
9 changed files with 50 additions and 36 deletions

View file

@ -71,14 +71,12 @@ public abstract class BaseActivity extends ListActivity {
protected abstract FBTree getTreeByKey(FBTree.Key key);
public abstract boolean isTreeSelected(FBTree tree);
protected boolean OLD_STYLE_FLAG = false;
protected boolean isTreeInvisible(FBTree tree) {
return false;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (OLD_STYLE_FLAG) {
return super.onKeyDown(keyCode, event);
}
if (keyCode == KeyEvent.KEYCODE_BACK) {
FBTree parent = null;
while (parent == null && !myHistory.isEmpty()) {
@ -87,7 +85,7 @@ public abstract class BaseActivity extends ListActivity {
if (parent == null) {
parent = myCurrentTree.Parent;
}
if (parent != null) {
if (parent != null && !isTreeInvisible(parent)) {
openTree(parent, myCurrentTree, false);
return true;
}
@ -96,7 +94,8 @@ public abstract class BaseActivity extends ListActivity {
return super.onKeyDown(keyCode, event);
}
protected void openTree(final FBTree tree) {
// TODO: change to protected
public void openTree(final FBTree tree) {
openTree(tree, null, true);
}
@ -157,7 +156,7 @@ public abstract class BaseActivity extends ListActivity {
if (storeInHistory && !myCurrentKey.equals(tree.getUniqueKey())) {
myHistory.add(myCurrentKey);
}
startActivity(new Intent(this, getClass())
onNewIntent(new Intent(this, getClass())
.setAction(OPEN_TREE_ACTION)
.putExtra(TREE_KEY_KEY, tree.getUniqueKey())
.putExtra(