public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            NotificationAdapterViewHolder viewHolder = holder as NotificationAdapterViewHolder;

            //Arréglame
            //Funciona en Kitkat?
            viewHolder.Icono.Background = IconFactory.ReturnIconDrawable(notificaciones[position].Notification.Icon, notificaciones[position].PackageName);
        }
Esempio n. 2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            //Cast
            NotificationAdapterViewHolder viewHolder = holder as NotificationAdapterViewHolder;

            viewHolder.Icono.Background = IconFactory.ReturnIconDrawable(notificaciones[position].Notification.Icon, notificaciones[position].PackageName);
            if (selectedItem == position)
            {
                viewHolder.Icono.Alpha = 0.5f;
            }
            else
            {
                viewHolder.Icono.Alpha = 1;
            }
        }
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     if (position != RecyclerView.NoPosition)
     {
         //Cast
         NotificationAdapterViewHolder viewHolder = holder as NotificationAdapterViewHolder;
         viewHolder.Icono.Background = IconFactory.ReturnIconDrawable(notifications[position].Notification.Icon, notifications[position].PackageName);
         if (selectedItem == position)
         {
             viewHolder.Icono.Alpha = 0.5f;
         }
         else
         {
             viewHolder.Icono.Alpha = 1;
         }
     }
     else
     {
         Log.Info("LiveDisplay", "WTF Position: " + position);
     }
 }
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     if (position != RecyclerView.NoPosition)
     {
         if (MusicController.MediaSessionAssociatedWThisNotification(notifications[position].GetCustomId()) &&
             new ConfigurationManager(AppPreferences.Default).RetrieveAValue(ConfigurationParameters.HideNotificationWhenItsMediaPlaying) &&
             Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
         {
             holder.ItemView.Visibility       = ViewStates.Gone;
             holder.ItemView.LayoutParameters = new RecyclerView.LayoutParams(0, 0);
         }
         else
         {
             //Cast
             NotificationAdapterViewHolder viewHolder = holder as NotificationAdapterViewHolder;
             if (Build.VERSION.SdkInt >= BuildVersionCodes.M)
             {
                 viewHolder.Icono.Background = IconFactory.ReturnIconDrawable(notifications[position].GetSmallIcon(), notifications[position].GetPackage());
             }
             else
             {
                 viewHolder.Icono.Background = IconFactory.ReturnIconDrawable(notifications[position].GetIconInt(), notifications[position].GetPackage());
             }
             if (selectedItem == position)
             {
                 viewHolder.Icono.Alpha = 0.5f;
             }
             else
             {
                 viewHolder.Icono.Alpha = 1;
             }
         }
     }
     else
     {
         Log.Info("LiveDisplay", "WTF Position: " + position);
     }
 }