Skip to content
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

add icon to jubilees #112

Open
wants to merge 2 commits 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 @@ -565,6 +565,7 @@ private static Cursor getContactsEvents(Context context, ContentResolver content
*/
private static String generateTitle(Context context, int eventType, Cursor cursor,
int eventCustomLabelColumn, boolean includeAge, String displayName, int age) {
displayName = addJubileeIcon(displayName, age);
String title = null;
if (displayName != null) {
switch (eventType) {
Expand Down Expand Up @@ -603,6 +604,18 @@ private static String generateTitle(Context context, int eventType, Cursor curso
return title;
}

/**
* Adds an icon if jubelee age
*/
private static String addJubileeIcon(String displayName, int age) {
String jubilees = "18, 20, 30, 40, 50, 60, 70, 75, 80, 90, 100";
boolean is_jubilee = jubilees.contains(String.valueOf(age));
if (is_jubilee) {
displayName = "🍾 " + displayName;
}
return displayName;
}

private static void cleanTables(ContentResolver contentResolver, long calendarId) {

// empty table
Expand Down