Merge pull request #2110 from ShridharGoel/issue2107

Fix #2107 by changing notification text colour to white in night mode
This commit is contained in:
Ashish Kumar 2018-12-15 13:55:13 +05:30 committed by GitHub
commit 6754ce121c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package fr.free.nrw.commons.notification;
import android.graphics.Color;
import android.preference.PreferenceManager;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
@ -77,7 +78,13 @@ public class NotificationRenderer extends Renderer<Notification> {
public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
ds.setColor(Color.BLACK);
if(PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("theme", false)) {
ds.setColor(Color.WHITE);
}
else {
ds.setColor(Color.BLACK);
}
}
};