/** * Set the visibility of the extra metadata view. * * @param visible True to show, false to hide */ private void setExtraInfoVisible(boolean visible) { TableLayout table = mInfoTable; if (table == null) return; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD_MR1) visible = false; table.setColumnCollapsed(0, !visible); // Make title, album, and artist multi-line when extra info is visible boolean singleLine = !visible; for (int i = 0; i != 3; ++i) { TableRow row = (TableRow) table.getChildAt(i); ((TextView) row.getChildAt(1)).setSingleLine(singleLine); } // toggle visibility of all but the first three rows (the title/artist/ // album rows) and the last row (the seek bar) int visibility = visible ? View.VISIBLE : View.GONE; for (int i = table.getChildCount() - 1; --i != 2; ) { table.getChildAt(i).setVisibility(visibility); } mExtraInfoVisible = visible; if (visible && !mHandler.hasMessages(MSG_LOAD_EXTRA_INFO)) { mHandler.sendEmptyMessage(MSG_LOAD_EXTRA_INFO); } }