disable UIL image handling while scrolling
This should speed up the scrolling, especially on older devices.
This commit is contained in:
parent
2a3aaacf23
commit
6e64438fa6
@ -18,6 +18,7 @@ import android.view.inputmethod.InputMethodManager;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||||
import org.fdroid.fdroid.FDroidApp;
|
import org.fdroid.fdroid.FDroidApp;
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
@ -124,6 +125,22 @@ public class AppListActivity extends AppCompatActivity implements LoaderManager.
|
|||||||
appView.setHasFixedSize(true);
|
appView.setHasFixedSize(true);
|
||||||
appView.setLayoutManager(new LinearLayoutManager(this));
|
appView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
appView.setAdapter(appAdapter);
|
appView.setAdapter(appAdapter);
|
||||||
|
appView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
|
private final ImageLoader imageLoader = ImageLoader.getInstance();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
||||||
|
switch (newState) {
|
||||||
|
case RecyclerView.SCROLL_STATE_DRAGGING:
|
||||||
|
imageLoader.pause();
|
||||||
|
break;
|
||||||
|
case RecyclerView.SCROLL_STATE_IDLE:
|
||||||
|
imageLoader.resume();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
super.onScrollStateChanged(recyclerView, newState);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
parseIntentForSearchQuery();
|
parseIntentForSearchQuery();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user