protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
           
            SetContentView(Resource.Layout.activity_detail);

            friends = Util.GenerateFriends();
            imageLoader = ImageLoader.Instance;

            var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            if (monkey == null)
            { 
                var t = Intent.GetStringExtra("Name");
                monkey = friends.First(m => m.Name == t);
            }

            ShowMonkey();


            client = new GoogleApiClient.Builder(this).AddApi(AppIndex.API).Build();
            url = $"http://monkeysapp.com/Home/Detail/{monkey.Name.Replace(" ", "%20")}";
            title = monkey.Name;
            description = monkey.Details;
            schemaType = "http://schema.org/Article";
        }
Ejemplo n.º 2
0
		public override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            imageLoader = ImageLoader.Instance;

            Bundle bundle = Arguments;
            postSerialized = bundle.GetString("post");
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var ignored = base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.fragment_profile, null);
            imageLoader = ImageLoader.Instance;
            view.FindViewById<TextView>(Resource.Id.profile_name).Text = "James Montemagno";
            imageLoader.DisplayImage("https://s.gravatar.com/avatar/7d1f32b86a6076963e7beab73dddf7ca?s=250", view.FindViewById<ImageView>(Resource.Id.profile_image));

            view.FindViewById<ImageView>(Resource.Id.profile_image).Click += (sender, args) =>
                {
                    CrossShare.Current.OpenBrowser("http://github.com/jamesmontemagno");
                };

            view.FindViewById<CardView>(Resource.Id.copyright).Click += (sender, args) =>
                {

                    CrossShare.Current.OpenBrowser("http://www.wikipedia.org");
                };
            view.FindViewById<CardView>(Resource.Id.copyright).LongClickable = true;

            view.FindViewById<CardView>(Resource.Id.copyright).LongClick += (sender, args) =>
            {
                Crashes.GenerateTestCrash();
            };

                view.FindViewById<TextView>(Resource.Id.website).Click += (sender, args) =>
                {
                    CrossShare.Current.OpenBrowser("http://motzcod.es");
                };

            view.FindViewById<TextView>(Resource.Id.twitter).Click += (sender, args) =>
                {
                    CrossShare.Current.OpenBrowser("http://m.twitter.com/jamesmontemagno");
                };
            return view;
        }