Loading core/java/android/widget/DayPickerView.java +16 −2 Original line number Diff line number Diff line Loading @@ -195,10 +195,24 @@ class DayPickerView extends ViewGroup { mNextButton.measure(buttonWidthSpec, buttonHeightSpec); } @Override public void onRtlPropertiesChanged(@ResolvedLayoutDir int layoutDirection) { super.onRtlPropertiesChanged(layoutDirection); requestLayout(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final ImageButton leftButton = mPrevButton; final ImageButton rightButton = mNextButton; final ImageButton leftButton; final ImageButton rightButton; if (isLayoutRtl()) { leftButton = mNextButton; rightButton = mPrevButton; } else { leftButton = mPrevButton; rightButton = mNextButton; } final int width = right - left; final int height = bottom - top; Loading core/java/android/widget/SimpleMonthView.java +47 −9 Original line number Diff line number Diff line Loading @@ -162,7 +162,6 @@ class SimpleMonthView extends View { mTitleFormatter = new SimpleDateFormat(titleFormat, locale); mDayOfWeekFormatter = new SimpleDateFormat(DAY_OF_WEEK_FORMAT, locale); setClickable(true); initPaints(res); } Loading Loading @@ -318,7 +317,8 @@ class SimpleMonthView extends View { final int x = (int) (event.getX() + 0.5f); final int y = (int) (event.getY() + 0.5f); switch (event.getAction()) { final int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_MOVE: final int touchedItem = getDayAtLocation(x, y); Loading @@ -326,6 +326,10 @@ class SimpleMonthView extends View { mTouchedItem = touchedItem; invalidate(); } if (action == MotionEvent.ACTION_DOWN && touchedItem < 0) { // Touch something that's not an item, reject event. return false; } break; case MotionEvent.ACTION_UP: Loading Loading @@ -376,9 +380,16 @@ class SimpleMonthView extends View { for (int col = 0; col < DAYS_IN_WEEK; col++) { final int colCenter = colWidth * col + colWidth / 2; final int colCenterRtl; if (isLayoutRtl()) { colCenterRtl = mPaddedWidth - colCenter; } else { colCenterRtl = colCenter; } final int dayOfWeek = (col + mWeekStart) % DAYS_IN_WEEK; final String label = getDayOfWeekLabel(dayOfWeek); canvas.drawText(label, colCenter, rowCenter - halfLineHeight, p); canvas.drawText(label, colCenterRtl, rowCenter - halfLineHeight, p); } } Loading @@ -402,6 +413,13 @@ class SimpleMonthView extends View { for (int day = 1, col = findDayOffset(); day <= mDaysInMonth; day++) { final int colCenter = colWidth * col + colWidth / 2; final int colCenterRtl; if (isLayoutRtl()) { colCenterRtl = mPaddedWidth - colCenter; } else { colCenterRtl = colCenter; } int stateMask = 0; if (day >= mEnabledDayStart && day <= mEnabledDayEnd) { Loading @@ -413,12 +431,12 @@ class SimpleMonthView extends View { stateMask |= StateSet.VIEW_STATE_ACTIVATED; // Adjust the circle to be centered on the row. canvas.drawCircle(colCenter, rowCenter, mDaySelectorRadius, mDaySelectorPaint); canvas.drawCircle(colCenterRtl, rowCenter, mDaySelectorRadius, mDaySelectorPaint); } else if (mTouchedItem == day) { stateMask |= StateSet.VIEW_STATE_PRESSED; // Adjust the circle to be centered on the row. canvas.drawCircle(colCenter, rowCenter, mDaySelectorRadius, mDayHighlightPaint); canvas.drawCircle(colCenterRtl, rowCenter, mDaySelectorRadius, mDayHighlightPaint); } final boolean isDayToday = mToday == day; Loading @@ -431,7 +449,7 @@ class SimpleMonthView extends View { } p.setColor(dayTextColor); canvas.drawText(Integer.toString(day), colCenter, rowCenter - halfLineHeight, p); canvas.drawText(Integer.toString(day), colCenterRtl, rowCenter - halfLineHeight, p); col++; Loading Loading @@ -582,6 +600,13 @@ class SimpleMonthView extends View { setMeasuredDimension(resolvedWidth, resolvedHeight); } @Override public void onRtlPropertiesChanged(@ResolvedLayoutDir int layoutDirection) { super.onRtlPropertiesChanged(layoutDirection); requestLayout(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (!changed) { Loading Loading @@ -657,8 +682,16 @@ class SimpleMonthView extends View { return -1; } // Adjust for RTL after applying padding. final int paddedXRtl; if (isLayoutRtl()) { paddedXRtl = mPaddedWidth - paddedX; } else { paddedXRtl = paddedX; } final int row = (paddedY - headerHeight) / mDayHeight; final int col = (paddedX * DAYS_IN_WEEK) / mPaddedWidth; final int col = (paddedXRtl * DAYS_IN_WEEK) / mPaddedWidth; final int index = col + row * DAYS_IN_WEEK; final int day = index + 1 - findDayOffset(); if (day < 1 || day > mDaysInMonth) { Loading @@ -681,10 +714,15 @@ class SimpleMonthView extends View { final int index = id - 1 + findDayOffset(); // Compute left edge. // Compute left edge, taking into account RTL. final int col = index % DAYS_IN_WEEK; final int colWidth = mCellWidth; final int left = getPaddingLeft() + col * colWidth; final int left; if (isLayoutRtl()) { left = getWidth() - getPaddingRight() - (col + 1) * colWidth; } else { left = getPaddingLeft() + col * colWidth; } // Compute top edge. final int row = index / DAYS_IN_WEEK; Loading core/java/com/android/internal/widget/ViewPager.java +279 −296 File changed.Preview size limit exceeded, changes collapsed. Show changes core/res/res/drawable/ic_chevron_right.xml→core/res/res/drawable/ic_chevron_end.xml +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal" android:autoMirrored="true"> <path android:fillColor="#FF000000" android:pathData="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6,-6z"/> Loading core/res/res/drawable/ic_chevron_left.xml→core/res/res/drawable/ic_chevron_start.xml +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal" android:autoMirrored="true"> <path android:fillColor="#FF000000" android:pathData="M15.41 7.41L14 6l-6 6 6 6 1.41,-1.41L10.83 12z"/> Loading Loading
core/java/android/widget/DayPickerView.java +16 −2 Original line number Diff line number Diff line Loading @@ -195,10 +195,24 @@ class DayPickerView extends ViewGroup { mNextButton.measure(buttonWidthSpec, buttonHeightSpec); } @Override public void onRtlPropertiesChanged(@ResolvedLayoutDir int layoutDirection) { super.onRtlPropertiesChanged(layoutDirection); requestLayout(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final ImageButton leftButton = mPrevButton; final ImageButton rightButton = mNextButton; final ImageButton leftButton; final ImageButton rightButton; if (isLayoutRtl()) { leftButton = mNextButton; rightButton = mPrevButton; } else { leftButton = mPrevButton; rightButton = mNextButton; } final int width = right - left; final int height = bottom - top; Loading
core/java/android/widget/SimpleMonthView.java +47 −9 Original line number Diff line number Diff line Loading @@ -162,7 +162,6 @@ class SimpleMonthView extends View { mTitleFormatter = new SimpleDateFormat(titleFormat, locale); mDayOfWeekFormatter = new SimpleDateFormat(DAY_OF_WEEK_FORMAT, locale); setClickable(true); initPaints(res); } Loading Loading @@ -318,7 +317,8 @@ class SimpleMonthView extends View { final int x = (int) (event.getX() + 0.5f); final int y = (int) (event.getY() + 0.5f); switch (event.getAction()) { final int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_MOVE: final int touchedItem = getDayAtLocation(x, y); Loading @@ -326,6 +326,10 @@ class SimpleMonthView extends View { mTouchedItem = touchedItem; invalidate(); } if (action == MotionEvent.ACTION_DOWN && touchedItem < 0) { // Touch something that's not an item, reject event. return false; } break; case MotionEvent.ACTION_UP: Loading Loading @@ -376,9 +380,16 @@ class SimpleMonthView extends View { for (int col = 0; col < DAYS_IN_WEEK; col++) { final int colCenter = colWidth * col + colWidth / 2; final int colCenterRtl; if (isLayoutRtl()) { colCenterRtl = mPaddedWidth - colCenter; } else { colCenterRtl = colCenter; } final int dayOfWeek = (col + mWeekStart) % DAYS_IN_WEEK; final String label = getDayOfWeekLabel(dayOfWeek); canvas.drawText(label, colCenter, rowCenter - halfLineHeight, p); canvas.drawText(label, colCenterRtl, rowCenter - halfLineHeight, p); } } Loading @@ -402,6 +413,13 @@ class SimpleMonthView extends View { for (int day = 1, col = findDayOffset(); day <= mDaysInMonth; day++) { final int colCenter = colWidth * col + colWidth / 2; final int colCenterRtl; if (isLayoutRtl()) { colCenterRtl = mPaddedWidth - colCenter; } else { colCenterRtl = colCenter; } int stateMask = 0; if (day >= mEnabledDayStart && day <= mEnabledDayEnd) { Loading @@ -413,12 +431,12 @@ class SimpleMonthView extends View { stateMask |= StateSet.VIEW_STATE_ACTIVATED; // Adjust the circle to be centered on the row. canvas.drawCircle(colCenter, rowCenter, mDaySelectorRadius, mDaySelectorPaint); canvas.drawCircle(colCenterRtl, rowCenter, mDaySelectorRadius, mDaySelectorPaint); } else if (mTouchedItem == day) { stateMask |= StateSet.VIEW_STATE_PRESSED; // Adjust the circle to be centered on the row. canvas.drawCircle(colCenter, rowCenter, mDaySelectorRadius, mDayHighlightPaint); canvas.drawCircle(colCenterRtl, rowCenter, mDaySelectorRadius, mDayHighlightPaint); } final boolean isDayToday = mToday == day; Loading @@ -431,7 +449,7 @@ class SimpleMonthView extends View { } p.setColor(dayTextColor); canvas.drawText(Integer.toString(day), colCenter, rowCenter - halfLineHeight, p); canvas.drawText(Integer.toString(day), colCenterRtl, rowCenter - halfLineHeight, p); col++; Loading Loading @@ -582,6 +600,13 @@ class SimpleMonthView extends View { setMeasuredDimension(resolvedWidth, resolvedHeight); } @Override public void onRtlPropertiesChanged(@ResolvedLayoutDir int layoutDirection) { super.onRtlPropertiesChanged(layoutDirection); requestLayout(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (!changed) { Loading Loading @@ -657,8 +682,16 @@ class SimpleMonthView extends View { return -1; } // Adjust for RTL after applying padding. final int paddedXRtl; if (isLayoutRtl()) { paddedXRtl = mPaddedWidth - paddedX; } else { paddedXRtl = paddedX; } final int row = (paddedY - headerHeight) / mDayHeight; final int col = (paddedX * DAYS_IN_WEEK) / mPaddedWidth; final int col = (paddedXRtl * DAYS_IN_WEEK) / mPaddedWidth; final int index = col + row * DAYS_IN_WEEK; final int day = index + 1 - findDayOffset(); if (day < 1 || day > mDaysInMonth) { Loading @@ -681,10 +714,15 @@ class SimpleMonthView extends View { final int index = id - 1 + findDayOffset(); // Compute left edge. // Compute left edge, taking into account RTL. final int col = index % DAYS_IN_WEEK; final int colWidth = mCellWidth; final int left = getPaddingLeft() + col * colWidth; final int left; if (isLayoutRtl()) { left = getWidth() - getPaddingRight() - (col + 1) * colWidth; } else { left = getPaddingLeft() + col * colWidth; } // Compute top edge. final int row = index / DAYS_IN_WEEK; Loading
core/java/com/android/internal/widget/ViewPager.java +279 −296 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/res/res/drawable/ic_chevron_right.xml→core/res/res/drawable/ic_chevron_end.xml +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal" android:autoMirrored="true"> <path android:fillColor="#FF000000" android:pathData="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6,-6z"/> Loading
core/res/res/drawable/ic_chevron_left.xml→core/res/res/drawable/ic_chevron_start.xml +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal" android:autoMirrored="true"> <path android:fillColor="#FF000000" android:pathData="M15.41 7.41L14 6l-6 6 6 6 1.41,-1.41L10.83 12z"/> Loading