Skip to content

Commit

Permalink
Add ability set integer color for background. fix #360
Browse files Browse the repository at this point in the history
  • Loading branch information
dexion committed Jan 20, 2016
1 parent 9520dfa commit ff6aa33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,17 @@ protected void setCustomResources(DateTime dateTime, View backgroundView,

// Set it
if (backgroundResource != null) {
backgroundView.setBackgroundResource(backgroundResource);
try
{
String tmp = this.context.getResources().getResourceName(backgroundResource);
// have resource
backgroundView.setBackgroundResource(backgroundResource);
}
catch(Resources.NotFoundException e)
{
// doesn't have resource, use like color
backgroundView.setBackgroundColor(backgroundResource);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public void onSelectDate(Date date, View view) {
Toast.makeText(getApplicationContext(), formatter.format(date),
Toast.LENGTH_SHORT).show();

caldroidFragment.setBackgroundResourceForDate(0xffff0000, date);
caldroidFragment.refreshView();
}

@Override
Expand Down

0 comments on commit ff6aa33

Please sign in to comment.