mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
refactoring: platform-dependent classes have been moved to the android package; FBReader -> FBReaderActivity
This commit is contained in:
parent
6ea4881643
commit
05ec6c3861
18 changed files with 96 additions and 69 deletions
56
src/org/geometerplus/android/fbreader/ShowLibraryAction.java
Normal file
56
src/org/geometerplus/android/fbreader/ShowLibraryAction.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2010 Geometer Plus <contact@geometerplus.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import org.geometerplus.fbreader.fbreader.FBAction;
|
||||
import org.geometerplus.fbreader.fbreader.FBReader;
|
||||
import org.geometerplus.fbreader.bookmodel.BookModel;
|
||||
|
||||
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
|
||||
|
||||
class ShowLibraryAction extends FBAction {
|
||||
private final FBReaderActivity myBaseActivity;
|
||||
|
||||
ShowLibraryAction(FBReaderActivity baseActivity, FBReader fbreader) {
|
||||
super(fbreader);
|
||||
myBaseActivity = baseActivity;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
final ZLAndroidDialogManager dialogManager =
|
||||
(ZLAndroidDialogManager)ZLAndroidDialogManager.Instance();
|
||||
final HashMap<String,String> data = new HashMap<String,String>();
|
||||
final BookModel model = Reader.Model;
|
||||
Runnable action = new Runnable() {
|
||||
public void run() {
|
||||
Intent intent = new Intent(myBaseActivity.getApplicationContext(), LibraryTabActivity.class);
|
||||
if (model != null && model.Book != null) {
|
||||
intent.putExtra(LibraryTabActivity.CURRENT_BOOK_PATH_KEY, model.Book.File.getPath());
|
||||
}
|
||||
myBaseActivity.startActivity(intent);
|
||||
}
|
||||
};
|
||||
dialogManager.wait("loadingBookList", action);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue