Giter Site home page Giter Site logo

Comments (21)

jahanvi-droid avatar jahanvi-droid commented on June 10, 2024 5

ChipInput inside scrollview/nested scrollview doesn't working. If anyone has solution. Please share it.

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024 2

I don't understand very well what's not working.

When you use maxRows like this, it is not working ?

<com.pchmn.materialchips.ChipsInput
        android:id="@+id/chips_input"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:hint="Enter a name"
        app:maxRows="3" />

Because if you look at the sample app, the maxRows attribute is successfully used.

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024 1

The bug occurred just by using the ChipsInput view in a ScrollView in your xml layout ?

Can you provide the code that is responsible of the bug ? To reproduce it.

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024 1

yes it only occurs when we are in Scrollview i changed my layout now its ok. but back button on key board don't remove last chip please help me.

from materialchipsinput.

MoeHamoud avatar MoeHamoud commented on June 10, 2024 1

@chnouman its in the docs

chipsInput.addChip(ChipInterface chip);
// or
chipsInput.addChip(Object id, Drawable icon, String label, String info);
// or
chipsInput.addChip(Drawable icon, String label, String info);
// or
chipsInput.addChip(Object id, Uri iconUri, String label, String info);
// or
chipsInput.addChip(Uri iconUri, String label, String info);
// or
chipsInput.addChip(String label, String info);

from materialchipsinput.

MoeHamoud avatar MoeHamoud commented on June 10, 2024

wrap it in a scrollview?

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

sorry actually i was in scrollview in scrollview maxRows property was not working.

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

yes @MoeHamoud it was in scrollview.

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

@MoeHamoud @pchmn still back button is not working when i try to remove last chip from chips.

from materialchipsinput.

pchmn avatar pchmn commented on June 10, 2024

I will test it and try to reproduce the bug.
I will return to you when I found a fix

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

ok

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

Hy can you please tell me how to add chip automatically or programmatcaly without selecting from drop down list.

from materialchipsinput.

MoeHamoud avatar MoeHamoud commented on June 10, 2024

@chnouman I'm not sure you even need this library for such functionality.

I've done this before and if what you want is what I think it is then this is how I would go about it.

  • Create a layout file (call it, textview_chip.xml, for example) with a FrameLayout as the root element and a TextView inside it
  • Style the TextView or even the FrameLayout so it looks like a chip. I'm not going to go into detail about this but there are resources out there to help you by using an xml drawable and setting it as the background of the TextView or FrameLayout
  • You could then create a customView group (call it, CustomChipView for example) that extends FrameLayout and inflate the textview_chip.xml
  • From there, you can write public functions inside the CustomChipView, for instance, setChipText(), setChipAvatar(), etc. Depending on what data you want to present to the user
  • You could then instantiate your CustomChipView and use, for example, linearLayout.addView(CustomChipView) to add it to your layout programmatically. You could then set an onClick listener on the CustomChipView which would remove it from the linearLayout.

This is one way that I've "faked" chips.

You can also use the same approach inside a recyclerView. You wouldn't need to create a customView group to inflate the textview_chip.xml layout but you would just inflate it inside the recyclerView's adapter.

Just another option for you, maybe someone else can help you in terms of using this library to achieve the functionality you're after.

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

hy sorry i was unable to clearly explain my problem actually the problem is in my scenario the user go to contacts activity and mark some contacts and say ok and come back to parent activity now on parent activity i want to put all those selected contacts in chips.

from materialchipsinput.

MoeHamoud avatar MoeHamoud commented on June 10, 2024

Well you need to store the selected contacts in a list and then pass it back to the parent activity. From there, loop through your list of contacts and add them as chips to your view.

See: https://stackoverflow.com/questions/11340776/passing-a-list-from-one-activity-to-another

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

@MoeHamoud let me know how to add chips to my view thank you.

from materialchipsinput.

chnouman avatar chnouman commented on June 10, 2024

Thank you dear

from materialchipsinput.

dkgupta2501 avatar dkgupta2501 commented on June 10, 2024

inside scrollview, i am using chipInput ,its working perfectly but when i scroll the layout from from top, its not scrolling, what should i do for that.

from materialchipsinput.

dkgupta2501 avatar dkgupta2501 commented on June 10, 2024

can anyone fixed my problem, it will highly appreciated.

from materialchipsinput.

sajadsoft1 avatar sajadsoft1 commented on June 10, 2024

ChipInput not working in scroll view , chips adapter not show

from materialchipsinput.

nicolasrodf avatar nicolasrodf commented on June 10, 2024

You can clear focus from chip_input listening scroll status of scrollView:

scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
@OverRide
public void onScrollChanged() {
chipsInput.clearFocus();
}
});

This clear focus and you can scrolling

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.