Skip to content

Commit

Permalink
Cleanup titleListener
Browse files Browse the repository at this point in the history
quentin41500 committed Feb 14, 2017

Verified

This commit was signed with the committer’s verified signature.
michaelsproul Michael Sproul
1 parent 454b276 commit a97c138
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -222,7 +222,6 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
private OnDateSelectedListener listener;
private OnMonthChangedListener monthListener;
private OnRangeSelectedListener rangeListener;
private OnClickListener titleListener;

CharSequence calendarContentDescription;
private int accentColor = 0;
@@ -1362,9 +1361,7 @@ public void setOnRangeSelectedListener(OnRangeSelectedListener listener) {
* @param listener Listener to be notified.
*/
public void setOnTitleClickListener(final OnClickListener listener) {
if (listener != null) {
title.setOnClickListener(listener);
}
title.setOnClickListener(listener);
}

/**
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
widget.setOnTitleClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
Toast.makeText(DynamicSettersActivity.this, "Today is the day", Toast.LENGTH_SHORT)
Toast.makeText(DynamicSettersActivity.this, R.string.today, Toast.LENGTH_SHORT)
.show();
}
});
2 changes: 2 additions & 0 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -48,4 +48,6 @@
<string name="label_thin">Tile width and height specified (thin)</string>
<string name="label_wide">Tile width and height specified (wide)</string>


<string name="today">Today is the day</string>
</resources>

0 comments on commit a97c138

Please sign in to comment.