diff --git a/app/src/main/java/com/foobnix/model/AppState.java b/app/src/main/java/com/foobnix/model/AppState.java index f4d5c530c..3d942a91d 100644 --- a/app/src/main/java/com/foobnix/model/AppState.java +++ b/app/src/main/java/com/foobnix/model/AppState.java @@ -349,6 +349,7 @@ public class AppState { public boolean isShowPanelBookNameScrollMode = true; public boolean isShowPanelBookNameBookMode = false; public boolean isShowReadingProgress = true; + public boolean isShowBottomSeekBar = true; public boolean isShowChaptersOnProgress = true; public boolean isShowSubChaptersOnProgress = true; public int antiAliasLevel = 8;//0-8 diff --git a/app/src/main/java/com/foobnix/pdf/info/view/DragingDialogs.java b/app/src/main/java/com/foobnix/pdf/info/view/DragingDialogs.java index 0f8aaa09e..0012658dd 100644 --- a/app/src/main/java/com/foobnix/pdf/info/view/DragingDialogs.java +++ b/app/src/main/java/com/foobnix/pdf/info/view/DragingDialogs.java @@ -3295,6 +3295,7 @@ public static void dialogStatusBarSettings(final FrameLayout anchor, View inflate = inflater.inflate(R.layout.dialog_status_bar_settings, null, false); final CheckBox isShowReadingProgress = inflate.findViewById(R.id.isShowReadingProgress); + final CheckBox isShowBottomSeekBar = inflate.findViewById(R.id.isShowBottomSeekBar); final CheckBox isShowChaptersOnProgress = inflate.findViewById(R.id.isShowChaptersOnProgress); final CheckBox isShowSubChaptersOnProgress = inflate.findViewById(R.id.isShowSubChaptersOnProgress); @@ -3316,6 +3317,16 @@ public static void dialogStatusBarSettings(final FrameLayout anchor, } }); + isShowBottomSeekBar.setChecked(AppState.get().isShowBottomSeekBar); + isShowBottomSeekBar.setOnCheckedChangeListener(new OnCheckedChangeListener() { + @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + AppState.get().isShowBottomSeekBar = isChecked; + if (onRefresh != null) { + onRefresh.run(); + } + } + }); + isShowChaptersOnProgress.setChecked(AppState.get().isShowChaptersOnProgress); isShowChaptersOnProgress.setEnabled(AppState.get().isShowReadingProgress); isShowChaptersOnProgress.setOnCheckedChangeListener(new OnCheckedChangeListener() { diff --git a/app/src/main/java/com/foobnix/pdf/info/wrapper/DocumentWrapperUI.java b/app/src/main/java/com/foobnix/pdf/info/wrapper/DocumentWrapperUI.java index 49c59588e..8478e7467 100644 --- a/app/src/main/java/com/foobnix/pdf/info/wrapper/DocumentWrapperUI.java +++ b/app/src/main/java/com/foobnix/pdf/info/wrapper/DocumentWrapperUI.java @@ -238,7 +238,7 @@ public boolean onMenuItemClick(MenuItem item) { batteryIcon, fullscreen, onTextReplacement; ImageView showSearch, nextScreenType, moveCenter, autoScroll, textToSpeach, onModeChange, imageMenuArrow, editTop2, goToPage1, goToPage1Top; - View titleBar, overlay, menuLayout, moveLeft, moveRight, bottomBar, onCloseBook, seekSpeedLayot, zoomPlus, + View titleBar, overlay, menuLayout, moveLeft, moveRight, bottomBar, seekLine, onCloseBook, seekSpeedLayot, zoomPlus, zoomMinus; public View.OnLongClickListener onCloseLongClick = new View.OnLongClickListener() { @@ -327,19 +327,20 @@ public void onClick(final View v) { @Override public void onStopTrackingTouch(final SeekBar seekBar) { + showHideHistory(); } @Override public void onStartTrackingTouch(final SeekBar seekBar) { + dc.getLinkHistory().add(dc.getCurentPageFirst1()); } @Override public void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) { - - dc.onGoToPage(progress + 1); - + if (fromUser) { + dc.onGoToPage(progress + 1); + } Apps.accessibilityText(a, a.getString(R.string.m_current_page) + " " + dc.getCurentPageFirst1()); - //updateUI(); } }; public View.OnClickListener onShowHideEditPanel = new View.OnClickListener() { @@ -1231,6 +1232,7 @@ public void run() { pagesCountIndicator.setVisibility(View.GONE); currentSeek = (TextView) a.findViewById(R.id.currentSeek); + seekLine = a.findViewById(R.id.seekLine); maxSeek = (TextView) a.findViewById(R.id.maxSeek); bookName = (TextView) a.findViewById(R.id.bookName); @@ -1796,6 +1798,7 @@ public void onClick(final View arg0) { }; public void show() { + showHideHistory(); menuLayout.setVisibility(View.VISIBLE); titleBar.setVisibility(View.VISIBLE); @@ -1803,6 +1806,7 @@ public void show() { updateLock(); bottomBar.setVisibility(View.VISIBLE); + seekLine.setVisibility(AppState.get().isShowBottomSeekBar ? View.VISIBLE : View.GONE); //adFrame.setVisibility(View.VISIBLE); // adFrame.setClickable(true); // adFrame.setTag(null); diff --git a/app/src/main/java/com/foobnix/pdf/search/activity/HorizontalViewActivity.java b/app/src/main/java/com/foobnix/pdf/search/activity/HorizontalViewActivity.java index 77d68b9d8..dc03b9f4c 100644 --- a/app/src/main/java/com/foobnix/pdf/search/activity/HorizontalViewActivity.java +++ b/app/src/main/java/com/foobnix/pdf/search/activity/HorizontalViewActivity.java @@ -142,6 +142,7 @@ public class HorizontalViewActivity extends AdsFragmentActivity { volatile Boolean isInitPosistion = null; volatile int isInitOrientation; ProgressDraw progressDraw; + View seekLine; LinearLayout pageshelper; String quickBookmark; ClickUtils clickUtils; @@ -407,6 +408,7 @@ public void run() { moveCenter = findViewById(R.id.moveCenter); currentSeek = (TextView) findViewById(R.id.currentSeek); + seekLine = findViewById(R.id.seekLine); maxSeek = (TextView) findViewById(R.id.maxSeek); toastBrightnessText = (TextView) findViewById(R.id.toastBrightnessText); @@ -2091,6 +2093,10 @@ public void hideShow(boolean animated) { updateBannnerTop(); showPagesHelper(); + if (seekLine != null) { + seekLine.setVisibility(AppState.get().isEditMode && AppState.get().isShowBottomSeekBar ? View.VISIBLE : View.GONE); + } + if (prev == AppState.get().isEditMode) { return; } @@ -2103,6 +2109,9 @@ public void hideShow(boolean animated) { if (!animated || AppState.get().appTheme == AppState.THEME_INK) { actionBar.setVisibility(AppState.get().isEditMode ? View.VISIBLE : View.GONE); bottomBar.setVisibility(AppState.get().isEditMode ? View.VISIBLE : View.GONE); + if (seekLine != null) { + seekLine.setVisibility(AppState.get().isEditMode && AppState.get().isShowBottomSeekBar ? View.VISIBLE : View.GONE); + } //adFrame.setVisibility(AppState.get().isEditMode ? View.VISIBLE : View.GONE); DocumentController.chooseFullScreen(this, AppState.get().fullScreenMode); @@ -2144,6 +2153,9 @@ public void onAnimationEnd(final Animation animation) { try { actionBar.setVisibility(View.VISIBLE); bottomBar.setVisibility(View.VISIBLE); + if (seekLine != null) { + seekLine.setVisibility(AppState.get().isShowBottomSeekBar ? View.VISIBLE : View.GONE); + } //adFrame.setVisibility(View.VISIBLE); ///adFrame.setTag(null); @@ -2498,10 +2510,12 @@ private void updateAnimation(final TranslateAnimation a) { @Override public void onStopTrackingTouch(final SeekBar seekBar) { + showHideHistory(); } @Override public void onStartTrackingTouch(final SeekBar seekBar) { + dc.getLinkHistory().add(dc.getCurentPageFirst1()); } @Override diff --git a/app/src/main/res/layout/dialog_status_bar_settings.xml b/app/src/main/res/layout/dialog_status_bar_settings.xml index 6e5776e19..a0a223833 100644 --- a/app/src/main/res/layout/dialog_status_bar_settings.xml +++ b/app/src/main/res/layout/dialog_status_bar_settings.xml @@ -47,6 +47,13 @@ android:layout_marginLeft="10dip" android:text="@string/show_book_title" /> + + Status Bar Show status bar Enable progress bar + Show progress slider Navigate by sliding across status bar Font size Progress bar height