mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Fix UI dropped frames when loading images
This commit is contained in:
parent
4fcd8b3dfe
commit
a8bf2cd1cf
@ -253,7 +253,7 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
.asBitmap()
|
.asBitmap()
|
||||||
.setCallback(new FutureCallback<Bitmap>() {
|
.setCallback(new FutureCallback<Bitmap>() {
|
||||||
@Override
|
@Override
|
||||||
public void onCompleted(Exception e, Bitmap result) {
|
public void onCompleted(Exception e, final Bitmap result) {
|
||||||
synchronized (pendingRequests) {
|
synchronized (pendingRequests) {
|
||||||
pendingRequests.remove(view);
|
pendingRequests.remove(view);
|
||||||
}
|
}
|
||||||
@ -263,8 +263,15 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
view.setImageBitmap(result);
|
view.setImageBitmap(result);
|
||||||
view.setVisibility(View.VISIBLE);
|
view.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
// Populate the disk cache if we got an image back
|
// Populate the disk cache if we got an image back.
|
||||||
populateBitmapCache(computer.uuid, appId, result);
|
// We do it in a new thread because it can be very expensive, especially
|
||||||
|
// when we do the initial load where lots of disk I/O is happening at once.
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
populateBitmapCache(computer.uuid, appId, result);
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Leave the loading icon as is (probably should change this eventually...)
|
// Leave the loading icon as is (probably should change this eventually...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user