1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-02 13:24:09 +00:00

Drawing order

This commit is contained in:
M66B 2015-12-11 18:59:08 +01:00
parent 00a6bc03fc
commit f9ebe6f83c
2 changed files with 15 additions and 15 deletions

View file

@ -405,13 +405,6 @@ 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(2, SinkholeService.this));
// Draw paths
paint.setColor(ContextCompat.getColor(SinkholeService.this, R.color.colorSend));
canvas.drawPath(ptx, paint);
paint.setColor(ContextCompat.getColor(SinkholeService.this, R.color.colorReceive));
canvas.drawPath(prx, paint);
// Draw base line // Draw base line
paint.setStrokeWidth(Util.dips2pixels(1, SinkholeService.this)); paint.setStrokeWidth(Util.dips2pixels(1, SinkholeService.this));
@ -419,6 +412,13 @@ public class SinkholeService extends VpnService {
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);
// Draw paths
paint.setStrokeWidth(Util.dips2pixels(2, SinkholeService.this));
paint.setColor(ContextCompat.getColor(SinkholeService.this, R.color.colorSend));
canvas.drawPath(ptx, paint);
paint.setColor(ContextCompat.getColor(SinkholeService.this, R.color.colorReceive));
canvas.drawPath(prx, paint);
// Update remote view // Update remote view
remoteViews.setImageViewBitmap(R.id.ivTraffic, bitmap); remoteViews.setImageViewBitmap(R.id.ivTraffic, bitmap);
if (txsec < 1000 * 1000) if (txsec < 1000 * 1000)

View file

@ -4,14 +4,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="4dp"> android:padding="4dp">
<ImageView
android:id="@+id/ivTraffic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -61,4 +53,12 @@
android:singleLine="false" android:singleLine="false"
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info" android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
android:textSize="10sp" /> android:textSize="10sp" />
<ImageView
android:id="@+id/ivTraffic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY" />
</RelativeLayout> </RelativeLayout>