List of usage examples for android.widget SimpleMonthView getMonthHeight
public int getMonthHeight()
From source file:connect.app.com.connect.calendar.DayPickerView.java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final ImageButton leftButton; final ImageButton rightButton; // if (isLayoutRtl()) { // leftButton = mNextButton; // rightButton = mPrevButton; // } else { // leftButton = mPrevButton; // rightButton = mNextButton; // }// w ww . j a va2s . com leftButton = mPrevButton; rightButton = mNextButton; final int width = right - left; final int height = bottom - top; mViewPager.layout(0, 0, width, height); final SimpleMonthView monthView = (SimpleMonthView) mViewPager.getChildAt(0); final int monthHeight = monthView.getMonthHeight(); final int cellWidth = monthView.getCellWidth(); // Vertically center the previous/next buttons within the month // header, horizontally center within the day cell. final int leftDW = leftButton.getMeasuredWidth(); final int leftDH = leftButton.getMeasuredHeight(); final int leftIconTop = monthView.getPaddingTop() + (monthHeight - leftDH) / 2; final int leftIconLeft = monthView.getPaddingLeft() + (cellWidth - leftDW) / 2; leftButton.layout(leftIconLeft, leftIconTop, leftIconLeft + leftDW, leftIconTop + leftDH); final int rightDW = rightButton.getMeasuredWidth(); final int rightDH = rightButton.getMeasuredHeight(); final int rightIconTop = monthView.getPaddingTop() + (monthHeight - rightDH) / 2; final int rightIconRight = width - monthView.getPaddingRight() - (cellWidth - rightDW) / 2; rightButton.layout(rightIconRight - rightDW, rightIconTop, rightIconRight, rightIconTop + rightDH); }
From source file:com.tr4android.support.extension.picker.date.DayPickerView.java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final ImageButton leftButton; final ImageButton rightButton; if (ViewCompatUtils.isLayoutRtl(this)) { leftButton = mNextButton;//www . j a v a 2 s .com rightButton = mPrevButton; } else { leftButton = mPrevButton; rightButton = mNextButton; } PickerThemeUtils.setNavButtonDrawable(getContext(), leftButton, rightButton, mAdapter.getMonthTextAppearance()); final int width = right - left; final int height = bottom - top; mViewPager.layout(0, 0, width, height); final SimpleMonthView monthView = (SimpleMonthView) mViewPager.getChildAt(0); final int monthHeight = monthView.getMonthHeight(); final int cellWidth = monthView.getCellWidth(); // Vertically center the previous/next buttons within the month // header, horizontally center within the day cell. final int leftDW = leftButton.getMeasuredWidth(); final int leftDH = leftButton.getMeasuredHeight(); final int leftIconTop = monthView.getPaddingTop() + (monthHeight - leftDH) / 2; final int leftIconLeft = monthView.getPaddingLeft() + (cellWidth - leftDW) / 2; leftButton.layout(leftIconLeft, leftIconTop, leftIconLeft + leftDW, leftIconTop + leftDH); final int rightDW = rightButton.getMeasuredWidth(); final int rightDH = rightButton.getMeasuredHeight(); final int rightIconTop = monthView.getPaddingTop() + (monthHeight - rightDH) / 2; final int rightIconRight = width - monthView.getPaddingRight() - (cellWidth - rightDW) / 2; rightButton.layout(rightIconRight - rightDW, rightIconTop, rightIconRight, rightIconTop + rightDH); }
From source file:com.appeaser.sublimepickerlibrary.datepicker.DayPickerView.java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final ImageButton leftButton; final ImageButton rightButton; if (SUtils.isLayoutRtlCompat(this)) { leftButton = mNextButton;//from w ww .j a v a2 s.co m rightButton = mPrevButton; } else { leftButton = mPrevButton; rightButton = mNextButton; } final int width = right - left; final int height = bottom - top; mViewPager.layout(0, 0, width, height); final SimpleMonthView monthView = (SimpleMonthView) mViewPager.getChildAt(0).findViewById(R.id.month_view); final int monthHeight = monthView.getMonthHeight(); final int cellWidth = monthView.getCellWidth(); // Vertically center the previous/next buttons within the month // header, horizontally center within the day cell. final int leftDW = leftButton.getMeasuredWidth(); final int leftDH = leftButton.getMeasuredHeight(); final int leftIconTop = monthView.getPaddingTop() + (monthHeight - leftDH) / 2; final int leftIconLeft = monthView.getPaddingLeft() + (cellWidth - leftDW) / 2; leftButton.layout(leftIconLeft, leftIconTop, leftIconLeft + leftDW, leftIconTop + leftDH); final int rightDW = rightButton.getMeasuredWidth(); final int rightDH = rightButton.getMeasuredHeight(); final int rightIconTop = monthView.getPaddingTop() + (monthHeight - rightDH) / 2; final int rightIconRight = width - monthView.getPaddingRight() - (cellWidth - rightDW) / 2; rightButton.layout(rightIconRight - rightDW, rightIconTop, rightIconRight, rightIconTop + rightDH); }
From source file:com.miuhouse.yourcompany.student.view.widget.date.datepicker.DayPickerView.java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { final TextView leftButton; final TextView rightButton; if (SUtils.isLayoutRtlCompat(this)) { leftButton = mNextButton;// w w w .j a v a 2s .c om rightButton = mPrevButton; } else { leftButton = mPrevButton; rightButton = mNextButton; } final int width = right - left; final int height = bottom - top; mViewPager.layout(0, 0, width, height); final SimpleMonthView monthView = (SimpleMonthView) mViewPager.getChildAt(0).findViewById(R.id.month_view); final int monthHeight = monthView.getMonthHeight(); // final int monthHeight = 0; final int cellWidth = monthView.getCellWidth(); // Vertically center the previous/next buttons within the month // header, horizontally center within the day cell. final int leftDW = leftButton.getMeasuredWidth(); final int leftDH = leftButton.getMeasuredHeight(); final int leftIconTop = monthView.getPaddingTop() + (monthHeight - leftDH) / 2; final int leftIconLeft = monthView.getPaddingLeft() + (cellWidth - leftDW) / 2; leftButton.layout(leftIconLeft, leftIconTop, leftIconLeft + leftDW, leftIconTop + leftDH); final int rightDW = rightButton.getMeasuredWidth(); final int tvResetDW = tvReset.getMeasuredWidth(); final int rightDH = rightButton.getMeasuredHeight(); final int tvResetDH = tvReset.getMeasuredHeight(); final int rightIconTop = monthView.getPaddingTop() + (monthHeight - rightDH) / 2; final int tvResetIconTop = monthView.getPaddingTop() + (monthHeight - tvResetDH) / 2; final int rightIconRight1 = width - monthView.getPaddingRight() - (cellWidth - rightDW) / 2 - 60; final int rightIconRight = leftIconLeft + 180; rightButton.layout(rightIconRight, rightIconTop, rightIconRight + rightDW, rightIconTop + rightDH); tvReset.layout(rightIconRight1 - tvResetDW, tvResetIconTop, rightIconRight1, tvResetIconTop + tvResetDH); }