Coder Social home page Coder Social logo

Problem with xml images about square.picasso HOT 3 CLOSED

CDrosos avatar CDrosos commented on June 28, 2024
Problem with xml images

from square.picasso.

Comments (3)

dehghani-mehdi avatar dehghani-mehdi commented on June 28, 2024

What do you mean by "xml images"? Could you please show your code?

from square.picasso.

CDrosos avatar CDrosos commented on June 28, 2024

This is my spinner

class SpinnerTemplateCustomAdapter : BaseAdapter
    {
        private Context Context;
        private List<Template> ButtonImagesTemplates; //List<ButtonImagesTemplate> ButtonImagesTemplates;
        private LayoutInflater inflater;
        private int i = 1;

        public SpinnerTemplateCustomAdapter(Context context, List<Template> ButtonImagesTemplates)//List<ButtonImagesTemplate> ButtonImagesTemplates)
        {
            this.Context = context;
            this.ButtonImagesTemplates = ButtonImagesTemplates;
        }

        public override Object GetItem(int position)
        {
            return null;
        }

        public override long GetItemId(int position)
        {
            return position;
        }

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (inflater == null)
            {
                inflater = (LayoutInflater)Context.GetSystemService(Context.LayoutInflaterService);
            }

            if (convertView == null)
            {
                convertView = inflater.Inflate(Resource.Layout.SpinnerTemplateModel, parent, false);
            }

            TextView nameTxt = convertView.FindViewById<TextView>(Resource.Id.TemplateNameTextView);
            ImageView img1 = convertView.FindViewById<ImageView>(Resource.Id.TemplateImageView1);
            ImageView img2 = convertView.FindViewById<ImageView>(Resource.Id.TemplateImageView2);
            ImageView img3 = convertView.FindViewById<ImageView>(Resource.Id.TemplateImageView3);
            ImageView img4 = convertView.FindViewById<ImageView>(Resource.Id.TemplateImageView4);
            ImageView img5 = convertView.FindViewById<ImageView>(Resource.Id.TemplateImageView5);

            Picasso.With(Context).Load(ButtonImagesTemplates[position].TemplateImages[0].Image).Into(img1);
            Picasso.With(Context).Load(ButtonImagesTemplates[position].TemplateImages[1].Image).Into(img2);
            Picasso.With(Context).Load(ButtonImagesTemplates[position].TemplateImages[2].Image).Into(img3);
            Picasso.With(Context).Load(ButtonImagesTemplates[position].TemplateImages[3].Image).Into(img4);
            Picasso.With(Context).Load(ButtonImagesTemplates[position].TemplateImages[4].Image).Into(img5);


            return convertView;
        }

        public override int Count
        {
            get { return ButtonImagesTemplates.Count; }
        }
    }

TemplateImages[i].Image is a ResourceID

