From 991dca88d878a56354291bc29b49931f2f5d3c59 Mon Sep 17 00:00:00 2001 From: marunjar Date: Sun, 7 Feb 2016 21:40:18 +0100 Subject: [PATCH 1/2] customizable focus point allow setting a customizeable focus point (height) to center zoom: - fixedFocusPointFraction: a fraction where to set the specific point in view height - fixedFocusPointEnabled: if disabled the center of the zoom gesture is used --- README.md | 5 + .../java/com/alamkanak/weekview/WeekView.java | 195 ++++++++++-------- .../com/alamkanak/weekview/WeekViewEvent.java | 51 +++++ .../com/alamkanak/weekview/WeekViewUtil.java | 39 ++++ library/src/main/res/values/attrs.xml | 5 +- .../weekview/sample/BasicActivity.java | 15 ++ 6 files changed, 220 insertions(+), 90 deletions(-) create mode 100644 library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java diff --git a/README.md b/README.md index e83c54ec7..7226cc360 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ Customization You can customize the look of the `WeekView` in xml. Use the following attributes in xml. All these attributes also have getters and setters to enable you to change the style dynamically. +- `allDayEventHeight` - `columnGap` - `dayBackgroundColor` - `dayNameLength` @@ -103,7 +104,10 @@ You can customize the look of the `WeekView` in xml. Use the following attribute - `eventPadding` - `eventTextColor` - `eventTextSize` +- `focusPoint` - `firstDayOfWeek` +- `fixedFocusPointEnabled` The focused point (time) while zooming the week view. You can declare it as a fraction `app:focusPoint="30%"` and if is not declared the top of the view is used. +- `fixedFocusPointFraction` If you disable the fixed focus point the center of your zoom gesture is used. - `headerColumnBackground` - `headerColumnPadding` - `headerColumnTextColor` @@ -126,6 +130,7 @@ You can customize the look of the `WeekView` in xml. Use the following attribute - `showNowLine` - `nowLineColor` - `nowLineThickness` +- `scrollDuration` Interfaces ---------- diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index 2768e9a33..a29da5dab 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -41,6 +41,8 @@ import java.util.List; import java.util.Locale; +import static com.alamkanak.weekview.WeekViewUtil.*; + /** * Created by Raquib-ul-Alam Kanak on 7/21/2014. * Website: http://alamkanak.github.io/ @@ -141,6 +143,9 @@ private enum Direction { private boolean mHorizontalFlingEnabled = true; private boolean mVerticalFlingEnabled = true; private int mAllDayEventHeight= 100; + private float mFixedFocusPointFraction = 0; + private boolean mFixedFocusPointEnabled = true; + private int mScrollDuration = 250; // Listeners. private EventClickListener mEventClickListener; @@ -348,7 +353,10 @@ public WeekView(Context context, AttributeSet attrs, int defStyleAttr) { mShowNowLine = a.getBoolean(R.styleable.WeekView_showNowLine, mShowNowLine); mHorizontalFlingEnabled = a.getBoolean(R.styleable.WeekView_horizontalFlingEnabled, mHorizontalFlingEnabled); mVerticalFlingEnabled = a.getBoolean(R.styleable.WeekView_verticalFlingEnabled, mVerticalFlingEnabled); - mAllDayEventHeight = a.getInt(R.styleable.WeekView_allDayEventHeight, mAllDayEventHeight); + mAllDayEventHeight = a.getDimensionPixelSize(R.styleable.WeekView_allDayEventHeight, mAllDayEventHeight); + mFixedFocusPointFraction = a.getFraction(R.styleable.WeekView_fixedFocusPointFraction, 1, 1, mFixedFocusPointFraction); + mFixedFocusPointEnabled = a.getBoolean(R.styleable.WeekView_fixedFocusPointEnabled, mFixedFocusPointEnabled); + mScrollDuration = a.getInt(R.styleable.WeekView_scrollDuration, mScrollDuration); } finally { a.recycle(); } @@ -439,26 +447,7 @@ private void init() { // Set default event color. mDefaultEventColor = Color.parseColor("#9fc6e7"); - mScaleDetector = new ScaleGestureDetector(mContext, new ScaleGestureDetector.OnScaleGestureListener() { - @Override - public void onScaleEnd(ScaleGestureDetector detector) { - mIsZooming = false; - } - - @Override - public boolean onScaleBegin(ScaleGestureDetector detector) { - mIsZooming = true; - goToNearestOrigin(); - return true; - } - - @Override - public boolean onScale(ScaleGestureDetector detector) { - mNewHourHeight = Math.round(mHourHeight * detector.getScaleFactor()); - invalidate(); - return true; - } - }); + mScaleDetector = new ScaleGestureDetector(mContext, new WeekViewGestureListener()); } // fix rotation changes @@ -486,9 +475,6 @@ private void initTextTimeWidth() { protected void onDraw(Canvas canvas) { super.onDraw(canvas); - // Hide everything in the first cell (top left corner). - canvas.drawRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint); - // Draw the header row. drawHeaderRowAndEvents(canvas); @@ -585,7 +571,6 @@ private void drawHeaderRowAndEvents(Canvas canvas) { else if (mNewHourHeight > mMaxHourHeight) mNewHourHeight = mMaxHourHeight; - mCurrentOrigin.y = (mCurrentOrigin.y/mHourHeight)*mNewHourHeight; mHourHeight = mNewHourHeight; mNewHourHeight = -1; } @@ -711,6 +696,9 @@ else if (day.before(today)) { startPixel += mWidthPerDay + mColumnGap; } + // Hide everything in the first cell (top left corner). + canvas.clipRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, Region.Op.REPLACE); + canvas.drawRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint); // Clip to paint header row only. canvas.clipRect(mHeaderColumnWidth, 0, getWidth(), mHeaderHeight + mHeaderRowPadding * 2, Region.Op.REPLACE); @@ -1049,43 +1037,9 @@ else if (periodToFetch == mFetchedPeriod+1){ private void cacheEvent(WeekViewEvent event) { if(event.getStartTime().compareTo(event.getEndTime()) >= 0) return; - if (!isSameDay(event.getStartTime(), event.getEndTime())) { - // Add first day. - Calendar endTime = (Calendar) event.getStartTime().clone(); - endTime.set(Calendar.HOUR_OF_DAY, 23); - endTime.set(Calendar.MINUTE, 59); - WeekViewEvent event1 = new WeekViewEvent(event.getId(), event.getName(), event.getLocation(), event.getStartTime(), endTime, event.isAllDay()); - event1.setColor(event.getColor()); - mEventRects.add(new EventRect(event1, event, null)); - - // Add other days. - Calendar otherDay = (Calendar) event.getStartTime().clone(); - otherDay.add(Calendar.DATE, 1); - while (!isSameDay(otherDay, event.getEndTime())) { - Calendar overDay = (Calendar) otherDay.clone(); - overDay.set(Calendar.HOUR_OF_DAY, 0); - overDay.set(Calendar.MINUTE, 0); - Calendar endOfOverDay = (Calendar) overDay.clone(); - endOfOverDay.set(Calendar.HOUR_OF_DAY, 23); - endOfOverDay.set(Calendar.MINUTE, 59); - WeekViewEvent eventMore = new WeekViewEvent(event.getId(), event.getName(),null, overDay, endOfOverDay, event.isAllDay()); - eventMore.setColor(event.getColor()); - mEventRects.add(new EventRect(eventMore, event, null)); - - // Add next day. - otherDay.add(Calendar.DATE, 1); - } - - // Add last day. - Calendar startTime = (Calendar) event.getEndTime().clone(); - startTime.set(Calendar.HOUR_OF_DAY, 0); - startTime.set(Calendar.MINUTE, 0); - WeekViewEvent event2 = new WeekViewEvent(event.getId(), event.getName(), event.getLocation(), startTime, event.getEndTime(), event.isAllDay()); - event2.setColor(event.getColor()); - mEventRects.add(new EventRect(event2, event, null)); - } - else { - mEventRects.add(new EventRect(event, event, null)); + List splitedEvents = event.splitWeekViewEvents(); + for(WeekViewEvent splitedEvent: splitedEvents){ + mEventRects.add(new EventRect(splitedEvent, event, null)); } } @@ -1828,6 +1782,52 @@ public void setAllDayEventHeight(int height) { mAllDayEventHeight = height; } + /** + * Enable fixed zoom focus point + */ + public void setFixedFocusPointEnabled(boolean fixedFocusPointEnabled) { + mFixedFocusPointEnabled = fixedFocusPointEnabled; + } + + /* + * is fixed focus point enabled + * @return fixed focus point enabled? + */ + public boolean isFixedFocusPointEnabled() { + return mFixedFocusPointEnabled; + } + + /* + * Get fractional focus point, 0 = 0% of height, 1 = 100% of height + * @return fixed focus point + */ + public float getFixedFocusPointFraction() { + return mFixedFocusPointFraction; + } + + /** + * Set fractional focus point, 0 = 0% of height, 1 = 100% of height + */ + public void setFixedFocusPointFraction(int fixedFocusPointFraction) { + mFixedFocusPointFraction = fixedFocusPointFraction; + } + + + /** + * Get scroll duration + * @return scroll duration + */ + public int getScrollDuration() { + return mScrollDuration; + } + + /** + * Set the scroll duration + */ + public void setScrollDuration(int scrollDuration) { + mScrollDuration = scrollDuration; + } + ///////////////////////////////////////////////////////////////// // // Functions related to scrolling. @@ -1873,7 +1873,7 @@ private void goToNearestOrigin(){ // Stop current animation. mScroller.forceFinished(true); // Snap to date. - mScroller.startScroll((int) mCurrentOrigin.x, (int) mCurrentOrigin.y, -nearestOrigin, 0, (int) (Math.abs(nearestOrigin) / mWidthPerDay * 500)); + mScroller.startScroll((int) mCurrentOrigin.x, (int) mCurrentOrigin.y, -nearestOrigin, 0, (int) (Math.abs(nearestOrigin) / mWidthPerDay * mScrollDuration)); ViewCompat.postInvalidateOnAnimation(WeekView.this); } // Reset scrolling and fling direction. @@ -2055,34 +2055,51 @@ public interface ScrollListener { void onFirstVisibleDayChanged(Calendar newFirstVisibleDay, Calendar oldFirstVisibleDay); } - - ///////////////////////////////////////////////////////////////// - // - // Helper methods. - // - ///////////////////////////////////////////////////////////////// - /** - * Checks if two times are on the same day. - * @param dayOne The first day. - * @param dayTwo The second day. - * @return Whether the times are on the same day. + * A simple GestureListener that holds the focused hour while scaling. */ - private boolean isSameDay(Calendar dayOne, Calendar dayTwo) { - return dayOne.get(Calendar.YEAR) == dayTwo.get(Calendar.YEAR) && dayOne.get(Calendar.DAY_OF_YEAR) == dayTwo.get(Calendar.DAY_OF_YEAR); - } + private class WeekViewGestureListener implements ScaleGestureDetector.OnScaleGestureListener { - /** - * Returns a calendar instance at the start of this day - * @return the calendar instance - */ - private Calendar today(){ - Calendar today = Calendar.getInstance(); - today.set(Calendar.HOUR_OF_DAY, 0); - today.set(Calendar.MINUTE, 0); - today.set(Calendar.SECOND, 0); - today.set(Calendar.MILLISECOND, 0); - return today; - } + float mFocusedPointY; + @Override + public void onScaleEnd(ScaleGestureDetector detector) { + mIsZooming = false; + } + + @Override + public boolean onScaleBegin(ScaleGestureDetector detector) { + mIsZooming = true; + goToNearestOrigin(); + + // Calculate focused point for scale action + if (mFixedFocusPointEnabled) { + // Use fractional focus, percentage of height + mFocusedPointY = (getHeight() - mHeaderHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) * mFixedFocusPointFraction; + } else { + // Grab focus + mFocusedPointY = detector.getFocusY(); + } + + return true; + } + + @Override + public boolean onScale(ScaleGestureDetector detector) { + final float scale = detector.getScaleFactor(); + + mNewHourHeight = Math.round(mHourHeight * scale); + + // Calculating difference + float diffY = mFocusedPointY - mCurrentOrigin.y; + // Scaling difference + diffY = diffY * scale - diffY; + // Updating week view origin + mCurrentOrigin.y -= diffY; + + invalidate(); + return true; + } + + } } diff --git a/library/src/main/java/com/alamkanak/weekview/WeekViewEvent.java b/library/src/main/java/com/alamkanak/weekview/WeekViewEvent.java index 6bd46ce51..f49ab5703 100644 --- a/library/src/main/java/com/alamkanak/weekview/WeekViewEvent.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekViewEvent.java @@ -1,6 +1,10 @@ package com.alamkanak.weekview; +import java.util.ArrayList; import java.util.Calendar; +import java.util.List; + +import static com.alamkanak.weekview.WeekViewUtil.*; /** * Created by Raquib-ul-Alam Kanak on 7/21/2014. @@ -167,4 +171,51 @@ public boolean equals(Object o) { public int hashCode() { return (int) (mId ^ (mId >>> 32)); } + + public List splitWeekViewEvents(){ + //This function splits the WeekViewEvent in WeekViewEvents by day + List events = new ArrayList(); + // The first millisecond of the next day is still the same day. (no need to split events for this). + Calendar endTime = (Calendar) this.getEndTime().clone(); + endTime.add(Calendar.MILLISECOND, -1); + if (!isSameDay(this.getStartTime(), endTime)) { + endTime = (Calendar) this.getStartTime().clone(); + endTime.set(Calendar.HOUR_OF_DAY, 23); + endTime.set(Calendar.MINUTE, 59); + WeekViewEvent event1 = new WeekViewEvent(this.getId(), this.getName(), this.getLocation(), this.getStartTime(), endTime, this.isAllDay()); + event1.setColor(this.getColor()); + events.add(event1); + + // Add other days. + Calendar otherDay = (Calendar) this.getStartTime().clone(); + otherDay.add(Calendar.DATE, 1); + while (!isSameDay(otherDay, this.getEndTime())) { + Calendar overDay = (Calendar) otherDay.clone(); + overDay.set(Calendar.HOUR_OF_DAY, 0); + overDay.set(Calendar.MINUTE, 0); + Calendar endOfOverDay = (Calendar) overDay.clone(); + endOfOverDay.set(Calendar.HOUR_OF_DAY, 23); + endOfOverDay.set(Calendar.MINUTE, 59); + WeekViewEvent eventMore = new WeekViewEvent(this.getId(), this.getName(), null, overDay, endOfOverDay, this.isAllDay()); + eventMore.setColor(this.getColor()); + events.add(eventMore); + + // Add next day. + otherDay.add(Calendar.DATE, 1); + } + + // Add last day. + Calendar startTime = (Calendar) this.getEndTime().clone(); + startTime.set(Calendar.HOUR_OF_DAY, 0); + startTime.set(Calendar.MINUTE, 0); + WeekViewEvent event2 = new WeekViewEvent(this.getId(), this.getName(), this.getLocation(), startTime, this.getEndTime(), this.isAllDay()); + event2.setColor(this.getColor()); + events.add(event2); + } + else{ + events.add(this); + } + + return events; + } } diff --git a/library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java b/library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java new file mode 100644 index 000000000..24264669d --- /dev/null +++ b/library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java @@ -0,0 +1,39 @@ +package com.alamkanak.weekview; + +import java.util.Calendar; + +/** + * Created by jesse on 6/02/2016. + */ +public class WeekViewUtil { + + + ///////////////////////////////////////////////////////////////// + // + // Helper methods. + // + ///////////////////////////////////////////////////////////////// + + /** + * Checks if two times are on the same day. + * @param dayOne The first day. + * @param dayTwo The second day. + * @return Whether the times are on the same day. + */ + public static boolean isSameDay(Calendar dayOne, Calendar dayTwo) { + return dayOne.get(Calendar.YEAR) == dayTwo.get(Calendar.YEAR) && dayOne.get(Calendar.DAY_OF_YEAR) == dayTwo.get(Calendar.DAY_OF_YEAR); + } + + /** + * Returns a calendar instance at the start of this day + * @return the calendar instance + */ + public static Calendar today(){ + Calendar today = Calendar.getInstance(); + today.set(Calendar.HOUR_OF_DAY, 0); + today.set(Calendar.MINUTE, 0); + today.set(Calendar.SECOND, 0); + today.set(Calendar.MILLISECOND, 0); + return today; + } +} diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml index 99c6b680a..b8d72d59b 100644 --- a/library/src/main/res/values/attrs.xml +++ b/library/src/main/res/values/attrs.xml @@ -49,6 +49,9 @@ - + + + + diff --git a/sample/src/main/java/com/alamkanak/weekview/sample/BasicActivity.java b/sample/src/main/java/com/alamkanak/weekview/sample/BasicActivity.java index b6322f40b..1ef9a8903 100644 --- a/sample/src/main/java/com/alamkanak/weekview/sample/BasicActivity.java +++ b/sample/src/main/java/com/alamkanak/weekview/sample/BasicActivity.java @@ -142,6 +142,21 @@ public List onMonthChange(int newYear, int newMonth) { event.setColor(getResources().getColor(R.color.event_color_03)); events.add(event); + // All day event until 00:00 next day + startTime = Calendar.getInstance(); + startTime.set(Calendar.DAY_OF_MONTH, 10); + startTime.set(Calendar.HOUR_OF_DAY, 0); + startTime.set(Calendar.MINUTE, 0); + startTime.set(Calendar.SECOND, 0); + startTime.set(Calendar.MILLISECOND, 0); + startTime.set(Calendar.MONTH, newMonth-1); + startTime.set(Calendar.YEAR, newYear); + endTime = (Calendar) startTime.clone(); + endTime.set(Calendar.DAY_OF_MONTH, 11); + event = new WeekViewEvent(8, getEventTitle(startTime), null, startTime, endTime, true); + event.setColor(getResources().getColor(R.color.event_color_01)); + events.add(event); + return events; } From cfc53d38f6d1f1bd8f60ecc0c35cd8372b3191b8 Mon Sep 17 00:00:00 2001 From: marunjar Date: Thu, 25 Feb 2016 17:54:14 +0100 Subject: [PATCH 2/2] fix property names and description --- README.md | 5 +- .../java/com/alamkanak/weekview/WeekView.java | 46 +++++++++++-------- library/src/main/res/values/attrs.xml | 4 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 7226cc360..03669b973 100644 --- a/README.md +++ b/README.md @@ -104,10 +104,9 @@ You can customize the look of the `WeekView` in xml. Use the following attribute - `eventPadding` - `eventTextColor` - `eventTextSize` -- `focusPoint` - `firstDayOfWeek` -- `fixedFocusPointEnabled` The focused point (time) while zooming the week view. You can declare it as a fraction `app:focusPoint="30%"` and if is not declared the top of the view is used. -- `fixedFocusPointFraction` If you disable the fixed focus point the center of your zoom gesture is used. +- `zoomFocusPoint` The focused point (percentage of the view height) where the week view is zoomed around. This point will not move while zooming. You can declare it as a fraction `app:focusPoint="30%"` and if is not declared the top of the view is used. +- `zoomFocusPointEnabled` If you set this to ``false`` the zoomFocusPoint won't take effect any more while zooming. The zoom will always be focused at the center of your gesture. - `headerColumnBackground` - `headerColumnPadding` - `headerColumnTextColor` diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index a29da5dab..fd3437508 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -143,8 +143,8 @@ private enum Direction { private boolean mHorizontalFlingEnabled = true; private boolean mVerticalFlingEnabled = true; private int mAllDayEventHeight= 100; - private float mFixedFocusPointFraction = 0; - private boolean mFixedFocusPointEnabled = true; + private float mZoomFocusPoint = 0; + private boolean mZoomFocusPointEnabled = true; private int mScrollDuration = 250; // Listeners. @@ -354,8 +354,8 @@ public WeekView(Context context, AttributeSet attrs, int defStyleAttr) { mHorizontalFlingEnabled = a.getBoolean(R.styleable.WeekView_horizontalFlingEnabled, mHorizontalFlingEnabled); mVerticalFlingEnabled = a.getBoolean(R.styleable.WeekView_verticalFlingEnabled, mVerticalFlingEnabled); mAllDayEventHeight = a.getDimensionPixelSize(R.styleable.WeekView_allDayEventHeight, mAllDayEventHeight); - mFixedFocusPointFraction = a.getFraction(R.styleable.WeekView_fixedFocusPointFraction, 1, 1, mFixedFocusPointFraction); - mFixedFocusPointEnabled = a.getBoolean(R.styleable.WeekView_fixedFocusPointEnabled, mFixedFocusPointEnabled); + mZoomFocusPoint = a.getFraction(R.styleable.WeekView_zoomFocusPoint, 1, 1, mZoomFocusPoint); + mZoomFocusPointEnabled = a.getBoolean(R.styleable.WeekView_zoomFocusPointEnabled, mZoomFocusPointEnabled); mScrollDuration = a.getInt(R.styleable.WeekView_scrollDuration, mScrollDuration); } finally { a.recycle(); @@ -1783,33 +1783,41 @@ public void setAllDayEventHeight(int height) { } /** - * Enable fixed zoom focus point + * Enable zoom focus point + * If you set this to false the `zoomFocusPoint` won't take effect any more while zooming. + * The zoom will always be focused at the center of your gesture. */ - public void setFixedFocusPointEnabled(boolean fixedFocusPointEnabled) { - mFixedFocusPointEnabled = fixedFocusPointEnabled; + public void setZoomFocusPointEnabled(boolean zoomFocusPointEnabled) { + mZoomFocusPointEnabled = zoomFocusPointEnabled; } /* - * is fixed focus point enabled + * Is focus point enabled * @return fixed focus point enabled? */ - public boolean isFixedFocusPointEnabled() { - return mFixedFocusPointEnabled; + public boolean isZoomFocusPointEnabled() { + return mZoomFocusPointEnabled; } /* - * Get fractional focus point, 0 = 0% of height, 1 = 100% of height - * @return fixed focus point + * Get focus point + * 0 = top of view, 1 = bottom of view + * The focused point (multiplier of the view height) where the week view is zoomed around. + * This point will not move while zooming. + * @return focus point */ - public float getFixedFocusPointFraction() { - return mFixedFocusPointFraction; + public float getZoomFocusPoint() { + return mZoomFocusPoint; } /** - * Set fractional focus point, 0 = 0% of height, 1 = 100% of height + * Set focus point + * 0 = top of view, 1 = bottom of view + * The focused point (multiplier of the view height) where the week view is zoomed around. + * This point will not move while zooming. */ - public void setFixedFocusPointFraction(int fixedFocusPointFraction) { - mFixedFocusPointFraction = fixedFocusPointFraction; + public void setZoomFocusPoint(int zoomFocusPoint) { + mZoomFocusPoint = zoomFocusPoint; } @@ -2073,9 +2081,9 @@ public boolean onScaleBegin(ScaleGestureDetector detector) { goToNearestOrigin(); // Calculate focused point for scale action - if (mFixedFocusPointEnabled) { + if (mZoomFocusPointEnabled) { // Use fractional focus, percentage of height - mFocusedPointY = (getHeight() - mHeaderHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) * mFixedFocusPointFraction; + mFocusedPointY = (getHeight() - mHeaderHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) * mZoomFocusPoint; } else { // Grab focus mFocusedPointY = detector.getFocusY(); diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml index b8d72d59b..affc40c92 100644 --- a/library/src/main/res/values/attrs.xml +++ b/library/src/main/res/values/attrs.xml @@ -50,8 +50,8 @@ - - + +