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
899502454c
38 changed files with 177 additions and 15 deletions
|
@ -116,11 +116,15 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
@Override
|
||||
protected void onListItemClick(ListView listView, View view, int position, long rowId) {
|
||||
final LibraryTree tree = (LibraryTree)getListAdapter().getItem(position);
|
||||
final Book book = tree.getBook();
|
||||
if (book != null) {
|
||||
showBookInfo(book);
|
||||
if (tree instanceof ExternalViewTree) {
|
||||
runOrInstallExternalView();
|
||||
} else {
|
||||
openTree(tree);
|
||||
final Book book = tree.getBook();
|
||||
if (book != null) {
|
||||
showBookInfo(book);
|
||||
} else {
|
||||
openTree(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -368,20 +372,22 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
tryToDeleteBooks(books);
|
||||
}
|
||||
case OptionsItemId.ExternalView:
|
||||
{
|
||||
try {
|
||||
startActivity(new Intent(FBReaderIntents.Action.EXTERNAL_LIBRARY));
|
||||
finish();
|
||||
} catch (ActivityNotFoundException e) {
|
||||
PackageUtil.installFromMarket(this, "org.fbreader.plugin.library");
|
||||
}
|
||||
runOrInstallExternalView();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void runOrInstallExternalView() {
|
||||
try {
|
||||
startActivity(new Intent(FBReaderIntents.Action.EXTERNAL_LIBRARY));
|
||||
finish();
|
||||
} catch (ActivityNotFoundException e) {
|
||||
PackageUtil.installFromMarket(this, "org.fbreader.plugin.library");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Book deletion
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue