mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
method moved from FBReader to NavigationButtonPanel
This commit is contained in:
parent
7e8eec00cf
commit
818ada3666
2 changed files with 14 additions and 12 deletions
|
@ -226,13 +226,7 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean navigate() {
|
||||
if (ourNavigatePanel.getVisibility()) {
|
||||
return false;
|
||||
}
|
||||
ourNavigatePanel.NavigateDragging = false;
|
||||
ourNavigatePanel.initPosition();
|
||||
ourNavigatePanel.show(true);
|
||||
return true;
|
||||
public void navigate() {
|
||||
ourNavigatePanel.runNavigation();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,12 +35,20 @@ import org.geometerplus.zlibrary.ui.android.R;
|
|||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||
|
||||
final class NavigationButtonPanel extends ControlButtonPanel {
|
||||
public volatile boolean NavigateDragging;
|
||||
private volatile boolean myIsInProgress;
|
||||
|
||||
NavigationButtonPanel(FBReaderApp fbReader) {
|
||||
super(fbReader);
|
||||
}
|
||||
|
||||
public void runNavigation() {
|
||||
if (!getVisibility()) {
|
||||
myIsInProgress = false;
|
||||
initPosition();
|
||||
show(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow() {
|
||||
if (myControlPanel != null) {
|
||||
|
@ -51,7 +59,7 @@ final class NavigationButtonPanel extends ControlButtonPanel {
|
|||
@Override
|
||||
public void updateStates() {
|
||||
super.updateStates();
|
||||
if (!NavigateDragging && myControlPanel != null) {
|
||||
if (!myIsInProgress && myControlPanel != null) {
|
||||
setupNavigation(myControlPanel);
|
||||
}
|
||||
}
|
||||
|
@ -77,11 +85,11 @@ final class NavigationButtonPanel extends ControlButtonPanel {
|
|||
}
|
||||
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
NavigateDragging = false;
|
||||
myIsInProgress = false;
|
||||
}
|
||||
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
NavigateDragging = true;
|
||||
myIsInProgress = true;
|
||||
}
|
||||
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue