Skip to content

Commit

Permalink
Build89
Browse files Browse the repository at this point in the history
  - Added option to pause image loader
  • Loading branch information
Hamza417 committed Aug 19, 2023
1 parent a22aaf6 commit 30a7489
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
10 changes: 10 additions & 0 deletions app/src/main/assets/html/changelogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ <h2>Build89</h2>

<!-- Write change logs here -->

<h4>User Interface</h4>

<ul>
<li>Added option to pause image loader when list is scrolled to improve list performance in some
devices.
<br>
<small>Can be toggled from <b>Development Preferences</b>.</small>
</li>
</ul>

<h4>Bug Fixes</h4>

<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import android.widget.FrameLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import java.util.Objects;

import androidx.annotation.NonNull;
Expand All @@ -25,6 +27,7 @@
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import app.simple.inure.R;
import app.simple.inure.decorations.views.BottomMenuRecyclerView;
import app.simple.inure.preferences.DevelopmentPreferences;

public class FastScroller {

Expand Down Expand Up @@ -378,11 +381,13 @@ private void setDragging(boolean dragging) {
* is being dragged to allow room for smoother scrolling
* and not load unnecessary resources.
*/
// if (dragging) {
// Glide.with(mView.getContext()).pauseRequests();
// } else {
// Glide.with(mView.getContext()).resumeRequests();
// }
if (DevelopmentPreferences.INSTANCE.get(DevelopmentPreferences.pauseImageLoader)) {
if (dragging) {
Glide.with(view.getContext()).pauseRequests();
} else {
Glide.with(view.getContext()).resumeRequests();
}
}

Intent intent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ object DevelopmentPreferences {
const val alternateHomePanel = "is_old_style_home_panel_enabled"
const val paddingLessPopupMenus = "is_padding_less_popup_menus_enabled"
const val dividerOnNavigationBar = "is_divider_on_navigation_bar_enabled"
const val pauseImageLoader = "is_image_loader_paused"

val developmentPreferences: List<DevelopmentPreferencesModel> by lazy {
listOf(
Expand Down Expand Up @@ -171,6 +172,11 @@ object DevelopmentPreferences {
DevelopmentPreferencesModel("Hide Divider On Navigation Bar",
"Hide divider on navigation bar in the app (Android Version >= P 9.0).",
dividerOnNavigationBar,
DevelopmentPreferencesModel.TYPE_BOOLEAN),

DevelopmentPreferencesModel("Pause Image Loader",
"Pause image loader in the app when fast scroller is being dragged to improve list performance.",
pauseImageLoader,
DevelopmentPreferencesModel.TYPE_BOOLEAN)
).sortedBy {
it.title
Expand Down

0 comments on commit 30a7489

Please sign in to comment.