Skip to content

Added posibility of using selectors as backgrounds for specific dates #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ protected void setCustomResources(DateTime dateTime, View backgroundView,
}
}

View.OnLayoutChangeListener onLayoutChangeListener = new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
v.setSelected(true);
v.removeOnLayoutChangeListener(this);
}
};

/**
* Customize colors of text and background based on states of the cell
* (disabled, active, selected, etc)
Expand Down Expand Up @@ -280,6 +288,7 @@ protected void customizeTextView(int position, TextView cellView) {
}

cellView.setTextColor(CaldroidFragment.selectedTextColor);
cellView.addOnLayoutChangeListener(onLayoutChangeListener);
} else {
shouldResetSelectedView = true;
}
Expand Down