mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +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() {
|
public void navigate() {
|
||||||
if (ourNavigatePanel.getVisibility()) {
|
ourNavigatePanel.runNavigation();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ourNavigatePanel.NavigateDragging = false;
|
|
||||||
ourNavigatePanel.initPosition();
|
|
||||||
ourNavigatePanel.show(true);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,12 +35,20 @@ import org.geometerplus.zlibrary.ui.android.R;
|
||||||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||||
|
|
||||||
final class NavigationButtonPanel extends ControlButtonPanel {
|
final class NavigationButtonPanel extends ControlButtonPanel {
|
||||||
public volatile boolean NavigateDragging;
|
private volatile boolean myIsInProgress;
|
||||||
|
|
||||||
NavigationButtonPanel(FBReaderApp fbReader) {
|
NavigationButtonPanel(FBReaderApp fbReader) {
|
||||||
super(fbReader);
|
super(fbReader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void runNavigation() {
|
||||||
|
if (!getVisibility()) {
|
||||||
|
myIsInProgress = false;
|
||||||
|
initPosition();
|
||||||
|
show(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
if (myControlPanel != null) {
|
if (myControlPanel != null) {
|
||||||
|
@ -51,7 +59,7 @@ final class NavigationButtonPanel extends ControlButtonPanel {
|
||||||
@Override
|
@Override
|
||||||
public void updateStates() {
|
public void updateStates() {
|
||||||
super.updateStates();
|
super.updateStates();
|
||||||
if (!NavigateDragging && myControlPanel != null) {
|
if (!myIsInProgress && myControlPanel != null) {
|
||||||
setupNavigation(myControlPanel);
|
setupNavigation(myControlPanel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,11 +85,11 @@ final class NavigationButtonPanel extends ControlButtonPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
NavigateDragging = false;
|
myIsInProgress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
NavigateDragging = true;
|
myIsInProgress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue