Skip to content

Commit f0b8cc4

Browse files
committed
ReaderView: Extract isPageMode to class field
1 parent fa91b5d commit f0b8cc4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

android/src/org/coolreader/crengine/ReaderView.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ public void copyToClipboard( String text ) {
648648
// private int selectionEndY = 0;
649649
private boolean doubleTapSelectionEnabled = false;
650650
private boolean gesturePageFlippingEnabled = true;
651+
private boolean mIsPageMode;
651652
private int secondaryTapActionType = TAP_ACTION_TYPE_LONGPRESS;
652653
private boolean selectionModeActive = false;
653654

@@ -1241,8 +1242,7 @@ public boolean onTouchEvent(MotionEvent event) {
12411242
return true;
12421243
}
12431244
}
1244-
boolean isPageMode = mSettings.getInt(PROP_PAGE_VIEW_MODE, 1) == 1;
1245-
int dir = isPageMode ? x - start_x : y - start_y;
1245+
int dir = mIsPageMode ? x - start_x : y - start_y;
12461246
if (gesturePageFlippingEnabled) {
12471247
if (pageFlipAnimationSpeedMs == 0 || DeviceInfo.EINK_SCREEN) {
12481248
// no animation
@@ -2626,6 +2626,8 @@ public void applyAppSetting( String key, String value )
26262626
doubleTapSelectionEnabled = flg;
26272627
} else if ( key.equals(PROP_APP_GESTURE_PAGE_FLIPPING) ) {
26282628
gesturePageFlippingEnabled = flg;
2629+
} else if ( key.equals(PROP_PAGE_VIEW_MODE)) {
2630+
mIsPageMode = flg;
26292631
} else if ( key.equals(PROP_APP_SECONDARY_TAP_ACTION_TYPE) ) {
26302632
secondaryTapActionType = flg ? TAP_ACTION_TYPE_DOUBLE : TAP_ACTION_TYPE_LONGPRESS;
26312633
} else if ( key.equals(PROP_APP_FLICK_BACKLIGHT_CONTROL) ) {
@@ -2697,6 +2699,7 @@ public void setAppSettings(Properties newSettings, Properties oldSettings)
26972699
viewMode = flg ? ViewMode.PAGES : ViewMode.SCROLL;
26982700
} else if ( PROP_APP_SCREEN_ORIENTATION.equals(key)
26992701
|| PROP_PAGE_ANIMATION.equals(key)
2702+
|| PROP_PAGE_VIEW_MODE.equals(key)
27002703
|| PROP_CONTROLS_ENABLE_VOLUME_KEYS.equals(key)
27012704
|| PROP_APP_SHOW_COVERPAGES.equals(key)
27022705
|| PROP_APP_COVERPAGE_SIZE.equals(key)

0 commit comments

Comments
 (0)