From 1bd7a582909bddcb8d5845749f3005b744a98f46 Mon Sep 17 00:00:00 2001 From: almedina-ms <35784165+almedina-ms@users.noreply.github.com> Date: Mon, 30 Mar 2020 11:14:43 -0700 Subject: [PATCH] Fix first element changing place with background image (#3393) (#3891) Co-authored-by: shalinijoshi19 --- .../io/adaptivecards/renderer/BackgroundImageLoaderAsync.java | 1 - .../io/adaptivecards/renderer/GenericImageLoaderAsync.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/BackgroundImageLoaderAsync.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/BackgroundImageLoaderAsync.java index 879646b58b..94a0cc84f2 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/BackgroundImageLoaderAsync.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/BackgroundImageLoaderAsync.java @@ -46,7 +46,6 @@ void onSuccessfulPostExecute(Bitmap bitmap) { BitmapDrawable background = new BackgroundImageDrawable(m_context.getResources(), bitmap, m_backgroundImageProperties); m_layout.setBackground(background); - m_layout.bringChildToFront(m_layout.getChildAt(0)); } private class BackgroundImageDrawable extends BitmapDrawable diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/GenericImageLoaderAsync.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/GenericImageLoaderAsync.java index d07b56d257..dec41eae4f 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/GenericImageLoaderAsync.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/GenericImageLoaderAsync.java @@ -77,7 +77,7 @@ HttpRequestResult loadImage(String path, Context context) String uriScheme = getUriScheme(path); IResourceResolver resourceResolver = CardRendererRegistration.getInstance().getResourceResolver(uriScheme); - if(resourceResolver != null) + if (resourceResolver != null) { if (m_maxWidth != -1) { @@ -96,7 +96,7 @@ else if (path.startsWith("content:")) //Step 2: If resource resolver doesn't exist, then try with treating it as a dataUri // Let's try to see if we got the image in the card as a base64 encoded string // The syntax of data URIs as in RFX 2397 is data:[][;base64], - if(uriScheme.equals("data")) + if (uriScheme.equals("data")) { return loadDataUriImage(path); }