XML is a simple usual vector image like this one:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="178.58dp"
    android:height="178.58dp"
    android:viewportWidth="178.58"
    android:viewportHeight="178.58">
  <path
      android:pathData="M89.67,89.48m-86.39,0a86.39,86.39 0,1 1,172.78 0a86.39,86.39 0,1 1,-172.78 0"
      android:fillColor="#EC1E24"/>
  <path
      android:pathData="M89.67,177.38c-48.47,0 -87.89,-39.43 -87.89,-87.9S41.21,1.59 89.67,1.59s87.9,39.43 87.9,87.89S138.14,177.38 89.67,177.38zM89.67,4.59c-46.81,0 -84.89,38.08 -84.89,84.89s38.08,84.9 84.89,84.9s84.9,-38.08 84.9,-84.9S136.48,4.59 89.67,4.59z"
      android:fillColor="#90191C"/>
  <path
      android:pathData="M58.08,62.53m-8.84,0a8.84,8.84 0,1 1,17.68 0a8.84,8.84 0,1 1,-17.68 0"
      android:fillColor="#90191C"/>
  <path
      android:pathData="M120.98,62.53m-8.84,0a8.84,8.84 0,1 1,17.68 0a8.84,8.84 0,1 1,-17.68 0"
      android:fillColor="#90191C"/>
  <path
      android:pathData="M40.73,121.96c0.31,0 0.62,-0.12 0.83,-0.32c13.8,-12.93 28.46,-20.79 48.11,-20.79s34.31,7.86 48.11,20.79c0.22,0.2 0.52,0.32 0.83,0.32h6.46c0.99,0 1.54,-1.05 0.89,-1.73c-15.1,-15.84 -33.62,-25.59 -56.3,-25.59c-22.69,0 -41.21,9.75 -56.3,25.59c-0.65,0.68 -0.1,1.73 0.89,1.73H40.73z"
      android:fillColor="#90191C"/>
  <path
      android:pathData="M59.08,61.53m-7.56,0a7.56,7.56 0,1 1,15.12 0a7.56,7.56 0,1 1,-15.12 0"
      android:fillColor="#50120E"/>
  <path
      android:pathData="M119.98,61.53m-7.64,0a7.64,7.64 0,1 1,15.28 0a7.64,7.64 0,1 1,-15.28 0"
      android:fillColor="#50120E"/>
  <path
      android:pathData="M37.34,121.96c0.31,0 0.61,-0.12 0.83,-0.32c13.86,-12.97 31.85,-22.83 51.5,-22.83s37.65,9.86 51.5,22.83c0.22,0.2 0.52,0.32 0.83,0.32h3.07c0.99,0 1.54,-1.06 0.89,-1.74c-15.1,-15.91 -33.62,-26.6 -56.3,-26.6c-22.68,0 -41.21,10.7 -56.3,26.6c-0.65,0.68 -0.1,1.74 0.89,1.74H37.34z"
      android:fillColor="#50120E"/>
  <path
      android:pathData="M74.62,49.31c-5,-5.77 -10.99,-9.16 -17.79,-10.06h0c-5.08,-0.68 -10.12,0.11 -14.97,2.34l-0.93,0.43c-0.57,0.26 -0.8,0.97 -0.48,1.51l0.51,0.88c0.29,0.5 0.57,1.01 0.83,1.53l0.39,0.77c0.26,0.5 0.86,0.72 1.37,0.5l0.79,-0.34c4.02,-1.71 7.95,-2.32 11.7,-1.82c6.44,0.86 11.37,4.87 14.37,8.09l0.65,0.7c0.41,0.44 1.11,0.46 1.54,0.03l0.68,-0.67c0.37,-0.37 0.76,-0.73 1.15,-1.09l0.67,-0.61c0.43,-0.39 0.47,-1.06 0.09,-1.5L74.62,49.31z"
      android:fillColor="#4E1513"/>
  <path
      android:pathData="M104.17,49.31c5,-5.77 10.99,-9.16 17.79,-10.06h0c5.08,-0.68 10.12,0.11 14.97,2.34l0.93,0.43c0.57,0.26 0.8,0.97 0.48,1.51l-0.51,0.88c-0.29,0.5 -0.57,1.01 -0.83,1.53l-0.39,0.77c-0.26,0.5 -0.86,0.72 -1.37,0.5l-0.79,-0.34c-4.02,-1.71 -7.95,-2.32 -11.7,-1.82c-6.44,0.86 -11.37,4.87 -14.37,8.09l-0.65,0.7c-0.41,0.44 -1.11,0.46 -1.54,0.03l-0.68,-0.67c-0.37,-0.37 -0.76,-0.73 -1.15,-1.09l-0.67,-0.61c-0.43,-0.39 -0.47,-1.06 -0.09,-1.5L104.17,49.31z"
      android:fillColor="#4E1513"/>
</vector>

i'm not getting the image.
ImageView axml code:

<ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="centerInside"
        android:layout_weight="2"
        android:padding="10dp"
        android:layout_gravity="left"
        android:gravity="left"
        android:id="@+id/TemplateImageView1" />

And in my output window in visual studio when debugging im getting similar messages to this:

03-09 11:57:56.584 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.585 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.586 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.587 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.587 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.588 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.588 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.623 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.625 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.632 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.632 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.637 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.638 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.642 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
03-09 11:57:56.644 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.646 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.646 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.647 I/chatty  ( 3826): uid=10109(com.cdrosos.simplecustomerfeedback) Picasso-7f07010 identical 1 line
03-09 11:57:56.650 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.651 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.651 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.656 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.657 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.657 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.663 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.665 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
03-09 11:57:56.674 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.675 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.675 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.676 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.676 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.676 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.678 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
03-09 11:57:56.680 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.681 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.682 I/chatty  ( 3826): uid=10109(com.cdrosos.simplecustomerfeedback) Picasso-Idle identical 2 lines
03-09 11:57:56.682 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.684 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.686 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.687 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.695 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
03-09 11:57:56.697 D/skia    ( 3826): --- SkAndroidCodec::NewFromStream returned null
03-09 11:57:56.706 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
03-09 11:57:56.910 I/chatty  ( 3826): uid=10109(com.cdrosos.simplecustomerfeedback) RenderThread identical 21 lines
03-09 11:57:58.240 D/EGL_emulation( 3826): eglMakeCurrent: 0x9dc055a0: ver 3 0 (tinfo 0x8469a410)
Thread finished: <Thread Pool> #7

from square.picasso.

dehghani-mehdi avatar dehghani-mehdi commented on June 28, 2024

Seems like Picasso doesn't support loading vector, there is open issue about it: Support for VectorDrawables (API 21)?.

Rightek.Square.Picasso is just a binding for Picasso, it doesn't add or remove any option to/from Picasso. if there is a way to load vector using Picasso (Java version) and the same solution doesn't work with Rightek.Square.Picasso, please let me know.

from square.picasso.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.