public void OnLoadSticker(View view, Sticker sticker)
 {
     try
     {
         var data = (string)sticker.Data;
         if (data != null)
         {
             Glide.With(view).Load(data).Apply(RequestOptions.FitCenterTransform()).Into((ImageView)view);
         }
         else
         {
             Glide.With(view).Load(sticker.Data).Apply(RequestOptions.FitCenterTransform()).Into((ImageView)view);
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Exemple #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            NestedScrollView nestedScrollView = (NestedScrollView)inflater.Inflate(Resource.Layout.fragment_cards, container, false);

            btn_card_main1_action1  = nestedScrollView.FindViewById <Button>(Resource.Id.btn_card_main1_action1);
            btn_card_main1_action2  = nestedScrollView.FindViewById <Button>(Resource.Id.btn_card_main1_action2);
            img_main_card2_share    = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_share);
            img_main_card2_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_bookmark);
            img_main_card2_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_favorite);
            ll_card_main3_rate      = nestedScrollView.FindViewById <LinearLayout>(Resource.Id.ll_card_main3_rate);

            img_main_card_1  = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_1);
            img_main_card_2  = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_2);
            img_card_main_3  = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_card_main_3);
            img_main_card_41 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_41);
            img_main_card_42 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_42);

            img_main_card41_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_favorite);
            img_main_card42_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_favorite);
            img_main_card41_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_bookmark);
            img_main_card42_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_bookmark);
            img_main_card41_share    = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_share);
            img_main_card42_share    = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_share);

            card_main_1_1   = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_1);
            card_main_1_2   = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_2);
            card_main_1_3   = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_3);
            card_main_1_4_1 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_4_1);
            card_main_1_4_2 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_4_2);

            Glide.With(this).Load(Resource.Drawable.material_design_2).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_1);
            Glide.With(this).Load(Resource.Drawable.material_design_4).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_2);
            Glide.With(this).Load(Resource.Drawable.material_design_11).Apply(RequestOptions.FitCenterTransform()).Into(img_card_main_3);
            Glide.With(this).Load(Resource.Drawable.material_design_1).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_41);
            Glide.With(this).Load(Resource.Drawable.material_design_1).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_42);

            //ad_view = nestedScrollView.FindViewById(Resource.Id.ad_view);
            card_ad = nestedScrollView.FindViewById <CardView>(Resource.Id.card_ad);

            return(nestedScrollView);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_scrolling);

            Window.AddFlags(WindowManagerFlags.TranslucentNavigation);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            if (SupportActionBar != null)
            {
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                toolbar.NavigationClick += (sender, args) => { OnBackPressed(); };
            }

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab_scrolling);

            fab.SetOnClickListener(this);

            ImageView image_scrolling_top = FindViewById <ImageView>(Resource.Id.image_scrolling_top);

            Glide.With(this).Load(Resource.Drawable.material_design_3).Apply(RequestOptions.FitCenterTransform()).Into(image_scrolling_top);
        }
            public void OnLoadStickerCategory(View icon, IStickerCategory stickerCategory, bool selected)
            {
                try
                {
                    var image = (ImageView)icon;
                    if (image != null)
                    {
                        if (stickerCategory is ShopStickers shopStickers)
                        {
                            Drawable dr0 = AppCompatResources.GetDrawable(icon.Context, (int)shopStickers.CategoryData);
                            Drawable dr  = dr0.GetConstantState()?.NewDrawable();
                            if (selected)
                            {
                                DrawableCompat.SetTint(DrawableCompat.Wrap(dr), AXEmojiManager.EmojiViewTheme.SelectedColor);
                            }
                            else
                            {
                                DrawableCompat.SetTint(DrawableCompat.Wrap(dr), AXEmojiManager.EmojiViewTheme.DefaultColor);
                            }

                            image?.SetImageDrawable(dr);
                        }
                        else
                        {
                            Glide.With(icon).Load(Integer.ValueOf(stickerCategory.CategoryData.ToString())).Apply(RequestOptions.FitCenterTransform()).Into(image);
                        }
                    }
                }
                catch (Exception e)
                {
                    Methods.DisplayReportResultTrack(e);
                }
            }
Exemple #5
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView;

            if (view == null)
            {
                view = this._context.LayoutInflater.Inflate(Resource.Layout.MovieListItem, null);
            }
            var movie = this._response.Results[position];

            view.FindViewById <TextView>(Resource.Id.name).Text = movie.Title;
            view.FindViewById <TextView>(Resource.Id.year).Text = movie.ReleaseDate.Year.ToString();
            //Breyta þessu í glide pælinguna með myndir
            var imgTest = view.FindViewById <ImageView>(Resource.Id.picture);

            Glide.With(_context).Load("http://image.tmdb.org/t/p/w185/" + movie.PosterPath).Apply(RequestOptions.FitCenterTransform()).Into(imgTest);
            return(view);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here

            SetContentView(Resource.Layout.MovieDetail);

            var jsonStr = this.Intent.GetStringExtra("movie");

            this._movie = JsonConvert.DeserializeObject <MovieInfo>(jsonStr);

            //TODO: Setja upp layout og fylla það af this._movie upplýsingum

            var movieTitleText    = this.FindViewById <TextView>(Resource.Id.textView1);
            var movieDateText     = this.FindViewById <TextView>(Resource.Id.textView2);
            var moviePoster       = this.FindViewById <ImageView>(Resource.Id.imageView1);
            var movieOverviewText = this.FindViewById <TextView>(Resource.Id.textView3);

            movieTitleText.Text = _movie.Title;
            this.FindViewById <TextView>(Resource.Id.textView2).Text = _movie.ReleaseDate.Year.ToString();
            Glide.With(this).Load("http://image.tmdb.org/t/p/w185/" + _movie.PosterPath).Apply(RequestOptions.FitCenterTransform()).Into(moviePoster);
            movieOverviewText.Text = _movie.Overview;
        }