コード例 #1
0
ファイル: EdicolaItem.cs プロジェクト: mbadrez98/InPublishing
        public EdicolaItem(Activity context, bool list = false) : base(context)
        {
            _context = context;

            if (!list)
            {
                View.Inflate(Context, Resource.Layout.EdicolaGridItem, this);
            }
            else
            {
                View.Inflate(Context, Resource.Layout.EdicolaListItem, this);
            }

            _txtTitolo   = FindViewById <TextView>(Resource.Id.edicolaTxtTitolo);
            _txtDettagli = FindViewById <TextView>(Resource.Id.edicolaTxtDettagli);
            _imgCover    = FindViewById <ImageView>(Resource.Id.edicolaImgCover);
            _btnAction   = FindViewById <ImageView>(Resource.Id.btnInfo);
            _imgUpdate   = FindViewById <ImageView>(Resource.Id.edicolaImgUpdate);
            _btnUpdate   = FindViewById <ImageView>(Resource.Id.edBtnDownload);
            _progress    = FindViewById <ProgressBar>(Resource.Id.edProgress);

            _btnAction.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);
            _btnUpdate.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);
            //_progress.IndeterminateDrawable.Colorize(DataManager.Get<ISettingsManager>().Settings.ButtonColor);
        }
コード例 #2
0
        public DownloadItem(Activity context, bool list = false) : base(context)
        {
            _context = context;

            try
            {
                if (!list)
                {
                    View.Inflate(Context, Resource.Layout.DownloadGridItem, this);
                }
                else
                {
                    View.Inflate(Context, Resource.Layout.DownloadListItem, this);
                }

                _txtTitolo   = FindViewById <TextView>(Resource.Id.downloadTxtTitolo);
                _txtDettagli = FindViewById <TextView>(Resource.Id.downloadTxtDettagli);
                _imgCover    = FindViewById <ImageView>(Resource.Id.downloadImgCover);
                _btnDownload = FindViewById <ImageView>(Resource.Id.btnDownload);
                _btnOpen     = FindViewById <ImageView>(Resource.Id.btnOpen);
                _btnStop     = FindViewById <ImageView>(Resource.Id.btnStop);
                _prgDownload = FindViewById <ProgressBar>(Resource.Id.downloadProgress);
                _overlay     = FindViewById <RelativeLayout>(Resource.Id.downloadOverlay);
                _imgUpdate   = FindViewById <ImageView>(Resource.Id.downloadImgUpdate);

                _btnBuy = FindViewById <TextView>(Resource.Id.btnBuy);

                //colore barra avanzamento
                //_prgDownload.ProgressDrawable.Colorize(DataManager.Get<ISettingsManager>().Settings.ButtonColor);
                _btnDownload.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);
                _btnOpen.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);
                _btnStop.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor);

                GradientDrawable gd = new GradientDrawable();
                gd.SetColor(Color.Transparent.FromHex("ffffff"));
                gd.SetCornerRadius(5);
                gd.SetStroke(1, Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.ButtonColor));

                _btnBuy.Background = gd;
                _btnBuy.SetTextColor(Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.ButtonColor));

                Drawable bgDrawable = _prgDownload.ProgressDrawable;
                bgDrawable.SetColorFilter(Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.ButtonColor), PorterDuff.Mode.SrcIn);
                _prgDownload.ProgressDrawable = bgDrawable;
            }
            catch (Java.Lang.RuntimeException ex)
            {
                Log.Error(TAG, ex.Message);
            }
        }