Skip to content

Commit 80f6a70

Browse files
committed
Fix bugs and add comments
1 parent dbe7525 commit 80f6a70

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,9 @@ public WeekView(Context context, AttributeSet attrs, int defStyleAttr) {
339339
mEventMarginVertical = a.getDimensionPixelSize(R.styleable.WeekView_eventMarginVertical, mEventMarginVertical);
340340
mXScrollingSpeed = a.getFloat(R.styleable.WeekView_xScrollingSpeed, mXScrollingSpeed);
341341
mEventCornerRadius = a.getDimensionPixelSize(R.styleable.WeekView_eventCornerRadius, mEventCornerRadius);
342-
343342
mShowDistinctPastFutureColor = a.getBoolean(R.styleable.WeekView_showDistinctPastFutureColor, mShowDistinctPastFutureColor);
344343
mShowDistinctWeekendColor = a.getBoolean(R.styleable.WeekView_showDistinctWeekendColor, mShowDistinctWeekendColor);
345344
mShowNowLine = a.getBoolean(R.styleable.WeekView_showNowLine, mShowNowLine);
346-
347345
mHorizontalFlingEnabled = a.getBoolean(R.styleable.WeekView_horizontalFlingEnabled, mHorizontalFlingEnabled);
348346
mVerticalFlingEnabled = a.getBoolean(R.styleable.WeekView_verticalFlingEnabled, mVerticalFlingEnabled);
349347
} finally {
@@ -1685,18 +1683,34 @@ public void setNowLineThickness(int nowLineThickness) {
16851683
invalidate();
16861684
}
16871685

1686+
/**
1687+
* Get whether the week view should fling horizontally.
1688+
* @return True if the week view has horizontal fling enabled.
1689+
*/
16881690
public boolean isHorizontalFlingEnabled() {
16891691
return mHorizontalFlingEnabled;
16901692
}
16911693

1694+
/**
1695+
* Set whether the week view should fling horizontally.
1696+
* @return True if it should have horizontal fling enabled.
1697+
*/
16921698
public void setHorizontalFlingEnabled(boolean enabled) {
16931699
mHorizontalFlingEnabled = enabled;
16941700
}
16951701

1702+
/**
1703+
* Get whether the week view should fling vertically.
1704+
* @return True if the week view has vertical fling enabled.
1705+
*/
16961706
public boolean isVerticalFlingEnabled() {
16971707
return mVerticalFlingEnabled;
16981708
}
16991709

1710+
/**
1711+
* Set whether the week view should fling vertically.
1712+
* @return True if it should have vertical fling enabled.
1713+
*/
17001714
public void setVerticalFlingEnabled(boolean enabled) {
17011715
mVerticalFlingEnabled = enabled;
17021716
}

sample/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</activity>
2020
<activity
2121
android:name=".BasicActivity"
22-
android:label="@string/title_activity_asynchronous" >
22+
android:label="@string/title_activity_basic" >
2323
</activity>
2424
<activity
2525
android:name=".AsynchronousActivity"

sample/src/main/java/com/alamkanak/weekview/sample/AsynchronousActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public void success(List<Event> events, Response response) {
7171

7272
@Override
7373
public void failure(RetrofitError error) {
74+
error.printStackTrace();
7475
Toast.makeText(this, R.string.async_error, Toast.LENGTH_SHORT).show();
7576
}
7677
}

0 commit comments

Comments
 (0)