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 ownCloud color to notifications for lollipop #1177

Merged
merged 6 commits into from
Oct 22, 2015
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public static NotificationCompat.Builder newNotificationBuilderWithProgressBar(C
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return new NotificationBuilderWithProgressBar(context);
} else {
return new NotificationCompat.Builder(context);
return new NotificationCompat.Builder(context).
setColor(context.getResources().getColor(R.color.primary));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndyScherzinger could it be possible to use this color https://github.com/owncloud/android/blob/master/res/values/setup.xml#L34 instead of the color.primary? The reason is because we have some branded apps and we need this change to bit there too.

@jancborchardt @MTRichards what do you think? what Andy has modified is the background color of the notification image, I am suggesting to use the same one that it´s used on the top bar of the app

@AndyScherzinger please, don´t modify till we have their input 😸 thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rperezb primary is the action bar color :) - with the move to material design the primary color defines the color of the action bar. the color you referred to isn't used anymore in the app. So this is right now legacy code looking at the android app but might still be used by other third party apps who haven't moved to material with the AppCompat implementation yet.

In case we want to define this for third party apps also would mean we would have to move the primary color etc to the setup.xml file

Besides this wouldn't have any impact on branded apps since the notifications are part of the app thus as long as other apps don't set the color exactly the way we would do now in our own code this wouldn't have any impact on their app's notifications :(

}
}

Expand Down
1 change: 1 addition & 0 deletions src/com/owncloud/android/syncadapter/FileSyncAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ private void notifyForgottenLocalFiles() {
private NotificationCompat.Builder createNotificationBuilder() {
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getContext());
notificationBuilder.setSmallIcon(R.drawable.notification_icon).setAutoCancel(true);
notificationBuilder.setColor(getContext().getResources().getColor(R.color.primary));
return notificationBuilder;
}

Expand Down