Example #1
0
        public void OnIsWallpaperSupportedAndAllowed()
        {
            var isSupported = AGWallpaperManager.IsWallpaperSupported();
            var isAllowed   = AGWallpaperManager.IsSetWallpaperAllowed();

            AGUIMisc.ShowToast(string.Format("Wallpaper supported? - {0}, set allowed? - {1}", isSupported, isAllowed));
        }
        public void OnSetWallpaperFromFilePath()
        {
            AGGallery.PickImageFromGallery(
                selectedImage =>
            {
                var imageTexture2D = selectedImage.LoadTexture2D();

                string msg = string.Format("{0} was loaded from gallery with size {1}x{2}",
                                           selectedImage.OriginalPath, imageTexture2D.width, imageTexture2D.height);
                AGUIMisc.ShowToast(msg);
                Debug.Log(msg);
                AGWallpaperManager.SetWallpaper(selectedImage.OriginalPath);

                // Clean up
                Resources.UnloadUnusedAssets();
            },
                errorMessage => AGUIMisc.ShowToast("Cancelled picking image from gallery: " + errorMessage));
        }
Example #3
0
 public void OnCropAndSetWallpaperFromTexture()
 {
     AGWallpaperManager.ShowCropAndSetWallpaperChooser(wallpaperTexture);
 }
Example #4
0
 public void OnResetWallpaperToDefault()
 {
     AGWallpaperManager.Clear();
     AGUIMisc.ShowToast("Wallpaper was reset to default");
 }
Example #5
0
 public void OnShowLiveWallpaperChooser()
 {
     AGWallpaperManager.ShowLiveWallpaperChooser();
 }
Example #6
0
        public void OnSetLockScreenWallpaperFromTexture()
        {
            var rect = new AndroidRect(0, 0, 400, 400);

            AGWallpaperManager.SetWallpaper(wallpaperTexture, rect, true, AGWallpaperManager.WallpaperType.Lock);
        }
Example #7
0
 public void OnSetWallpaperFromTexture()
 {
     AGWallpaperManager.SetWallpaper(wallpaperTexture, null, true, AGWallpaperManager.WallpaperType.System);
 }
 public void OnSetWallpaperFromTexture()
 {
     AGWallpaperManager.SetWallpaper(wallpaperTexture);
 }