private void getInfo() { if (mLocationMap == null) { throw new NullPointerException(""); } if (mLocationMap.size() != 0) { return; } for (int i = 0; i < getChildCount(); i++) { View view = getChildAt(i); int top = view.getTop(); int left = view.getLeft(); int bottom = view.getBottom(); int right = view.getRight(); if (view instanceof BaseActionButtonRotation) { mRotationButton = (BaseActionButtonRotation) view; mRotationButton.setOnClickListener(this); mMenuLocation = new int[] {left, top, right, bottom}; it( "mRotationFloatingActionButton", "left " + left + " top " + top + " right " + right + " bottom " + bottom); } else if (view instanceof FloatingActionButtonScroll) { it( "ScrollFloatingActionButton", "left " + left + " top " + top + " right " + right + " bottom " + bottom); mLocationMap.put(i, new int[] {left, top, right, bottom}); view.setVisibility(GONE); } } for (int i = 0; i < getChildCount(); i++) { View view = getChildAt(i); if (view instanceof FloatingActionButtonScroll) { FloatingActionButtonScroll btn = (FloatingActionButtonScroll) view; if (!TextUtils.isEmpty(btn.getTitle())) { TextView textView = new TextView(getContext()); //noinspection deprecation textView.setTextColor(getResources().getColor(R.color.fab_white)); textView.setBackgroundResource(R.drawable.fab_label_background); textView.setText(btn.getTitle()); btn.setTag(textView); textView.setTag(new Rect(0, 0, 0, 0)); textView.setVisibility(INVISIBLE); addView(textView); } btn.initLocation(mLocationMap.get(i), mMenuLocation); } } }