openlauncher icon indicating copy to clipboard operation
openlauncher copied to clipboard

Notification Badge on wired position

Open notavailable2 opened this issue 6 years ago • 8 comments

General Information

OpenLauncher Version: 0.7.2 Android Version: 10 Custom ROM: LineageOS 17.0 Install Source: F-Droid

Description

The red notification dots appears somewhere in the lower half of the icons. On the right side but not in the top corner where i would expect them. See screenshot.

Screenshot_20191209-082206_OpenLauncher-scaleddown

notavailable2 avatar Dec 09 '19 01:12 notavailable2

That's weird; they sit at the top right for me. Let me take a look and I'll get back to you.

hobleyd avatar Dec 10 '19 13:12 hobleyd

Can you point out in which file/function the dot is painted ?

notavailable2 avatar Dec 12 '19 02:12 notavailable2

AppItemView.java -> onDraw()

if (_notificationCount > 0) { float radius = _iconSize * .15f; canvas.drawCircle(_iconSize - radius, _heightPadding, radius, _notifyPaint); }

hobleyd avatar Dec 12 '19 07:12 hobleyd

thank you.

they sit at the top right for me.

yes they do on default setup. if you remove "position indicator", "show labels", "search bar", or change number of rows, they are offset.

with your hint i at least could make a dirty version for myself by removing some numbers from y.

notavailable2 avatar Dec 12 '19 09:12 notavailable2

Perfect - that makes sense. The new line required is: canvas.drawCircle(_iconSize - radius, radius, radius, _notifyPaint); If you could confirm that works for you, I'll submit a PR.

hobleyd avatar Dec 12 '19 13:12 hobleyd

yes, that worked.

may i propose following version, which shows the notification-count and places the dot a bit outside the icon. see attachment.

    _notifyPaint.setAntiAlias(true);
    canvas.drawCircle(_iconSize - (radius/2), radius/2, radius, _notifyPaint);
    if (_notificationCount>9) {_notificationCount=9;}
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setColor(Color.rgb(255,255,255));
    paint.setTextSize((int) (radius*2));
    canvas.drawText(String.valueOf(_notificationCount), _iconSize - radius, radius+(radius/8), paint);

Screenshot_OpenLauncher

notavailable2 avatar Dec 12 '19 13:12 notavailable2

OK, I have added in the suggested change to put numbers in the notification label (I made a couple of changes from your suggested code, sorry). Great suggestion, thanks.

PR has been submitted (#539).

hobleyd avatar Dec 12 '19 18:12 hobleyd

TNX for the fixes

notavailable2 avatar Dec 13 '19 01:12 notavailable2