SimplicityApks / ReminderDatePicker

A Google Keep-like Date and Time Picker for reminders
Apache License 2.0
74 stars 26 forks source link

Spinner XML background color #25

Closed chrisonline closed 9 years ago

chrisonline commented 9 years ago

It's me again ;-) I wanted to show the Spinner without the "spinner" look. Should look like an TextView. So I decided to set a background color transparent.

Now comes the strange part..

If I select an smart date or time like "Today", "Afternoon" it works great. But once I select an date or time outside the smart dates the COMPLETE spinner is removed from the layout !?!

I don't see it anymore ....

Not working after selecting a Date outside the smart dates: non_working

Below "Datum (Date)" the complete DateSpinner is gone.

Here is the XML code:

            <com.simplicityapks.reminderdatepicker.lib.DateSpinner
                android:id="@+id/rdpDate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="-8dp"
                android:layout_marginStart="-8dp"
                android:background="@color/transparent"
                android:gravity="left"
                android:layout_below="@id/tvLabel_rdpDate"/>
SimplicityApks commented 9 years ago

Allright that is really strange... I can reproduce it over here as well, definetely related to the background (doesn't matter what color you set it, it is always gone). Right now I assume it occurs because height is set to wrap_content, since when you set a fixed height it doesn't shrink itself to size zero (that should also be an ugly fix for you ;) ). I'll have to investigate that further when I get the time.

Btw your UI is looking really good!

SimplicityApks commented 9 years ago

Well I couldn't find why this is happening, so here is the workaround: The spinner is now always at least 48dp tall (which it should have been from the start). Make sure you use the PickerSpinner style when including the Spinner in your layout file, that way minHeight is set correctly.

chrisonline commented 9 years ago

OK thanks for the fix/workaround. Works great!