Giter Site home page Giter Site logo

Comments (18)

pchmn avatar pchmn commented on June 10, 2024

Can you provide the code that provoque this bug ? I think that this is because the ChipView label is probably null.

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

You're right. I fixed the bug and pushed it in v1.0.3.
Telle me if it works.

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

Yes it's fixed but now the letter icon is not coming when creating chips programmatically. The place where the letter icon should come is blank.

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

I can't reproduce the bug. You're sure the label is not null when trying to create the letter icon ?

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

Yes the label is not null, because if the label would have been null then the text inside the chip shouldn't come right?

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

I am attaching the screenshot it may help you.
I am adding this chip programatically using
chip.addChip()
screenshot_20170420-233353

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

I noticed that when adding chips using java, there is a NonNull Annotation in avatarIcon. My icon uri is null but I need the letter icon. So the error might be in the function addChip which is not accepting null avatarUri

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

Yeah ok I will investigate this. Maybe I would be able to fix this only tomorrow, I'm sorry.

Thanks for your return and I'll tell you when this will be fixed

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

Ya no problem, I am also experimenting on your sample project and if I get something il post it here.

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

Modify these lines in your sample project which will help you recreate the bug.

ChipExampleActivity.java

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chip_examples);
        // butter knife
        ButterKnife.bind(this);
        LinearLayout linearLayout=(LinearLayout)findViewById(R.id.abc);

        ChipView chip=new ChipView(this);
        chip.setLabel("Pritesh");
        chip.setPadding(2,2,2,2);
        chip.setHasAvatarIcon(true);
        linearLayout.addView(chip);

        // chip 1
        mChip1.setOnChipClicked(view -> {
            Toast.makeText(ChipExamplesActivity.this, mChip1.getLabel() + ": clicked", Toast.LENGTH_SHORT).show();
        });

activity_chip_Example.xml

`

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="16dp">

    <!-- first line -->
    <LinearLayout
        android:id="@+id/abc"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

    </LinearLayout>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.pchmn.materialchips.ChipView
            android:id="@+id/chip2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="16dp"
            app:label="Chip 1"
            app:hasAvatarIcon="false"
            app:deletable="false"/>

`

Just compare whith your code and make the changes to see the bug.

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

So I tested as you taught me, but it works, I don't have your bug. A screenshot :

image

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

I added the chip with java :

        ChipView chipView1 = new ChipView(this);
        chipView1.setLabel("Pritesh");
        chipView1.setPadding(2,2,2,2);
        chipView1 .setHasAvatarIcon(true);

        mLayout.addView(chipView1);

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

The problem is still there ?

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

The problem was still there. I am trying to debug the code and find the problem and notifying you soon.

from materialchipsinput.

duke1712 avatar duke1712 commented on June 10, 2024

Okay bro thanx the latest version has solved. Thanks alot

from materialchipsinput.

Related Issues (20)

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.