Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13427a04 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Clean up of the DatePicker

1. Removed a duplicate DatePicker stylable.

2. Fixed a bug that if the user wrongly desires to have the
   calendar view and spinners hidden despite that DataPicker
   ovrrides such incorrect choice to show at least the spinners
   the min adn max date attributes are igonored.

Change-Id: I6307db71aca837ad790aea59fa70ead393feb066
parent e62e890b
Loading
Loading
Loading
Loading
+22 −24
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ public class DatePicker extends FrameLayout {
        } else {
            setSpinnersShown(spinnersShown);
            setCalendarViewShown(calendarViewShown);
        }

        // set the min date giving priority of the minDate over startYear
        mTempDate.clear();
@@ -239,10 +240,9 @@ public class DatePicker extends FrameLayout {
        } else {
            mTempDate.set(startYear, 0, 1);
        }
            mMinDate.clear();
        setMinDate(mTempDate.getTimeInMillis());

            // set the max date giving priority of the minDate over startYear
        // set the max date giving priority of the maxDate over endYear
        mTempDate.clear();
        if (!TextUtils.isEmpty(maxDate)) {
            if (!parseDate(maxDate, mTempDate)) {
@@ -251,14 +251,12 @@ public class DatePicker extends FrameLayout {
        } else {
            mTempDate.set(endYear, 11, 31);
        }
            mMaxDate.clear();
        setMaxDate(mTempDate.getTimeInMillis());

        // initialize to current date
        mCurrentDate.setTimeInMillis(System.currentTimeMillis());
        init(mCurrentDate.get(Calendar.YEAR), mCurrentDate.get(Calendar.MONTH), mCurrentDate
                .get(Calendar.DAY_OF_MONTH), null);
        }

        // re-order the number spinners to match the current date format
        reorderSpinners();
+0 −5
Original line number Diff line number Diff line
@@ -3146,11 +3146,6 @@
        <attr name="layout" />
    </declare-styleable>

    <declare-styleable name="DatePicker">
        <!-- @hide The layout of the time picker. -->
        <attr name="layout" />
    </declare-styleable>

    <!-- ========================= -->
    <!-- Drawable class attributes -->
    <!-- ========================= -->