Example #1
0
                void SetupDisplay(View view)
                {
                    // get the placeholder image in case we need it
                    // attempt to load the image from cache. If that doesn't work, use a placeholder
                    HeaderImage = null;

                    bool imageExists = TryLoadBanner(HeaderImageName);

                    if (imageExists == false)
                    {
                        // use the placeholder and request the image download
                        string widthParam = string.Format("&width={0}", NavbarFragment.GetContainerDisplayWidth_Landscape( ));
                        string requestUrl = Rock.Mobile.Util.Strings.Parsers.AddParamToURL(HeaderImageURL, widthParam);

                        FileCache.Instance.DownloadFileToCache(requestUrl, HeaderImageName, null,
                                                               delegate
                        {
                            TryLoadBanner(HeaderImageName);
                        });


                        AsyncLoader.LoadImage(PrivateGeneralConfig.NewsDetailsPlaceholder, true, false,
                                              delegate(Bitmap imageBmp)
                        {
                            if (IsFragmentActive == true && imageBmp != null)
                            {
                                HeaderImage = imageBmp;
                                ImageBanner.SetImageBitmap(HeaderImage);
                                ImageBanner.Invalidate( );

                                Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView(ImageBanner, true, null);

                                return(true);
                            }

                            return(false);
                        });
                    }
                }