Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Name    = Intent.Extras.GetString("name");
            Address = Intent.Extras.GetString("address");

            Title = $"{Name} ({Address})";

            ScreenImageView = new ZoomableImageView(this, () => BitmapFactory.DecodeResource(Resources, Resource.Drawable.Preparing));
            SetContentView(ScreenImageView);

            Api = new ApiClient(Address);

            try
            {
                RefreshAsync();
            }
            catch (Exception e)
            {
                Log.Error(TAG, $"Failed to start activity with error {e}.");
                Toast.MakeText(this, $"Failed to connect to {Title}", ToastLength.Short).Show();
                Finish();
            }

            // Option menu setup.
            Options.AddItem("Refresh", () =>
            {
                try
                {
                    RefreshAsync();
                }
                catch (Exception e)
                {
                    Log.Error(TAG, $"Failed to refresh with error {e}.");
                    Toast.MakeText(this, $"Failed to refresh.", ToastLength.Short).Show();
                }
            });
        }
Ejemplo n.º 2
0
 public ScaleListener(ZoomableImageView view)
 {
     View = view;
 }