synchronized void initBottomStatus(int num) { // 4 if (mLeftAmplitude == null || mRightAmplitude == null) { LogUtil.w(TAG, "mLeftAmplitude: " + mLeftAmplitude + " ,mRightAmplitude: " + mRightAmplitude); return; } mLeftAmplitude.removeAllViews(); mRightAmplitude.removeAllViews(); for (int i = 0; i < 6; i++) { ImageView imageViewl_i = new ImageView(getContext()); ImageView imageViewR_i = new ImageView(getContext()); if (i > (6 - num - 1)) { // 1 imageViewl_i.setImageResource(R.drawable.chatroom_speaker); } else { imageViewl_i.setImageResource(R.drawable.chatroom_unspeaker); } if (i >= num) { // 4 imageViewR_i.setImageResource(R.drawable.chatroom_unspeaker); } else { imageViewR_i.setImageResource(R.drawable.chatroom_speaker); } mLeftAmplitude.addView( imageViewl_i, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1.0f)); mRightAmplitude.addView( imageViewR_i, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1.0f)); } }