mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Fade in box art when scrolling
This commit is contained in:
parent
265b3f9963
commit
55c800c2a5
@ -166,7 +166,7 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
@Override
|
@Override
|
||||||
public boolean populateImageView(final ImageView imgView, final AppView.AppObject obj) {
|
public boolean populateImageView(final ImageView imgView, final AppView.AppObject obj) {
|
||||||
// Clear existing contents of the image view
|
// Clear existing contents of the image view
|
||||||
imgView.setImageAlpha(0);
|
imgView.setAlpha(0.0f);
|
||||||
|
|
||||||
// Check the on-disk cache
|
// Check the on-disk cache
|
||||||
new ImageCacheRequest(imgView, obj.app.getAppId()).execute();
|
new ImageCacheRequest(imgView, obj.app.getAppId()).execute();
|
||||||
@ -222,13 +222,17 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fadeInImage(ImageView view) {
|
||||||
|
view.animate().alpha(1.0f).setDuration(250).start();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Bitmap result) {
|
protected void onPostExecute(Bitmap result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
// Disk cache was read successfully
|
// Disk cache was read successfully
|
||||||
LimeLog.info("Image disk cache hit for ("+computer.uuid+", "+appId+")");
|
LimeLog.info("Image disk cache hit for (" + computer.uuid + ", " + appId + ")");
|
||||||
view.setImageBitmap(result);
|
view.setImageBitmap(result);
|
||||||
view.setImageAlpha(255);
|
fadeInImage(view);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LimeLog.info("Image disk cache miss for ("+computer.uuid+", "+appId+")");
|
LimeLog.info("Image disk cache miss for ("+computer.uuid+", "+appId+")");
|
||||||
@ -237,7 +241,7 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
|
|
||||||
// Load the placeholder image
|
// Load the placeholder image
|
||||||
view.setImageResource(defaultImageRes);
|
view.setImageResource(defaultImageRes);
|
||||||
view.setImageAlpha(255);
|
fadeInImage(view);
|
||||||
|
|
||||||
// Set SSL contexts correctly to allow us to authenticate
|
// Set SSL contexts correctly to allow us to authenticate
|
||||||
Ion.getDefault(context).getHttpClient().getSSLSocketMiddleware().setTrustManagers(trustAllCerts);
|
Ion.getDefault(context).getHttpClient().getSSLSocketMiddleware().setTrustManagers(trustAllCerts);
|
||||||
@ -260,7 +264,7 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
if (result != null) {
|
if (result != null) {
|
||||||
// Make the view visible now
|
// Make the view visible now
|
||||||
view.setImageBitmap(result);
|
view.setImageBitmap(result);
|
||||||
view.setImageAlpha(255);
|
fadeInImage(view);
|
||||||
|
|
||||||
// Populate the disk cache if we got an image back.
|
// Populate the disk cache if we got an image back.
|
||||||
// We do it in a new thread because it can be very expensive, especially
|
// We do it in a new thread because it can be very expensive, especially
|
||||||
|
Loading…
x
Reference in New Issue
Block a user