mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-06 12:00:17 +02:00
Merge branch 'master' into ice-cream-sandwich
This commit is contained in:
commit
8275c1e407
34 changed files with 87 additions and 2 deletions
|
@ -173,6 +173,7 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
int UploadAgain = 2;
|
||||
int TryAgain = 3;
|
||||
int DeleteAll = 4;
|
||||
int ExternalView = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -281,6 +282,8 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
// Options menu
|
||||
//
|
||||
|
||||
private Boolean myIsExternalViewSupported = null;
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
|
@ -289,6 +292,15 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
addMenuItem(menu, OptionsItemId.UploadAgain, "uploadAgain", -1);
|
||||
addMenuItem(menu, OptionsItemId.TryAgain, "tryAgain", -1);
|
||||
addMenuItem(menu, OptionsItemId.DeleteAll, "deleteAll", -1);
|
||||
|
||||
if (myIsExternalViewSupported == null) {
|
||||
final Intent externalIntent = new Intent(FBReaderIntents.Action.EXTERNAL_LIBRARY);
|
||||
myIsExternalViewSupported = PackageUtil.canBeStarted(this, externalIntent, true);
|
||||
}
|
||||
if (myIsExternalViewSupported) {
|
||||
addMenuItem(menu, OptionsItemId.ExternalView, "materialView", -1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -364,6 +376,17 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
}
|
||||
tryToDeleteBooks(books);
|
||||
}
|
||||
case OptionsItemId.ExternalView:
|
||||
{
|
||||
final Intent externalIntent = new Intent(FBReaderIntents.Action.EXTERNAL_LIBRARY);
|
||||
try {
|
||||
startActivity(externalIntent);
|
||||
finish();
|
||||
} catch (ActivityNotFoundException e) {
|
||||
// ignore
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue