public static String traverseView(StringBuilder stringBuilder, ViewGroup root) {
        try {
            if (stringBuilder == null) {
                stringBuilder = new StringBuilder();
            }

            if (root == null) {
                return stringBuilder.toString();
            }

            final int childCount = root.getChildCount();
            for (int i = 0; i < childCount; ++i) {
                final View child = root.getChildAt(i);
                if (child == null) {
                    continue;
                }
                if (child.getVisibility() != View.VISIBLE) {
                    continue;
                }

                if (child instanceof ViewGroup) {
                    traverseView(stringBuilder, (ViewGroup) child);
                } else {
                    if (isViewIgnored(child)) {
                        continue;
                    }

                    String viewText = SAViewUtils.getViewContent(child);
                    if (!TextUtils.isEmpty(viewText)) {
                        stringBuilder.append(viewText);
                        stringBuilder.append("-");
                    }
                }
            }
            return stringBuilder.toString();
        } catch (Throwable e) {
            SALog.i(TAG, e.getMessage());
            return stringBuilder != null ? stringBuilder.toString() : "";
        }
    }
@Test
    public void traverseView() {
        LinearLayout linearLayout = new LinearLayout(mApplication);
        TextView textView1 = new TextView(mApplication);
        textView1.setText("child1");
        TextView textView2 = new TextView(mApplication);
        textView2.setText("child2");
        linearLayout.addView(textView1);
        linearLayout.addView(textView2);
        StringBuilder stringBuilder = new StringBuilder();
        String result = SAViewUtils.traverseView(stringBuilder, linearLayout);
        Assert.assertEquals("child1-child2-", result);
    }