mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-24 15:21:19 +00:00
Visual improvements
This commit is contained in:
parent
f0e79abcbd
commit
ba9fa0947e
1 changed files with 5 additions and 5 deletions
|
@ -318,7 +318,7 @@ public class SinkholeService extends VpnService {
|
||||||
canvas.drawColor(Color.TRANSPARENT);
|
canvas.drawColor(Color.TRANSPARENT);
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
|
||||||
float base = Integer.parseInt(prefs.getString("stats_base", "5")) * 1024f;
|
float base = Integer.parseInt(prefs.getString("stats_base", "5")) * 1000f;
|
||||||
|
|
||||||
// Determine max
|
// Determine max
|
||||||
long xmax = 0;
|
long xmax = 0;
|
||||||
|
@ -339,7 +339,7 @@ public class SinkholeService extends VpnService {
|
||||||
Path ptx = new Path();
|
Path ptx = new Path();
|
||||||
Path prx = new Path();
|
Path prx = new Path();
|
||||||
for (int i = 0; i < gtx.size(); i++) {
|
for (int i = 0; i < gtx.size(); i++) {
|
||||||
float x = width * (xmax - gt.get(i)) / 1000f / 100f;
|
float x = width - width * (xmax - gt.get(i)) / 1000f / 100f;
|
||||||
float ytx = height - height * gtx.get(i) / ymax;
|
float ytx = height - height * gtx.get(i) / ymax;
|
||||||
float yrx = height - height * grx.get(i) / ymax;
|
float yrx = height - height * grx.get(i) / ymax;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
@ -354,7 +354,7 @@ public class SinkholeService extends VpnService {
|
||||||
// Build paint
|
// Build paint
|
||||||
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
paint.setStyle(Paint.Style.STROKE);
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
paint.setStrokeWidth(Util.dips2pixels(3, SinkholeService.this));
|
paint.setStrokeWidth(Util.dips2pixels(2, SinkholeService.this));
|
||||||
|
|
||||||
// Draw paths
|
// Draw paths
|
||||||
paint.setColor(Color.MAGENTA);
|
paint.setColor(Color.MAGENTA);
|
||||||
|
@ -362,8 +362,8 @@ public class SinkholeService extends VpnService {
|
||||||
paint.setColor(Color.BLUE);
|
paint.setColor(Color.BLUE);
|
||||||
canvas.drawPath(prx, paint);
|
canvas.drawPath(prx, paint);
|
||||||
|
|
||||||
// Draw 1 KiB line
|
// Draw base line
|
||||||
paint.setStrokeWidth(0);
|
paint.setStrokeWidth(Util.dips2pixels(1, SinkholeService.this));
|
||||||
paint.setColor(Color.GRAY);
|
paint.setColor(Color.GRAY);
|
||||||
float y = height - height * base / ymax;
|
float y = height - height * base / ymax;
|
||||||
canvas.drawLine(0, y, width, y, paint);
|
canvas.drawLine(0, y, width, y, paint);
|
||||||
|
|
Loading…
Reference in a new issue