private void setRotateImageView() { RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams) playerRoundIv.getLayoutParams(); Bitmap bm = ((BitmapDrawable) (getResources().getDrawable(R.drawable.player_round))).getBitmap(); params.width = bm.getWidth(); params.height = bm.getHeight(); if (BoxManagerUtils.getScreenDensity(context) > 1.5) { params.topMargin = 80; } playerRoundIv.setLayoutParams(params); playerRoundIv.roundCenter(); playerRoundIv.setBitmap(bm); playerRoundIv.invalidate(); }
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(); }