From da6b17e79830a66096ab00bf7270b9da360248ab Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 31 Dec 2018 19:07:21 +0000 Subject: [PATCH] slight speed up on re-coloring inactive drawer items --- .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 5c2c6f5c..5aa6ace2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -21,6 +21,7 @@ import android.content.Intent; import android.content.pm.PackageInfo; import android.os.Build; import android.os.Bundle; +import android.support.annotation.ColorInt; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; @@ -100,11 +101,13 @@ public class MainActivity extends AppCompatActivity { item.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg)); } + @ColorInt int transparent = getResources().getColor(android.R.color.transparent); + LinearLayout actions = drawer.findViewById(R.id.nav_actions); for (int i = 0; i < actions.getChildCount(); i++) { View view = actions.getChildAt(i); if (view.getId() != id) { - view.setBackgroundColor(getResources().getColor(android.R.color.transparent)); + view.setBackgroundColor(transparent); } } } -- 2.39.5