eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

minSdk9 branch not functional on Gingerbread #12

Closed mtotschnig closed 7 years ago

mtotschnig commented 7 years ago

While trying to use the SimpleColorDialog on Gingerbread I found the following problems:

  1. mListView.setAdapter(mAdapter); in CustomListDialog
  2. PorterDuff.Mode.ADD in ColorWheelView

were added in API 11 and lead to crash.

mtotschnig commented 7 years ago

First issue can be fixed with

        if (mListView instanceof ListView) {
            ((ListView) mListView).setAdapter(mAdapter);
        } else if (mListView instanceof GridView) {
            ((GridView) mListView).setAdapter(mAdapter);
        }

For second issue, I replaced ADD with SCREEN, but the result does not look good. My suggestion would be not allow custom picker below Honeycomb.

eltos commented 7 years ago

I'm fine with that. I'll update the Library shortly.