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

RunActivityAction has gone

This commit is contained in:
Nikolay Pultsin 2013-01-11 06:23:42 +04:00
parent c328252aaa
commit a72943e2dd
3 changed files with 25 additions and 44 deletions

View file

@ -1,40 +0,0 @@
/*
* Copyright (C) 2007-2013 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 android.content.Intent;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
abstract class RunActivityAction extends FBAndroidAction {
private final Class<?> myActivityClass;
RunActivityAction(FBReader baseActivity, FBReaderApp fbreader, Class<?> activityClass) {
super(baseActivity, fbreader);
myActivityClass = activityClass;
}
@Override
protected void run(Object ... params) {
OrientationUtil.startActivity(
BaseActivity, new Intent(BaseActivity.getApplicationContext(), myActivityClass)
);
}
}

View file

@ -19,12 +19,24 @@
package org.geometerplus.android.fbreader;
import android.content.Intent;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
import org.geometerplus.android.fbreader.network.NetworkLibraryPrimaryActivity;
class ShowNetworkLibraryAction extends RunActivityAction {
class ShowNetworkLibraryAction extends FBAndroidAction {
ShowNetworkLibraryAction(FBReader baseActivity, FBReaderApp fbreader) {
super(baseActivity, fbreader, NetworkLibraryPrimaryActivity.class);
super(baseActivity, fbreader);
}
@Override
protected void run(Object ... params) {
OrientationUtil.startActivity(
BaseActivity, new Intent(
BaseActivity.getApplicationContext(),
NetworkLibraryPrimaryActivity.class
)
);
}
}

View file

@ -19,14 +19,23 @@
package org.geometerplus.android.fbreader;
import android.content.Intent;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
class ShowTOCAction extends RunActivityAction {
class ShowTOCAction extends FBAndroidAction {
ShowTOCAction(FBReader baseActivity, FBReaderApp fbreader) {
super(baseActivity, fbreader, TOCActivity.class);
super(baseActivity, fbreader);
}
public boolean isVisible() {
return Reader.Model != null && Reader.Model.TOCTree.hasChildren();
}
@Override
protected void run(Object ... params) {
OrientationUtil.startActivity(
BaseActivity, new Intent(BaseActivity.getApplicationContext(), TOCActivity.class)
);
}
}