From: Damyan Ivanov Date: Mon, 31 Dec 2018 19:07:21 +0000 (+0000) Subject: slight speed up on re-coloring inactive drawer items X-Git-Tag: v0.3~151 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=da6b17e79830a66096ab00bf7270b9da360248ab;p=mobile-ledger.git slight speed up on re-coloring inactive drawer items --- 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); } } }