Use Id to find view in LoadingFrameLayout

Bug: 151744478
Test: Manually
Change-Id: Icdaacb9a50308d0c547b7051ae7042e6fdd015d8
diff --git a/src/com/android/car/dialer/widget/LoadingFrameLayout.java b/src/com/android/car/dialer/widget/LoadingFrameLayout.java
index 1011bed..0f21a47 100644
--- a/src/com/android/car/dialer/widget/LoadingFrameLayout.java
+++ b/src/com/android/car/dialer/widget/LoadingFrameLayout.java
@@ -228,7 +228,7 @@
         if (mState != state) {
             L.d(TAG, "Switch to state: %d", state);
             // Hides, or shows, all the children, including the loading and error views.
-            setChildVisibility(state == State.CONTENT ? View.VISIBLE : View.GONE);
+            ViewUtils.setVisible((View) findViewById(R.id.list_view), state == State.CONTENT);
 
             // Corrects the visibility setting for error and loading views since they are
             // shown independently of the views content.
@@ -240,13 +240,6 @@
         }
     }
 
-    private void setChildVisibility(int visibility) {
-        int childCount = getChildCount();
-        for (int i = 0; i < childCount; i++) {
-            getChildAt(i).setVisibility(visibility);
-        }
-    }
-
     /**
      * Container for views held by this LoadingFrameLayout. Used for deferring view inflation until
      * the view is about to be shown.