private void setRotateImageView_operate() { RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams) playerOperate.getLayoutParams(); Bitmap bm = ((BitmapDrawable) (getResources().getDrawable(R.drawable.player_start01))).getBitmap(); params.height = bm.getHeight(); params.width = bm.getWidth(); float density = BoxManagerUtils.getScreenDensity(context); if (density > 1.5) { params.topMargin = 60; } playerOperate.setLayoutParams(params); playerOperate.setBitmap(bm); if (density <= 1.5) { playerOperate.setMaxDegrees(30); } else { playerOperate.setMaxDegrees(42); } playerOperate.setRoundRadiuX(0.7963); playerOperate.setRoundRadiuY(0.2045); playerOperate.invalidate(); }
protected void updateView(WifiMusicInfo info) { currMusicInfo = info; if (System.currentTimeMillis() - collectTime > changeButtonStateDelayed) { if (currMusicInfo.is_isCollected()) { goodMusicBtn.setImageResource(R.drawable.player_good_music_pressed); } else { goodMusicBtn.setImageResource(R.drawable.player_good_music_selector); } } String currState = info.getPlayStatus(); if (MUSIC_STATE_DLAN.equals(currState)) { isDlanPlay = true; music_player_dlan.setVisibility(View.VISIBLE); music_player_normal.setVisibility(View.GONE); } else { isDlanPlay = false; music_player_dlan.setVisibility(View.GONE); music_player_normal.setVisibility(View.VISIBLE); String currMusicName = info.getName() != null ? info.getName() : ""; String currSinger = info.getAuthor() != null ? info.getAuthor() : ""; int currVolume = info.getMusicCurrVolume() - 1; int maxVolume = info.getMusicMaxVolume() - 1; LogManager.e("volume :" + currVolume + "," + maxVolume); if (maxVolume != seekBar.getMax()) { seekBar.setMax(maxVolume); } if (System.currentTimeMillis() - volumeChangeTime > changeButtonStateDelayed) { if (currVolume != seekBar.getProgress()) { seekBar.setTag("unchange"); seekBar.setProgress(currVolume); } } if (!isOperateButton) { if (MUSIC_STATE_STOP.equals(currState) || MUSIC_STATE_PAUSE.equals(currState)) { if (!"".equals(getPrefString(KeyList.PKEY_SELECT_MUSIC_ID))) { setPrefString(KeyList.PKEY_SELECT_MUSIC_ID, ""); } playerRoundIv.pauseRound(); playerOperate.release(); playOrPause.setBackgroundResource(R.drawable.player_play_btn_selector); } else if (MUSIC_STATE_PLAYING.equals(currState)) { if (info.getMusicId() != null && !info.getMusicId().equals(getPrefString(KeyList.PKEY_SELECT_MUSIC_ID))) { setPrefString(KeyList.PKEY_SELECT_MUSIC_ID, info.getMusicId()); } playerOperate.startRound(); playerRoundIv.startRound(); playOrPause.setBackgroundResource(R.drawable.player_pause_btn_selector); } } // } if (!currMusicName.equals(musicName)) { playerMainLayout.setBackgroundDrawable(getBgRandom(playerMainLayout)); songTv.setText(currMusicName); } if (!currSinger.equals(singer)) { singerTv.setText(currSinger); } musicName = currMusicName; singer = currSinger; } }