GithubHelp home page GithubHelp logo

Comments (7)

tiper avatar tiper commented on May 26, 2024 1

Hi @Marcosmaliki the spinner dropdown/dialog/bottomsheet is triggered when the spinner is focused. Try to ensure that the spinner is not the only focusable view. For example you can try adding android:descendantFocusability="beforeDescendants", android:focusable="true" and android:focusableInTouchMode="true" to the spinner parent.

from materialspinner.

emersonassis avatar emersonassis commented on May 26, 2024 1

The solution proposed by @tiper saved me...

from materialspinner.

Marcosmaliki avatar Marcosmaliki commented on May 26, 2024 1

Thank you. Works perfectly

from materialspinner.

githeyj avatar githeyj commented on May 26, 2024

Hi @tiper this did not help

from materialspinner.

tiper avatar tiper commented on May 26, 2024

@githeyj Did you add the properties to the spinner itself or the parent?

from materialspinner.

sebasira avatar sebasira commented on May 26, 2024

@githeyj do you happen to use a ScrollView as the top-parent layout? I was having the same problem:

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:descendantFocusability="beforeDescendants"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <LinearLayout
            android:id="@+id/subItem"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.tiper.MaterialSpinner
                    android:id="@+id/spinner"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:hint="@string/hint_spinner"/>

        </LinearLayout>
</ScrollView>

With this structure (I've got a lot more spinners), the focus automatically goes to the first item of the layout after I close the spinner (no matter if the first item is a Spinner or and EditText). If the first item is a Spinner I won't be able to close it, and if I click the third spinner, I can close it but it will automatically open the first one.

I wrap the ScrollView in another layout (I use a CoordinatorLayout) and now it works

from materialspinner.

divya-navsoft avatar divya-navsoft commented on May 26, 2024

Hi @tiper really awesome library you've created. I want to add country image flag and country code as fetched from api and add custom adapter in the material spinner and show it when item selected. I have successfully created the custom adapter showing bottom dialog with image flag and code but when I'm selecting one item its only text that showing in Materialspinner. please help.

from materialspinner.

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.