DisplayMetrics displaymetrics = new DisplayMetrics();
float density= getResources().getDisplayMetrics().density;
if(density==1.0){ **//This is for mdpi**
params.width = 70;
params.height=70;
dynamicSeekBar.setLayoutParams(params);
// Toast.makeText(this, "1.0", Toast.LENGTH_LONG).show();
}else if(density==1.5){ **//This is for hdpi**
params.width =110;
params.height=110;
dynamicSeekBar.setLayoutParams(params);
// Toast.makeText(this, "1.5", Toast.LENGTH_LONG).show();
}else if(density==2.0){ **//This is for xhdpi**
params.width = 177;
params.height=175;
dynamicSeekBar.setLayoutParams(params);
// Toast.makeText(this, "2.0", Toast.LENGTH_LONG).show();
}
To najlepsza odpowiedź. Dobra robota! – marienke
Dobra odpowiedź (Y) – Saveen