Hi Shai, and thank you for getting back to me, 


After a few trials, it appears that and in my case, the URLImage failed to 
refresh the Button icon the first time when using a server generated image, 
and unlike a static server url, which works as expected,


Also, please note that, the ImageURLTMP file is generated on the Cache 
folder, but not the image file!


Can you try the test case below to reproduce at your end and advice??


   
 private Component getURLImageButton() {
       com.codename1.ui.EncodedImage imagePlaceholder = com.codename1.ui.
EncodedImage.createFromImage(Image.createImage(100, 100, 0xffff0000), true);

       String fileName = "URL_Image_" + new java.util.Date().getTime();//to 
make sure its a new on the cached folder 

       //String url = 
"https://udemy-images.udemy.com/user/200_H/509368_525d_2.jpg";//this URL 
Refresh the icon as expected.

       String url = 
"http://www.sudanhouse.com/image.html?type=CategoryVO&id=1";//this URL 
doesn't refresh first time and until Refresh pressed.

       com.codename1.ui.URLImage urlImage = com.codename1.ui.URLImage.
createToStorage(imagePlaceholder, fileName, url, com.codename1.ui.URLImage.
RESIZE_SCALE_TO_FILL);

       com.codename1.ui.Button button = new com.codename1.ui.Button();

       button.setIcon( urlImage );

       button.addActionListener( new ActionListener() {

           @Override

           public void actionPerformed(ActionEvent evt) {

               button.setIcon(com.codename1.ui.URLImage.createToStorage(
imagePlaceholder, fileName, url, com.codename1.ui.URLImage.
RESIZE_SCALE_TO_FILL));

           }

       });

       button.setText("Refresh");

       button.setTextPosition(Component.BOTTOM);
       return button;

    }


On Monday, February 13, 2017 at 9:11:43 AM UTC+4, Shai Almog wrote:
>
> Everything is possible but we'll need a way to reproduce this as it is 
> working for us. If the file is downloaded but doesn't refresh it looks like 
> an issue related to the refresh animation and we mostly dealt with the 
> download process.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e192fee6-c5ac-4738-bc2f-af9d9b4d4dbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to