diff options
7 files changed, 109 insertions, 17 deletions
diff --git a/core/java/android/widget/SimpleMonthView.java b/core/java/android/widget/SimpleMonthView.java index 8a7ce1280ad7..43cf5a1cdc0b 100644 --- a/core/java/android/widget/SimpleMonthView.java +++ b/core/java/android/widget/SimpleMonthView.java @@ -33,6 +33,7 @@ import android.text.TextPaint; import android.text.format.DateFormat; import android.util.AttributeSet; import android.util.IntArray; +import android.util.Log; import android.util.MathUtils; import android.util.StateSet; import android.view.KeyEvent; @@ -69,6 +70,9 @@ class SimpleMonthView extends View { private static final int SELECTED_HIGHLIGHT_ALPHA = 0xB0; + /** Temporary until we figure out why the date gets messed up. */ + private static final boolean DEBUG_WRONG_DATE = true; + private final TextPaint mMonthPaint = new TextPaint(); private final TextPaint mDayOfWeekPaint = new TextPaint(); private final TextPaint mDayPaint = new TextPaint(); @@ -189,6 +193,12 @@ class SimpleMonthView extends View { } private void updateDayOfWeekLabels() { + if (DEBUG_WRONG_DATE) { + Log.d(LOG_TAG, "enter updateDayOfWeekLabels()", new Exception()); + Log.d(LOG_TAG, "mLocale => " + mLocale); + Log.d(LOG_TAG, "mWeekStart => " + mWeekStart); + } + final Calendar calendar = Calendar.getInstance(mLocale); calendar.setFirstDayOfWeek(mWeekStart); @@ -197,6 +207,10 @@ class SimpleMonthView extends View { calendar.set(Calendar.DAY_OF_WEEK, i); mDayOfWeekLabels[i] = formatter.format(calendar.getTime()); } + + if (DEBUG_WRONG_DATE) { + Log.d(LOG_TAG, "mDayOfWeekLabels <= " + Arrays.toString(mDayOfWeekLabels)); + } } /** @@ -760,12 +774,20 @@ class SimpleMonthView extends View { * {@link Calendar#SUNDAY} through {@link Calendar#SATURDAY} */ public void setFirstDayOfWeek(int weekStart) { + if (DEBUG_WRONG_DATE) { + Log.d(LOG_TAG, "enter setFirstDayOfWeek(" + weekStart + ")", new Exception()); + } + if (isValidDayOfWeek(weekStart)) { mWeekStart = weekStart; } else { mWeekStart = mCalendar.getFirstDayOfWeek(); } + if (DEBUG_WRONG_DATE) { + Log.d(LOG_TAG, "mWeekStart <=" + mWeekStart); + } + updateDayOfWeekLabels(); // Invalidate cached accessibility information. diff --git a/packages/DocumentsUI/res/animator/dir_enter.xml b/packages/DocumentsUI/res/animator/dir_enter.xml index 7f547f135cd6..7daf1c04bce8 100644 --- a/packages/DocumentsUI/res/animator/dir_enter.xml +++ b/packages/DocumentsUI/res/animator/dir_enter.xml @@ -13,10 +13,23 @@ limitations under the License. --> -<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" - android:valueFrom="1" - android:valueTo="0" - android:propertyName="position" - android:valueType="floatType" - android:duration="@android:integer/config_mediumAnimTime" - android:interpolator="@android:interpolator/decelerate_quad" /> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:ordering="together"> + + <objectAnimator + android:valueFrom="0f" + android:valueTo="1f" + android:propertyName="alpha" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/decelerate_quad" /> + + <objectAnimator + android:propertyName="position" + android:valueFrom="1" + android:valueTo="0" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/decelerate_quad" /> + +</set> diff --git a/packages/DocumentsUI/res/animator/dir_leave.xml b/packages/DocumentsUI/res/animator/dir_leave.xml index fda0faf4eff3..de09638ddd30 100644 --- a/packages/DocumentsUI/res/animator/dir_leave.xml +++ b/packages/DocumentsUI/res/animator/dir_leave.xml @@ -13,10 +13,23 @@ limitations under the License. --> -<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" - android:valueFrom="0" - android:valueTo="1" - android:propertyName="position" - android:valueType="floatType" - android:duration="@android:integer/config_mediumAnimTime" - android:interpolator="@android:interpolator/accelerate_quad" /> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:ordering="together"> + + <objectAnimator + android:valueFrom="1f" + android:valueTo="0f" + android:propertyName="alpha" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/decelerate_quad" /> + + <objectAnimator + android:valueFrom="0" + android:valueTo="1" + android:propertyName="position" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/accelerate_quad" /> + +</set>
\ No newline at end of file diff --git a/packages/DocumentsUI/res/animator/fade_in.xml b/packages/DocumentsUI/res/animator/fade_in.xml new file mode 100644 index 000000000000..3ce012b96f64 --- /dev/null +++ b/packages/DocumentsUI/res/animator/fade_in.xml @@ -0,0 +1,22 @@ +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:valueFrom="0f" + android:valueTo="1f" + android:propertyName="alpha" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/decelerate_quad" /> diff --git a/packages/DocumentsUI/res/animator/fade_out.xml b/packages/DocumentsUI/res/animator/fade_out.xml new file mode 100644 index 000000000000..8d02c77fc345 --- /dev/null +++ b/packages/DocumentsUI/res/animator/fade_out.xml @@ -0,0 +1,22 @@ +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:valueFrom="1f" + android:valueTo="0f" + android:propertyName="alpha" + android:valueType="floatType" + android:duration="@android:integer/config_mediumAnimTime" + android:interpolator="@android:interpolator/decelerate_quad" /> diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java index 000b92a0b1a5..a26fb478b64e 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java @@ -46,7 +46,7 @@ public class DirectoryView extends LinearLayout { public void setPosition(float position) { mPosition = position; - setX((mWidth > 0) ? (mPosition * mWidth) : 0); + setY((mWidth > 0) ? (mPosition * mWidth) : 0); if (mPosition != 0) { setTranslationZ(getResources().getDimensionPixelSize(R.dimen.dir_elevation)); diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java index 461bade4ae83..95aa067b806b 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java @@ -1491,10 +1491,10 @@ public class DirectoryFragment extends Fragment break; case ANIM_ENTER: args.putBoolean(Shared.EXTRA_IGNORE_STATE, true); - ft.setCustomAnimations(R.animator.dir_enter, R.animator.dir_frozen); + ft.setCustomAnimations(R.animator.dir_enter, R.animator.fade_out); break; case ANIM_LEAVE: - ft.setCustomAnimations(R.animator.dir_frozen, R.animator.dir_leave); + ft.setCustomAnimations(R.animator.fade_in, R.animator.dir_leave); break; } |